Description Usage Arguments Value Author(s) References Examples
MCMC sampler to perform Bayesian inference for single-cell mRNA sequencing datasets using the model described in Vallejos et al (2015).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | BASiCS_MCMC(
Data,
N,
Thin,
Burn,
Regression,
WithSpikes = TRUE,
PriorParam = BASiCS_PriorParam(Data, PriorMu = "EmpiricalBayes"),
SubsetBy = c("none", "gene", "cell"),
NSubsets = 1,
CombineMethod = c("pie", "consensus"),
Weighting = c("naive", "n_weight", "inverse_variance"),
Threads = getOption("Ncpus", default = 1L),
BPPARAM = BiocParallel::bpparam(),
...
)
|
Data |
A |
N |
Total number of iterations for the MCMC sampler.
Use |
Thin |
Thining period for the MCMC sampler. Use |
Burn |
Burn-in period for the MCMC sampler. Use |
Regression |
If |
WithSpikes |
If |
PriorParam |
List of prior parameters for BASiCS_MCMC.
Should be created using |
SubsetBy |
Character value specifying whether a divide and
conquer inference strategy should be used. When this is set to |
NSubsets |
If |
CombineMethod |
The method used to combine
subposteriors if |
Weighting |
The weighting method used in the weighted
average chosen using |
Threads |
Integer specifying the number of threads to be used to
parallelise parameter updates. Default value is the globally set
|
BPPARAM |
A |
... |
Optional parameters.
|
An object of class BASiCS_Chain
.
Catalina A. Vallejos cnvallej@uc.cl
Nils Eling eling@ebi.ac.uk
Vallejos, Marioni and Richardson (2015). PLoS Computational Biology.
Vallejos, Richardson and Marioni (2016). Genome Biology.
Eling et al (2018). Cell Systems
Simple, Scalable and Accurate Posterior Interval Estimation Cheng Li and Sanvesh Srivastava and David B. Dunson arXiv (2016)
Bayes and Big Data: The Consensus Monte Carlo Algorithm Steven L. Scott, Alexander W. Blocker, Fernando V. Bonassi, Hugh A. Chipman, Edward I. George and Robert E. McCulloch International Journal of Management Science and Engineering Management (2016)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | # Built-in simulated dataset
set.seed(1)
Data <- makeExampleBASiCS_Data()
# To analyse real data, please refer to the instructions in:
# https://github.com/catavallejos/BASiCS/wiki/2.-Input-preparation
# Only a short run of the MCMC algorithm for illustration purposes
# Longer runs migth be required to reach convergence
Chain <- BASiCS_MCMC(Data, N = 50, Thin = 2, Burn = 10, Regression = FALSE,
PrintProgress = FALSE, WithSpikes = TRUE)
# To run the regression version of BASiCS, use:
Chain <- BASiCS_MCMC(Data, N = 50, Thin = 2, Burn = 10, Regression = TRUE,
PrintProgress = FALSE, WithSpikes = TRUE)
# To run the non-spike version BASiCS requires the data to contain at least
# 2 batches:
set.seed(2)
Data <- makeExampleBASiCS_Data(WithBatch = TRUE)
Chain <- BASiCS_MCMC(Data, N = 50, Thin = 2, Burn = 10, Regression = TRUE,
PrintProgress = FALSE, WithSpikes = FALSE)
# For illustration purposes we load a built-in 'BASiCS_Chain' object
# (obtained using the 'BASiCS_MCMC' function)
data(ChainSC)
# `displayChainBASiCS` can be used to extract information from this output.
# For example:
head(displayChainBASiCS(ChainSC, Param = 'mu'))
# Traceplot (examples only)
plot(ChainSC, Param = 'mu', Gene = 1)
plot(ChainSC, Param = 'phi', Cell = 1)
plot(ChainSC, Param = 'theta', Batch = 1)
# Calculating posterior medians and 95% HPD intervals
ChainSummary <- Summary(ChainSC)
# `displaySummaryBASiCS` can be used to extract information from this output
# For example:
head(displaySummaryBASiCS(ChainSummary, Param = 'mu'))
# Graphical display of posterior medians and 95% HPD intervals
# For example:
plot(ChainSummary, Param = 'mu', main = 'All genes')
plot(ChainSummary, Param = 'mu', Genes = 1:10, main = 'First 10 genes')
plot(ChainSummary, Param = 'phi', main = 'All cells')
plot(ChainSummary, Param = 'phi', Cells = 1:5, main = 'First 5 cells')
plot(ChainSummary, Param = 'theta')
# To constrast posterior medians of cell-specific parameters
# For example:
par(mfrow = c(1,2))
plot(ChainSummary, Param = 'phi', Param2 = 's', SmoothPlot = FALSE)
# Recommended for large numbers of cells
plot(ChainSummary, Param = 'phi', Param2 = 's', SmoothPlot = TRUE)
# To constrast posterior medians of gene-specific parameters
par(mfrow = c(1,2))
plot(ChainSummary, Param = 'mu', Param2 = 'delta', log = 'x',
SmoothPlot = FALSE)
# Recommended
plot(ChainSummary, Param = 'mu', Param2 = 'delta', log = 'x',
SmoothPlot = TRUE)
# To obtain denoised rates / counts, see:
# help(BASiCS_DenoisedRates)
# and
# help(BASiCS_DenoisedCounts)
# For examples of differential analyses between 2 populations of cells see:
# help(BASiCS_TestDE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.