Introduction

The Sample Size tab allows users to create simulated datasets built from their real data, and to perform power calculations to help guide future experimental designs. The subsampler will display summary statistics for number of detected genes, number of significantly differentially expressed genes, and minimum detectable effect sizes for simulated datasets of varying design.

Downsample Depth

In the ‘Sequencing Depth’ tab, you can see how the statistical power of simulated experiments changes as the number of sequencing reads is changed. You can specify the minimum and maximum number of reads to simulate, select whether those parameters are total reads per experiment or reads per cell (default is total reads/experiment), and choose a condition for differential expression assesment from your sample annotations. The chosen condition for differential expression should be a discrete variable. For expediency, differential expression is performed using either a t-test if exactly two groups are detected for the chosen condition, or an ANOVA if more than two groups are detected. The toolkit will only run the simulations once you click the ‘Run Subsampler’ button.

Simulated datasets will not be permanently saved. Instead, summary statistics will be saved for each simulation, and plotted in the “Genes Detected”, “Minimum Detectable Effect Size”, and “Number of Diffex Genes” tabs. Solid lines represent median values at each simulated sequencing depth, wile dotted lines represent the upper and lower quartiles.

Downsample Cells

In the ‘Number of Cells’ tab, you can see how the statistical power of simulated experiments changes as the number of cells is changed while keeping the total number of reads for the experiment constant. You can specify the minimum and maximum number of cells to simulate, specify how many total reads each simulated counts matrix should have, and choose a condition for differential expression assesment from your sample annotations. The chosen condition for differential expression should be a discrete variable. For expediency, differential expression is performed using either a t-test if exactly two groups are detected for the chosen condition, or an ANOVA if more than two groups are detected. The toolkit will only run the simulations once you click the ‘Run Subsampler’ button.

Simulated datasets will not be permanently saved. Instead, summary statistics will be saved for each simulation, and plotted in the “Genes Detected”, “Minimum Detectable Effect Size”, and “Number of Diffex Genes” tabs. Solid lines represent median values at each simulated sequencing depth, wile dotted lines represent the upper and lower quartiles.

Snapshot

In the ‘Snapshot’ tab, you can simultaneously specify both the number of cells and the total number of reads to be produced in each simulated experiment. Rather than giving you an impression of how statistical power would be affected by a variable experimental design, this tab shows a more detailed assessment of a single proposed design.

In the snapshot plot, we show a scatterplot of all genes detected in your input dataset. The x-axis represents the empirical cohen’s-d effect size for genes; cohen’s-d is defined as the mean expression level for a gene in condition A minus the mean expression level in condition B, divided by the pooled standard deviation in expression of that gene across all cells. If your chosen condition of interest has more than two groups, the largest two groups will be compared. The y-axis shows the portion of simulated datasets in which a gene was found to be significantly differentially expressed between groups. This should be interpreted as an estimate of statistical power.

Session info

## R version 3.6.0 (2019-04-26)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Mojave 10.14.4
##
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base
##
## other attached packages:
## [1] BiocStyle_2.12.0
##
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.1         rstudioapi_0.10    knitr_1.22
##  [4] xml2_1.2.0         magrittr_1.5       roxygen2_6.1.1
##  [7] MASS_7.3-51.4      R6_2.4.0           rlang_0.3.4
## [10] stringr_1.4.0      tools_3.6.0        xfun_0.6
## [13] htmltools_0.3.6    commonmark_1.7     yaml_2.2.0
## [16] digest_0.6.18      assertthat_0.2.1   rprojroot_1.3-2
## [19] bookdown_0.9       pkgdown_1.3.0      crayon_1.3.4
## [22] BiocManager_1.30.4 fs_1.3.0           memoise_1.1.0
## [25] evaluate_0.13      rmarkdown_1.12     stringi_1.4.3
## [28] compiler_3.6.0     desc_1.2.0         backports_1.1.4