Skip to content

Commit

Permalink
Add Splat parameters vignette
Browse files Browse the repository at this point in the history
Fix spelling
  • Loading branch information
lazappi committed Apr 18, 2019
1 parent 8574888 commit ff7f4ab
Show file tree
Hide file tree
Showing 151 changed files with 4,098 additions and 1,781 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@
^index\.md$
^_pkgdown\.yml$
^pkgdown$
^doc$
^Meta$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ vignettes/*.pdf
*.knit.md
.Rproj.user
inst/doc
doc
Meta
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: splatter
Type: Package
Title: Simple Simulation of Single-cell RNA Sequencing Data
Version: 1.7.4
Date: 2019-04-17
Version: 1.7.5
Date: 2019-04-18
Author: Luke Zappia
Authors@R:
c(person("Luke", "Zappia", role = c("aut", "cre"),
Expand Down Expand Up @@ -61,11 +61,13 @@ Suggests:
BASiCS,
zinbwave,
SparseDC,
BiocManager
BiocManager,
spelling
biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing,
Software, ImmunoOncology
URL: https://github.com/Oshlack/splatter
BugReports: https://github.com/Oshlack/splatter/issues
RoxygenNote: 6.1.1
Encoding: UTF-8
VignetteBuilder: knitr
Language: en-GB
13 changes: 9 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Version 1.7.5 (2018-04-18)

* Add Splat parameters vignette
* Fix spelling

## Version 1.7.4 (2018-04-17)

* Allow SplatParams parameters to be set in any order
Expand Down Expand Up @@ -53,7 +58,7 @@

* Fix bug in getLNormFactors when reversing factors less than one
* Update documentation to new Roxygen version (6.1.0)
* Change varible name in vignette for compatibility with scater
* Change variable name in vignette for compatibility with scater
* Add suggested package checks to tests

## Version 1.5.1 (2018-06-12)
Expand Down Expand Up @@ -226,7 +231,7 @@

## Version 0.99.13 (2017-03-25)

* Modify how Lun2Params stores gene paramters to use data.frame
* Modify how Lun2Params stores gene parameters to use data.frame
* Move sampling of genes/cells to lun2Simulate
* Return to old Lun2 nGenes estimate

Expand All @@ -236,7 +241,7 @@
* Update compareSCESets plots
* Modify Lun2 nGenes estimate
* Modify how addFeatureStats names columns
* Add infinte bcv.df warning to splatSimulate
* Add infinite bcv.df warning to splatSimulate

## Version 0.99.11 (2017-03-20)

Expand Down Expand Up @@ -338,7 +343,7 @@

* Redesign how parameters are stored
* Each simulation now has it's own S4 Params class
* Modify exisiting simulations to use new parameter objects
* Modify existing simulations to use new parameter objects

## Version 0.6.0 (2016-10-12)

Expand Down
10 changes: 5 additions & 5 deletions R/AllClasses.R
Original file line number Diff line number Diff line change
Expand Up @@ -332,18 +332,18 @@ setClass("LunParams",
#' \item{\emph{Gene parameters}}{
#' \describe{
#' \item{\code{gene.params}}{A \code{data.frame} containing gene
#' parameters with two coloumns: \code{Mean} (mean expression for
#' parameters with two columns: \code{Mean} (mean expression for
#' each gene) and \code{Disp} (dispersion for each gene).}
#' \item{\code{zi.params}}{A \code{data.frame} containing
#' zero-inflated gene parameters with three coloumns: \code{Mean}
#' zero-inflated gene parameters with three columns: \code{Mean}
#' (mean expression for each gene), \code{Disp} (dispersion for
#' each, gene), and \code{Prop} (zero proportion for each gene).}
#' }
#' }
#' \item{\code{[nPlates]}}{The number of plates to simulate.}
#' \item{\emph{Plate parameters}}{
#' \describe{
#' \item{\code{plate.ingroup}}{Character vecotor giving the plates
#' \item{\code{plate.ingroup}}{Character vector giving the plates
#' considered to be part of the "ingroup".}
#' \item{\code{plate.mod}}{Plate effect modifier factor. The plate
#' effect variance is divided by this value.}
Expand Down Expand Up @@ -492,7 +492,7 @@ setClass("SCDDParams",
#' \item{\emph{Gene parameters}}{
#' \describe{
#' \item{\code{gene.params}}{A \code{data.frame} containing gene
#' parameters with two coloumns: \code{Mean} (mean expression for
#' parameters with two columns: \code{Mean} (mean expression for
#' each biological gene) and \code{Delta} (cell-to-cell
#' heterogeneity for each biological gene).}
#' }
Expand All @@ -506,7 +506,7 @@ setClass("SCDDParams",
#' \item{\emph{Cell parameters}}{
#' \describe{
#' \item{\code{cell.params}}{A \code{data.frame} containing gene
#' parameters with two coloumns: \code{Phi} (mRNA content factor for
#' parameters with two columns: \code{Phi} (mRNA content factor for
#' each cell, scaled to sum to the number of cells in each batch)
#' and \code{S} (capture efficient for each cell).}
#' }
Expand Down
4 changes: 2 additions & 2 deletions R/AllGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ setGeneric("getParam", function(object, name) {standardGeneric("getParam")})
#'
#' @param object object to set parameter in.
#' @param name name of the parameter to set.
#' @param value value to set the paramter to.
#' @param value value to set the parameter to.
#'
#' @return Object with new parameter value.
#'
Expand All @@ -57,7 +57,7 @@ setGeneric("setParam", function(object, name, value) {
#'
#' @param object object to set parameter in.
#' @param name name of the parameter to set.
#' @param value value to set the paramter to.
#' @param value value to set the parameter to.
#'
#' @return Object with new parameter value.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/BASiCS-simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#'
#' @references
#' Vallejos CA, Marioni JC, Richardson S. BASiCS: Bayesian Analysis of
#' Single-Cell Sequencing data. PLoS Comput. Biol. (2015).
#' Single-Cell Sequencing data. PLoS Computational Biology (2015).
#'
#' Paper: \url{10.1371/journal.pcbi.1004333}
#'
Expand Down
6 changes: 3 additions & 3 deletions R/compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' \item{\code{Variances}}{Boxplot of variance distribution.}
#' \item{\code{MeanVar}}{Scatter plot with fitted lines showing the
#' mean-variance relationship.}
#' \item{\code{LibraySizes}}{Boxplot of the library size
#' \item{\code{LibrarySizes}}{Boxplot of the library size
#' distribution.}
#' \item{\code{ZerosGene}}{Boxplot of the percentage of each gene
#' that is zero.}
Expand Down Expand Up @@ -227,7 +227,7 @@ compareSCEs <- function(sces, point.size = 0.1, point.alpha = 0.1,
#' \item{\code{Variances}}{Boxplot of variance differences.}
#' \item{\code{MeanVar}}{Scatter plot showing the difference from
#' the reference variance across expression ranks.}
#' \item{\code{LibraySizes}}{Boxplot of the library size
#' \item{\code{LibraeySizes}}{Boxplot of the library size
#' differences.}
#' \item{\code{ZerosGene}}{Boxplot of the differences in the
#' percentage of each gene that is zero.}
Expand Down Expand Up @@ -411,7 +411,7 @@ diffSCEs <- function(sces, ref, point.size = 0.1, point.alpha = 0.1,
geom_hline(yintercept = 0, colour = "red") +
geom_boxplot() +
scale_colour_manual(values = colours) +
ylab(paste("Rank difference libray size")) +
ylab(paste("Rank difference library size")) +
ggtitle("Difference in library sizes") +
theme_minimal()

Expand Down
6 changes: 3 additions & 3 deletions R/lun2-simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
#' Library size factors are also applied and optionally a zero-inflated
#' negative-binomial can be used.
#'
#' If the number of genes to simulate differs from the number of provied gene
#' If the number of genes to simulate differs from the number of provided gene
#' parameters or the number of cells to simulate differs from the number of
#' library sizes the relevant paramters will be sampled with a warning. This
#' library sizes the relevant parameters will be sampled with a warning. This
#' allows any number of genes or cells to be simulated regardless of the
#' number in the dataset used in the estimation step but has the downside that
#' some genes or cells may be simulated multiple times.
Expand Down Expand Up @@ -145,7 +145,7 @@ lun2Simulate <- function(params = newLun2Params(), zinb = FALSE,
}
}

if (verbose) {message("Simulating libray size factors...")}
if (verbose) {message("Simulating library size factors...")}
lib.facs <- lib.sizes / mean(lib.sizes)
lib.facs <- sample(lib.facs, nCells, replace = TRUE) * lib.mod
cells$LibSizeFac <- lib.facs
Expand Down
2 changes: 1 addition & 1 deletion R/sparseDC-estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' containing count data to estimate parameters from.
#' @param conditions numeric vector giving the condition each cell belongs to.
#' @param nclusters number of cluster present in the dataset.
#' @param norm logical, whether to libray size normalise counts before
#' @param norm logical, whether to library size normalise counts before
#' estimation. Set this to FALSE if counts is already normalised.
#' @param params PhenoParams object to store estimated values in.
#'
Expand Down
8 changes: 4 additions & 4 deletions R/splat-simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ splatSimBatchCellMeans <- function(sim, params) {
#'
#' Simulate differential expression. Differential expression factors for each
#' group are produced using \code{\link{getLNormFactors}} and these are added
#' along with updated means for each group. For paths care is taked to make sure
#' along with updated means for each group. For paths care is taken to make sure
#' they are simulated in the correct order.
#'
#' @param sim SingleCellExperiment to add differential expression to.
Expand Down Expand Up @@ -696,7 +696,7 @@ splatSimTrueCounts <- function(sim, params) {

#' Simulate dropout
#'
#' A logistic function is used to form a relationshop between the expression
#' A logistic function is used to form a relationship between the expression
#' level of a gene and the probability of dropout, giving a probability for each
#' gene in each cell. These probabilities are used in a Bernoulli distribution
#' to decide which counts should be dropped.
Expand Down Expand Up @@ -773,7 +773,7 @@ splatSimDropout <- function(sim, params) {

if (dropout.type != "none") {

# Generate probabilites based on expression
# Generate probabilities based on expression
drop.prob <- sapply(seq_len(nCells), function(idx) {
eta <- log(cell.means[, idx])
return(logistic(eta, x0 = dropout.mid[idx], k = dropout.shape[idx]))
Expand Down Expand Up @@ -834,7 +834,7 @@ getLNormFactors <- function(n.facs, sel.prob, neg.prob, fac.loc, fac.scale) {
#' Identify the correct order to process paths so that preceding paths have
#' already been simulated.
#'
#' @param path.from vector giving the path endpoints that each path orginates
#' @param path.from vector giving the path endpoints that each path originates
#' from.
#'
#' @return Vector giving the order to process paths in.
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param x0 midpoint parameter. Gives the centre of the function.
#' @param k shape parameter. Gives the slope of the function.
#'
#' @return Value of logistic funciton with given parameters
#' @return Value of logistic function with given parameters
logistic <- function(x, x0, k) {
1 / (1 + exp(-k * (x - x0)))
}
Expand Down
2 changes: 1 addition & 1 deletion R/zinb-estimate.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param design.genes design matrix of gene-level covariates.
#' @param common.disp logical. Whether or not a single dispersion for all
#' features is estimated.
#' @param iter.init number of iterations to use for initalization.
#' @param iter.init number of iterations to use for initialization.
#' @param iter.opt number of iterations to use for optimization.
#' @param stop.opt stopping criterion for optimization.
#' @param params ZINBParams object to store estimated values in.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ aren't required for core functionality).
## Getting started

Once installed the best place to get started is the vignette. For most users
the most convient way to access this is online [here][vignette].
the most convenient way to access this is online [here][vignette].

Alternatively, if you chose to build the vignette, you can load Splatter, then
browse the vignettes:
Expand Down
35 changes: 24 additions & 11 deletions docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ff7f4ab

Please sign in to comment.