Skip to content
Snippets Groups Projects
Commit 7d79daa4 authored by Luke Zappia's avatar Luke Zappia
Browse files

Add diffSCESets to vignette

parent d71fbd1b
No related branches found
No related tags found
No related merge requests found
......@@ -219,12 +219,11 @@ compareSCESets <- function(sces) {
#' @examples
#' sim1 <- splatSimulate(nGenes = 1000, groupCells = 20)
#' sim2 <- simpleSimulate(nGenes = 1000, nCells = 20)
#' comparison <- compareSCESets(list(Splat = sim1, Simple = sim2))
#' names(comparison)
#' names(comparison$Plots)
#' @importFrom ggplot2 ggplot aes_string geom_point geom_smooth geom_boxplot
#' geom_violin scale_y_continuous scale_y_log10 scale_x_log10 xlab ylab ggtitle
#' theme_minimal
#' difference <- diffSCESets(list(Splat = sim1, Simple = sim2), ref = "Simple")
#' names(difference)
#' names(difference$Plots)
#' @importFrom ggplot2 ggplot aes_string geom_point geom_boxplot xlab ylab
#' ggtitle theme_minimal
#' @importFrom scater cpm<-
#' @export
diffSCESets <- function(sces, ref) {
......
......@@ -70,7 +70,7 @@ using \code{\link[ggplot2]{ggplot}}.
\examples{
sim1 <- splatSimulate(nGenes = 1000, groupCells = 20)
sim2 <- simpleSimulate(nGenes = 1000, nCells = 20)
comparison <- compareSCESets(list(Splat = sim1, Simple = sim2))
names(comparison)
names(comparison$Plots)
difference <- diffSCESets(list(Splat = sim1, Simple = sim2), ref = "Simple")
names(difference)
names(difference$Plots)
}
......@@ -452,6 +452,27 @@ ggplot(comparison$PhenoData,
geom_point()
```
## Comparing differences
Sometimes instead of visually comparing datasets it may be more interesting to
look at the differences between them. We can do this using the `diffSCESets`
function. Similar to `compareSCESets` this function takes a list of `SCESet`
objects but now we also specify one to be a reference. A series of similar plots
are returned but instead of showing the overall distributions they demonstrate
differences from the reference.
```{r difference}
difference <- diffSCESets(list(Splat = sim1, Simple = sim2), ref = "Simple")
difference$Plots$Means
```
We also get a series of Quantile-Quantile plot that can be used to compare
distributions.
```{r difference-qq}
difference$QQPlots$Means
```
# Session information {-}
```{r sessionInfo}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment