Description Usage Arguments Details Value Examples
This method takes one or more reduced-dimension representations of the gene expression data and returns a one-dimensional Bayesian Gaussian Process latent variable model as a 'stanfit' object. The free parameters 'smoothing_alpha' and 'smoothing_beta' correspond to the hyper-hyper distribution on 'lambda' which effectively controls the arc-length and therefore the smoothness of the pseudotime trajectories.
1 2 3 4 | fitPseudotime(X, initialise_from = c("random", "principal_curve", "pca"),
smoothing_alpha = 10, smoothing_beta = 3, pseudotime_mean = 0.5,
pseudotime_var = 1, chains = 1, iter = 1000,
seed = sample.int(.Machine$integer.max, 1), ...)
|
X |
Either a ncells-by-2 reduced dimension matrix or |
initialise_from |
How to initialise the MCMC chain. One of "random" (stan decides),
"principal_curve", or "pca" (the first component of PCA rescaled is taken to be the pseudotimes).
Note: if multiple representations are provided, |
smoothing_alpha |
The hyperparameter for the Gamma distribution that controls arc-length |
smoothing_beta |
The hyperparameter for the Gamma distribution that controls arc-length |
pseudotime_mean |
The mean of the constrained normal prior on the pseudotimes |
pseudotime_var |
The variance of the constrained normal prior on the pseudotimes |
chains |
The number of chains for the MCMC trace |
iter |
The number of iterations for the MCMC trace |
seed |
The |
... |
Additional arguments to be passed to |
This function essentially wraps the rstan
function stan
, and in doing so
returns a stanfit
object. To extract posterior pseudotime samples see example below.
An object of class rstan::stan
, that contains posterior samples for the
model parameters.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
## load libraries for MAP and credible intervals:
library(coda)
library(MCMCglmm)
fit <- fitPseudotime(...)
pst <- extract(fit, pars = "t")$t # extract pseudotime from stan object
tmcmc <- mcmc(pst)
tmap <- posterior.mode(tmcmc) # extract MAP estimate of pseudotimes
hpd_intervals <- HPDinterval(tmcmc) # extract HPD credible intervals (95% default)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.