diff --git a/DESCRIPTION b/DESCRIPTION index 858939e61525079e511ff62bffbb114992ca3d53..0a1aa0a5a98d3bf4b6118fef644f26377cea744c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,6 @@ License: GPL-3 + file LICENSE LazyData: TRUE Depends: R (>= 3.4), - scater (>= 1.7.4), SingleCellExperiment Imports: akima, @@ -35,6 +34,7 @@ Imports: matrixStats, methods, scales, + scater (>= 1.7.4), stats, SummarizedExperiment, utils diff --git a/R/BASiCS-estimate.R b/R/BASiCS-estimate.R index e29e6a0e662edc136bc53f1a3bbd78e8704fa469..71c318a2b7e213e4b30cfa39d8dc06b2488fd9f3 100644 --- a/R/BASiCS-estimate.R +++ b/R/BASiCS-estimate.R @@ -31,7 +31,10 @@ #' #' @examples #' \dontrun{ +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' spike.info <- data.frame(Name = rownames(sc_example_counts)[1:10], #' Input = rnorm(10, 500, 200), #' stringsAsFactors = FALSE) diff --git a/R/lun-estimate.R b/R/lun-estimate.R index 3191a5d81b2ae16ce8c902f86faf7371830d1ad8..298c84ba27f35cfb6b09c83c7191ec2434a09735 100644 --- a/R/lun-estimate.R +++ b/R/lun-estimate.R @@ -14,7 +14,10 @@ #' @return LunParams object containing the estimated parameters. #' #' @examples +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' params <- lunEstimate(sc_example_counts) #' params #' @export diff --git a/R/lun2-estimate.R b/R/lun2-estimate.R index df51b84699291ace5b99df5da81caefd1d8c88c0..f82bf8a75e4af0690d8c1e53e7ef96c0cd88898b 100644 --- a/R/lun2-estimate.R +++ b/R/lun2-estimate.R @@ -20,8 +20,11 @@ #' #' @examples #' \dontrun{ +#' # Load example data +#' library(scater) #' data("sc_example_counts") #' data("sc_example_cell_info") +#' #' plates <- factor(sc_example_cell_info$Mutation_Status) #' params <- lun2Estimate(sc_example_counts, plates, min.size = 20) #' params diff --git a/R/mfa-estimate.R b/R/mfa-estimate.R index f3abf2f12b4f853fa060a2fdad398be24b077d57..62aa212951ec26e51ad7f7aaea05c27ee585e1d2 100644 --- a/R/mfa-estimate.R +++ b/R/mfa-estimate.R @@ -15,7 +15,10 @@ #' @return MFAParams object containing the estimated parameters. #' #' @examples +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' params <- mfaEstimate(sc_example_counts) #' params #' @export diff --git a/R/pheno-estimate.R b/R/pheno-estimate.R index 61cf4fc4541fa47916b120a9462338c3d1fa12a9..cccf02fd575db38a2a210602b7f2501a480aee72 100644 --- a/R/pheno-estimate.R +++ b/R/pheno-estimate.R @@ -15,7 +15,10 @@ #' @return PhenoParams object containing the estimated parameters. #' #' @examples +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' params <- phenoEstimate(sc_example_counts) #' params #' @export diff --git a/R/scDD-estimate.R b/R/scDD-estimate.R index 9c213670a4aec8d72f1c08305aa4c4894e1f3fbb..cb5b2b3e3d4fbf4eef4704de26bf91813f8f1557 100644 --- a/R/scDD-estimate.R +++ b/R/scDD-estimate.R @@ -25,7 +25,10 @@ #' #' @examples #' \dontrun{ +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' conditions <- sample(1:2, ncol(sc_example_counts), replace = TRUE) #' params <- scDDEstimate(sc_example_counts, conditions) #' params diff --git a/R/simple-estimate.R b/R/simple-estimate.R index 3a50a4143ad591c6f0ee1790cfedd2f5903b6f3e..1f9e6cc653bbfa215e695d09a2d3268eb7372152 100644 --- a/R/simple-estimate.R +++ b/R/simple-estimate.R @@ -16,7 +16,10 @@ #' @return SimpleParams object containing the estimated parameters. #' #' @examples +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' params <- simpleEstimate(sc_example_counts) #' params #' @export diff --git a/R/splat-estimate.R b/R/splat-estimate.R index ead3c49fe500c4173e69eab9bddb2ccc48ae758f..b1c20ffd753f3efa484a6f303b6a4378603a2ee1 100644 --- a/R/splat-estimate.R +++ b/R/splat-estimate.R @@ -16,7 +16,10 @@ #' @return SplatParams object containing the estimated parameters. #' #' @examples +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' params <- splatEstimate(sc_example_counts) #' params #' @export diff --git a/R/zinb-estimate.R b/R/zinb-estimate.R index 2a14443ccba5949f9cfba69730a0887b7b4ecdb3..8af73ab26e3d8a4453fbbe480acdf0c74f600b9c 100644 --- a/R/zinb-estimate.R +++ b/R/zinb-estimate.R @@ -29,7 +29,10 @@ #' #' @examples #' \dontrun{ +#' # Load example data +#' library(scater) #' data("sc_example_counts") +#' #' params <- zinbEstimate(sc_example_counts) #' params #' } diff --git a/man/BASiCSEstimate.Rd b/man/BASiCSEstimate.Rd index 0fabfebad0e5f63082e073c8eb9913d0bb97bae3..3be3475b14bbee719c6a9d0ce53a37989827218d 100644 --- a/man/BASiCSEstimate.Rd +++ b/man/BASiCSEstimate.Rd @@ -61,7 +61,10 @@ information is provided there must be at least two batches. See } \examples{ \dontrun{ +# Load example data +library(scater) data("sc_example_counts") + spike.info <- data.frame(Name = rownames(sc_example_counts)[1:10], Input = rnorm(10, 500, 200), stringsAsFactors = FALSE) diff --git a/man/lun2Estimate.Rd b/man/lun2Estimate.Rd index d0e240edbbdc6d983727a0e63d4f98e68ccb9283..b4b1af2023b33b499f29830f89d011bb3f144cca 100644 --- a/man/lun2Estimate.Rd +++ b/man/lun2Estimate.Rd @@ -44,8 +44,11 @@ See \code{\link{Lun2Params}} for more details on the parameters. } \examples{ \dontrun{ +# Load example data +library(scater) data("sc_example_counts") data("sc_example_cell_info") + plates <- factor(sc_example_cell_info$Mutation_Status) params <- lun2Estimate(sc_example_counts, plates, min.size = 20) params diff --git a/man/lunEstimate.Rd b/man/lunEstimate.Rd index 82f5e670b199dc49e618014924c6273be5cc5f12..63bd4f66b0acd9470701fa4e230c27e1cbcbf98c 100644 --- a/man/lunEstimate.Rd +++ b/man/lunEstimate.Rd @@ -30,7 +30,10 @@ input data. No other parameters are estimated. See \code{\link{LunParams}} for more details on the parameters. } \examples{ +# Load example data +library(scater) data("sc_example_counts") + params <- lunEstimate(sc_example_counts) params } diff --git a/man/mfaEstimate.Rd b/man/mfaEstimate.Rd index 002cd047b58ec935bdd1f421756597d8cedb6549..ac81d6a541893ffd4d6d7c4f1de585e6dc8300ab 100644 --- a/man/mfaEstimate.Rd +++ b/man/mfaEstimate.Rd @@ -31,7 +31,10 @@ input data. The dropout lambda parameter is estimate using details on the parameters. } \examples{ +# Load example data +library(scater) data("sc_example_counts") + params <- mfaEstimate(sc_example_counts) params } diff --git a/man/phenoEstimate.Rd b/man/phenoEstimate.Rd index 5b698238acbc48c4a606cc9fd7a2c3b550936311..1c102ba3d2f02c73a5d5101298d5bfa7cac957ed 100644 --- a/man/phenoEstimate.Rd +++ b/man/phenoEstimate.Rd @@ -32,7 +32,10 @@ input data. The total number of genes is evenly divided into the four types. See \code{\link{PhenoParams}} for more details on the parameters. } \examples{ +# Load example data +library(scater) data("sc_example_counts") + params <- phenoEstimate(sc_example_counts) params } diff --git a/man/scDDEstimate.Rd b/man/scDDEstimate.Rd index 265183465ffcd3ca73550931c721146c38f57611..3b7d9ca9e92c199aadd27d218578d6dafb9e86ed 100644 --- a/man/scDDEstimate.Rd +++ b/man/scDDEstimate.Rd @@ -53,7 +53,10 @@ simulate. The output is then converted to a SCDDParams object. See } \examples{ \dontrun{ +# Load example data +library(scater) data("sc_example_counts") + conditions <- sample(1:2, ncol(sc_example_counts), replace = TRUE) params <- scDDEstimate(sc_example_counts, conditions) params diff --git a/man/simpleEstimate.Rd b/man/simpleEstimate.Rd index 159c87953cde355894abcd344b60ee8ce5106fd3..441accff81ae11b622594476e13ff0ce206a9531 100644 --- a/man/simpleEstimate.Rd +++ b/man/simpleEstimate.Rd @@ -33,7 +33,10 @@ to the library size normalised mean expression level using details on the parameters. } \examples{ +# Load example data +library(scater) data("sc_example_counts") + params <- simpleEstimate(sc_example_counts) params } diff --git a/man/splatEstimate.Rd b/man/splatEstimate.Rd index b14d5195af99f9d04700f1bd300487cdfc8c951b..736f41b02d235c96b7097350ffc71e55cd0fc879 100644 --- a/man/splatEstimate.Rd +++ b/man/splatEstimate.Rd @@ -28,7 +28,10 @@ dataset. See the individual estimation functions for more details on how this is done. } \examples{ +# Load example data +library(scater) data("sc_example_counts") + params <- splatEstimate(sc_example_counts) params } diff --git a/man/zinbEstimate.Rd b/man/zinbEstimate.Rd index 7d819e37f7a930b0ee15d1991db1dc406c6396ae..13c7cc1e341b24774077b719c7fe59215412b9e0 100644 --- a/man/zinbEstimate.Rd +++ b/man/zinbEstimate.Rd @@ -62,7 +62,10 @@ the fitted model and inserts it into a \code{\link{ZINBParams}} object. See } \examples{ \dontrun{ +# Load example data +library(scater) data("sc_example_counts") + params <- zinbEstimate(sc_example_counts) params } diff --git a/vignettes/splatter.Rmd b/vignettes/splatter.Rmd index ae895ee3c5d0c192fc358c541f32b2c67d383604..deae574400415ca390fbba2bc2584e2c6960dd27 100644 --- a/vignettes/splatter.Rmd +++ b/vignettes/splatter.Rmd @@ -36,7 +36,7 @@ biocLite("splatter") To install the most recent development version from Github use: ```{r install-github, eval = FALSE} -biocLite("Oshlack/splatter", dependencies = TRUE, +biocLite("Oshlack/splatter", dependencies = TRUE, build_vignettes = TRUE) ``` @@ -51,6 +51,7 @@ Splatter. Here is an example using the example dataset in the `scater` package: library(splatter) # Load example data +library(scater) data("sc_example_counts") # Estimate parameters from example data params <- splatEstimate(sc_example_counts) @@ -160,7 +161,7 @@ As well as telling us what type of object we have ("A `Params` object of class some extra information. We can see which parameters can be estimated by the `splatEstimate` function (those in parentheses), which can't be estimated (those in brackets) and which have been changed from their default values (those -in ALL CAPS). +in ALL CAPS). ## Getting and setting @@ -330,7 +331,7 @@ So far we have only simulated a single population of cells but often we are interested in investigating a mixed population of cells and looking to see what cell types are present or what differences there are between them. Splatter is able to simulate these situations by changing the `method` argument Here we are -going to simulate two groups, by specifying the `group.prob` parameter and +going to simulate two groups, by specifying the `group.prob` parameter and setting the `method` parameter to `"groups"`: (**NOTE:** We have also set the `verbose` argument to `FALSE` to stop Splatter @@ -354,7 +355,7 @@ The other situation that is often of interest is a differentiation process where one cell type is changing into another. Splatter approximates this process by simulating a series of steps between two groups and randomly assigning each cell to a step. We can create this kind of simulation using the `"paths"` -method. +method. ```{r paths} sim.paths <- splatSimulate(method = "paths", verbose = FALSE) @@ -362,7 +363,7 @@ sim.paths <- normalise(sim.paths) plotPCA(sim.paths, colour_by = "Step") ``` -Here the colours represent the "step" of each cell or how far along the +Here the colours represent the "step" of each cell or how far along the differentiation path it is. We can see that the cells with dark colours are more similar to the originating cell type and the light coloured cells are closer to the final, differentiated, cell type. By setting additional parameters it is @@ -462,9 +463,9 @@ tpm(sim)[1:5, 1:5] The default method used by `addGeneLengths` to simulate lengths is to generate values from a log-normal distribution which are then rounded to give an integer -length. The parameters for this distribution are based on human protein coding -genes but can be adjusted if needed (for example for other species). -Alternatively lengths can be sampled from a provided vector (see +length. The parameters for this distribution are based on human protein coding +genes but can be adjusted if needed (for example for other species). +Alternatively lengths can be sampled from a provided vector (see `?addGeneLengths` for details and an example). # Comparing simulations and real data