Skip to content
Snippets Groups Projects
Commit 2baaba76 authored by l.zappia's avatar l.zappia
Browse files

Merge branch 'master' into devel

* master:
  Version 0.99.14
  Add panel function to vignette
  Change var plot scale
  Run checks
  Update panel functions
  Add makeOverallPanel function
  Add makeDiffPanel function
  Add options to comparison plots

From: Luke Zappia <lazappi@users.noreply.github.com>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/splatter@127789 bc3139a8-67e5-0310-9ffc-ced21a209358
parents 5bbd4ecc 0d01915a
No related branches found
No related tags found
No related merge requests found
Package: splatter Package: splatter
Type: Package Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 0.99.13 Version: 0.99.14
Date: 2017-03-25 Date: 2017-03-28
Author: Luke Zappia Author: Luke Zappia
Authors@R: Authors@R:
c(person("Luke", "Zappia", role = c("aut", "cre"), c(person("Luke", "Zappia", role = c("aut", "cre"),
...@@ -46,7 +46,8 @@ Suggests: ...@@ -46,7 +46,8 @@ Suggests:
BiocStyle, BiocStyle,
covr, covr,
S4Vectors, S4Vectors,
SummarizedExperiment SummarizedExperiment,
cowplot
biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing, biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing,
Software Software
URL: https://github.com/Oshlack/splatter URL: https://github.com/Oshlack/splatter
......
...@@ -20,6 +20,9 @@ export(lun2Estimate) ...@@ -20,6 +20,9 @@ export(lun2Estimate)
export(lun2Simulate) export(lun2Simulate)
export(lunEstimate) export(lunEstimate)
export(lunSimulate) export(lunSimulate)
export(makeCompPanel)
export(makeDiffPanel)
export(makeOverallPanel)
export(newLun2Params) export(newLun2Params)
export(newLunParams) export(newLunParams)
export(newSCDDParams) export(newSCDDParams)
...@@ -58,17 +61,20 @@ importFrom(checkmate,checkIntegerish) ...@@ -58,17 +61,20 @@ importFrom(checkmate,checkIntegerish)
importFrom(checkmate,checkNumber) importFrom(checkmate,checkNumber)
importFrom(checkmate,checkNumeric) importFrom(checkmate,checkNumeric)
importFrom(ggplot2,aes_string) importFrom(ggplot2,aes_string)
importFrom(ggplot2,element_blank)
importFrom(ggplot2,geom_abline) importFrom(ggplot2,geom_abline)
importFrom(ggplot2,geom_boxplot) importFrom(ggplot2,geom_boxplot)
importFrom(ggplot2,geom_hline) importFrom(ggplot2,geom_hline)
importFrom(ggplot2,geom_point) importFrom(ggplot2,geom_point)
importFrom(ggplot2,geom_smooth) importFrom(ggplot2,geom_smooth)
importFrom(ggplot2,geom_violin)
importFrom(ggplot2,ggplot) importFrom(ggplot2,ggplot)
importFrom(ggplot2,ggtitle) importFrom(ggplot2,ggtitle)
importFrom(ggplot2,scale_colour_manual)
importFrom(ggplot2,scale_fill_manual)
importFrom(ggplot2,scale_x_log10) importFrom(ggplot2,scale_x_log10)
importFrom(ggplot2,scale_y_continuous) importFrom(ggplot2,scale_y_continuous)
importFrom(ggplot2,scale_y_log10) importFrom(ggplot2,scale_y_log10)
importFrom(ggplot2,theme)
importFrom(ggplot2,theme_minimal) importFrom(ggplot2,theme_minimal)
importFrom(ggplot2,xlab) importFrom(ggplot2,xlab)
importFrom(ggplot2,ylab) importFrom(ggplot2,ylab)
......
# 0.99.14
* Add functions for making comparison panels
* Add panel section to vignette
* Change variance plot scale (for consistency)
# 0.99.13 # 0.99.13
* Modify how Lun2Params stores gene paramters to use data.frame * Modify how Lun2Params stores gene paramters to use data.frame
......
This diff is collapsed.
...@@ -4,10 +4,19 @@ ...@@ -4,10 +4,19 @@
\alias{compareSCESets} \alias{compareSCESets}
\title{Compare SCESet objects} \title{Compare SCESet objects}
\usage{ \usage{
compareSCESets(sces) compareSCESets(sces, point.size = 0.1, point.alpha = 0.1, fits = TRUE,
colours = NULL)
} }
\arguments{ \arguments{
\item{sces}{named list of SCESet objects to combine and compare.} \item{sces}{named list of SCESet objects to combine and compare.}
\item{point.size}{size of points in scatter plots.}
\item{point.alpha}{opacity of points in scatter plots.}
\item{fits}{whether to include fits in scatter plots.}
\item{colours}{vector of colours to use for each dataset.}
} }
\value{ \value{
List containing the combined datasets and plots. List containing the combined datasets and plots.
......
...@@ -4,12 +4,21 @@ ...@@ -4,12 +4,21 @@
\alias{diffSCESets} \alias{diffSCESets}
\title{Diff SCESet objects} \title{Diff SCESet objects}
\usage{ \usage{
diffSCESets(sces, ref) diffSCESets(sces, ref, point.size = 0.1, point.alpha = 0.1, fits = TRUE,
colours = NULL)
} }
\arguments{ \arguments{
\item{sces}{named list of SCESet objects to combine and compare.} \item{sces}{named list of SCESet objects to combine and compare.}
\item{ref}{string giving the name of the SCESet to use as the reference} \item{ref}{string giving the name of the SCESet to use as the reference}
\item{point.size}{size of points in scatter plots.}
\item{point.alpha}{opacity of points in scatter plots.}
\item{fits}{whether to include fits in scatter plots.}
\item{colours}{vector of colours to use for each dataset.}
} }
\value{ \value{
List containing the combined datasets and plots. List containing the combined datasets and plots.
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{makeCompPanel}
\alias{makeCompPanel}
\title{Make comparison panel}
\usage{
makeCompPanel(comp, title = "Comparison", labels = c("Means", "Variance",
"Mean-variance relationship", "Library size", "Zeros per gene",
"Zeros per cell", "Mean-zeros relationship"))
}
\arguments{
\item{comp}{list returned by \code{\link{compareSCESets}}.}
\item{title}{title for the panel.}
\item{labels}{vector of labels for each of the seven plots.}
}
\value{
Combined panel plot
}
\description{
Combine the plots from \code{compareSCESets} into a single panel.
}
\examples{
\dontrun{
sim1 <- splatSimulate(nGenes = 1000, groupCells = 20)
sim2 <- simpleSimulate(nGenes = 1000, nCells = 20)
comparison <- compareSCESets(list(Splat = sim1, Simple = sim2))
panel <- makeCompPanel(comparison)
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{makeDiffPanel}
\alias{makeDiffPanel}
\title{Make difference panel}
\usage{
makeDiffPanel(diff, title = "Difference comparison", labels = c("Means",
"Variance", "Library size", "Zeros per cell", "Zeros per gene",
"Mean-variance relationship", "Mean-zeros relationship"))
}
\arguments{
\item{diff}{list returned by \code{\link{diffSCESets}}.}
\item{title}{title for the panel.}
\item{labels}{vector of labels for each of the seven sections.}
}
\value{
Combined panel plot
}
\description{
Combine the plots from \code{diffSCESets} into a single panel.
}
\examples{
\dontrun{
sim1 <- splatSimulate(nGenes = 1000, groupCells = 20)
sim2 <- simpleSimulate(nGenes = 1000, nCells = 20)
difference <- diffSCESets(list(Splat = sim1, Simple = sim2), ref = "Simple")
panel <- makeDiffPanel(difference)
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{makeOverallPanel}
\alias{makeOverallPanel}
\title{Make overall panel}
\usage{
makeOverallPanel(comp, diff, title = "Overall comparison",
row.labels = c("Means", "Variance", "Mean-variance relationship",
"Library size", "Zeros per cell", "Zeros per gene",
"Mean-zeros relationship"))
}
\arguments{
\item{comp}{list returned by \code{\link{compareSCESets}}.}
\item{diff}{list returned by \code{\link{diffSCESets}}.}
\item{title}{title for the panel.}
\item{row.labels}{vector of labels for each of the seven rows.}
}
\value{
Combined panel plot
}
\description{
Combine the plots from \code{compSCESets} and \code{diffSCESets} into a
single panel.
}
\examples{
\dontrun{
sim1 <- splatSimulate(nGenes = 1000, groupCells = 20)
sim2 <- simpleSimulate(nGenes = 1000, nCells = 20)
comparison <- compSCESets(list(Splat = sim1, Simple = sim2))
difference <- diffSCESets(list(Splat = sim1, Simple = sim2), ref = "Simple")
panel <- makeOverallPanel(comparison, difference)
}
}
...@@ -473,6 +473,30 @@ distributions. ...@@ -473,6 +473,30 @@ distributions.
difference$QQPlots$Means difference$QQPlots$Means
``` ```
## Making panels
Each of these comparisons makes several plots which can be a lot to look at. To
make this easier, or to produce figures for publications, you can make use of
the functions `makeCompPanel`, `makeDiffPanel` and `makeOverallPanel`.
These functions combine the plots into a single panel using the `cowplot`
package. The panels can be quite large and hard to view (for example in
RStudio's plot viewer) so it can be better to output the panels and view them
separately. Luckily `cowplot` provides a convenient function for saving the
images. Here are some suggested parameters for outputting each of the panels:
```{r save-panels, eval = FALSE}
# This code is just an example and is not run
panel <- makeCompPanel(comparison)
cowplot::save_plot("comp_panel.png", panel, nrow = 4, ncol = 3)
panel <- makeDiffPanel(difference)
cowplot::save_plot("diff_panel.png", panel, nrow = 3, ncol = 5)
panel <- makeOverallPanel(comparison, difference)
cowplot::save_plot("overall_panel.png", panel, ncol = 4, nrow = 7)
```
# Session information {-} # Session information {-}
```{r sessionInfo} ```{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