diff --git a/DESCRIPTION b/DESCRIPTION index 643e58df09a198ed577a182b388f238a167739a1..8852f51948ba007b2c6c414ae87ce6351f6540cd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,28 +1,53 @@ Package: splatter Type: Package Title: Simple Simulation of Single-cell RNA Sequencing Data -Version: 0.99.7 -Date: 2016-12-29 +Version: 0.99.8 +Date: 2017-01-23 Author: Luke Zappia -Authors@R: c(person("Luke", "Zappia", role = c("aut", "cre"), email = - "luke.zappia@mcri.edu.au"), person("Belinda", "Phipson", role = - c("aut"), email = "belinda.phipson@mcri.edu.au"), - person("Alicia", "Oshlack", role = c("aut"), email = - "alicia.oshlack@mcri.edu.au")) +Authors@R: + c(person("Luke", "Zappia", role = c("aut", "cre"), + email = "luke.zappia@mcri.edu.au"), + person("Belinda", "Phipson", role = c("aut"), + email = "belinda.phipson@mcri.edu.au"), + person("Alicia", "Oshlack", role = c("aut"), + email = "alicia.oshlack@mcri.edu.au")) Maintainer: Luke Zappia <luke.zappia@mcri.edu.au> -Description: Splatter is a package for the simulation of single-cell - RNA sequencing count data. It provides a simple interface for - creating complex simulations that are reproducible and - well-documented. +Description: Splatter is a package for the simulation of single-cell RNA + sequencing count data. It provides a simple interface for creating complex + simulations that are reproducible and well-documented. License: GPL-3 + file LICENSE LazyData: TRUE -Depends: R (>= 3.4), scater -Imports: fitdistrplus, edgeR, stats, locfit, akima, Biobase, checkmate, - methods, utils, matrixStats, ggplot2, scales -Suggests: testthat, scran, progress, lme4, pscl, scDD, knitr, - rmarkdown, BiocStyle, covr, S4Vectors, SummarizedExperiment -biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, - Sequencing, Software +Depends: + R (>= 3.4), + scater +Imports: + fitdistrplus, + edgeR, + stats, + locfit, + akima, + Biobase, + checkmate, + methods, + utils, + matrixStats, + ggplot2, + scales +Suggests: + testthat, + scran, + progress, + lme4, + pscl, + scDD, + knitr, + rmarkdown, + BiocStyle, + covr, + S4Vectors, + SummarizedExperiment +biocViews: SingleCell, RNASeq, Transcriptomics, GeneExpression, Sequencing, + Software URL: https://github.com/Oshlack/splatter BugReports: https://github.com/Oshlack/splatter/issues RoxygenNote: 5.0.1 diff --git a/NEWS.md b/NEWS.md index 8e5aaade37f90a6f549ad2cd1a1d7b541cd4ba73..8611fd50b5d4c21fd161d4f70749e1a88f0faf2a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# 0.99.8 + +* Fix bug that meant non-linear path factors weren't stored in output + # 0.99.7 * Small changes to avoid NOTEs and reduce check time diff --git a/R/splat-simulate.R b/R/splat-simulate.R index bccfb6ac33ed8d974bdc40318f898b93197c38ec..4e3efb0df119ceaf49aa566a37d355e3fdf32c74 100644 --- a/R/splat-simulate.R +++ b/R/splat-simulate.R @@ -53,27 +53,29 @@ #' \describe{ #' \item{Gene}{Unique gene identifier.} #' \item{BaseGeneMean}{The base expression level for that gene.} -#' \item{OutlierFactor}{Expression outlier factor for that gene. Values -#' of 1 indicate the gene is not an expression outlier.} +#' \item{OutlierFactor}{Expression outlier factor for that gene. +#' Values of 1 indicate the gene is not an expression outlier.} #' \item{GeneMean}{Expression level after applying outlier factors.} -#' \item{DEFac[Group]}{The differential expression factor for each gene -#' in a particular group. Values of 1 indicate the gene is not +#' \item{DEFac[Group]}{The differential expression factor for each +#' gene in a particular group. Values of 1 indicate the gene is not #' differentially expressed.} #' \item{GeneMean[Group]}{Expression level of a gene in a particular #' group after applying differential expression factors.} +#' \item{SigmaFac[Path]}{Factor applied to genes that have +#' non-linear changes in expression along a path.} #' } #' } #' \item{\code{assayData}}{ #' \describe{ -#' \item{BaseCellMeans}{The expression of genes in each cell adjusted for -#' expected library size.} -#' \item{BCV}{The Biological Coefficient of Variation for each gene in -#' each cell.} -#' \item{CellMeans}{The expression level of genes in each cell adjusted -#' for BCV.} +#' \item{BaseCellMeans}{The expression of genes in each cell +#' adjusted for expected library size.} +#' \item{BCV}{The Biological Coefficient of Variation for each gene +#' in each cell.} +#' \item{CellMeans}{The expression level of genes in each cell +#' adjusted for BCV.} #' \item{TrueCounts}{The simulated counts before dropout.} -#' \item{Dropout}{Logical matrix showing which values have been dropped -#' in which cells.} +#' \item{Dropout}{Logical matrix showing which values have been +#' dropped in which cells.} #' } #' } #' } @@ -449,6 +451,15 @@ splatSimPathCellMeans <- function(sim, params) { group.names <- unique(groups) exp.lib.sizes <- pData(sim)$ExpLibSize + # Generate non-linear path factors + for (idx in seq_along(path.from)) { + # Select genes to follow a non-linear path + is.nonlinear <- as.logical(rbinom(nGenes, 1, path.nonlinearProb)) + sigma.facs <- rep(0, nGenes) + sigma.facs[is.nonlinear] <- path.sigmaFac + fData(sim)[[paste0("SigmaFacPath", idx)]] <- sigma.facs + } + # Generate paths. Each path is a matrix with path.length columns and # nGenes rows where the expression from each genes changes along the path. path.steps <- lapply(seq_along(path.from), function(idx) { @@ -462,16 +473,13 @@ splatSimPathCellMeans <- function(sim, params) { # Find the means at the end position means.end <- fData(sim)[[paste0("GeneMeanPath", idx)]] - # Select genes to follow a non-linear path - is.nonlinear <- as.logical(rbinom(nGenes, 1, path.nonlinearProb)) - sigma.facs <- rep(0, nGenes) - sigma.facs[is.nonlinear] <- path.sigmaFac + # Get the non-linear factors + sigma.facs <- fData(sim)[[paste0("SigmaFacPath", idx)]] + # Build Brownian bridges from start to end steps <- buildBridges(means.start, means.end, n = path.length[idx], sigma.fac = sigma.facs) - fData(sim)[[paste0("SigmaFacPath", idx)]] <- sigma.facs - return(t(steps)) }) diff --git a/man/splatSimulate.Rd b/man/splatSimulate.Rd index a9b2424933d851b2aef58472614a452b40787193..d65b54a2c841d5243d749f70fa0db9f32b8bb526 100644 --- a/man/splatSimulate.Rd +++ b/man/splatSimulate.Rd @@ -78,27 +78,29 @@ slots. This additional information includes: \describe{ \item{Gene}{Unique gene identifier.} \item{BaseGeneMean}{The base expression level for that gene.} - \item{OutlierFactor}{Expression outlier factor for that gene. Values - of 1 indicate the gene is not an expression outlier.} + \item{OutlierFactor}{Expression outlier factor for that gene. + Values of 1 indicate the gene is not an expression outlier.} \item{GeneMean}{Expression level after applying outlier factors.} - \item{DEFac[Group]}{The differential expression factor for each gene - in a particular group. Values of 1 indicate the gene is not + \item{DEFac[Group]}{The differential expression factor for each + gene in a particular group. Values of 1 indicate the gene is not differentially expressed.} \item{GeneMean[Group]}{Expression level of a gene in a particular group after applying differential expression factors.} + \item{SigmaFac[Path]}{Factor applied to genes that have + non-linear changes in expression along a path.} } } \item{\code{assayData}}{ \describe{ - \item{BaseCellMeans}{The expression of genes in each cell adjusted for - expected library size.} - \item{BCV}{The Biological Coefficient of Variation for each gene in - each cell.} - \item{CellMeans}{The expression level of genes in each cell adjusted - for BCV.} + \item{BaseCellMeans}{The expression of genes in each cell + adjusted for expected library size.} + \item{BCV}{The Biological Coefficient of Variation for each gene + in each cell.} + \item{CellMeans}{The expression level of genes in each cell + adjusted for BCV.} \item{TrueCounts}{The simulated counts before dropout.} - \item{Dropout}{Logical matrix showing which values have been dropped - in which cells.} + \item{Dropout}{Logical matrix showing which values have been + dropped in which cells.} } } }