Estimate the cell sizes according to Anders & Huber
Differential expression analysis for sequence count data
Matern 3/2 covariance function
Adjust the expression by the estimated cell sizes.
Calculate a suitable value for a rug plot given the
number of points
Makes a distance periodic
Plot a comparison of the profiles from several de.lorean objects
The filename of the R markdown stylesheet
cov.all.genes.conditioned
Calculate covariances for all genes when conditioned on data at
estimated pseudotimes.
Calculate the covariance structure of evenly spread tau and
create a function that calculates the log likelihood of
orderings.
Default number of cores to use.
Condition a Gaussian on another.
See Eqn. A.6
on page 200 of Rasmussen and Williams' book.
Initialise DeLorean object
Fit the model using Stan sampler
Calculate the covariance structure of the tau
Fit the model using Stan variational Bayes
Filter cells
Filter genes
Convert the output of gp.predict() into a data.frame.
held.out.posterior.by.variation
Order the genes by the variation of their posterior mean
Kouno et al. investigated the transcriptional network controlling how
THP-1 human myeloid monocytic leukemia cells differentiate into
macrophages. They provide expression values for 45 genes in 960 single
cells captured across 8 distinct time points.
held.out.posterior.filter
Filter the genes
Make a fit valid by running one iteration of the sampler.
Returns a function that constructs parameter settings with good tau.
Single cell expression data and meta data from Guo et al. (2012).
They investigated the expression of 48 genes in 500 mouse embryonic cells.
Mutate the profile data into shape compatible with GP plot function
Is a DeLorean object?
Knit a report, the file inst/Rmd/<report.name>.Rmd must exist in
the package directory.
Make predictions
Optimise the best sample and update the best.sample index.
Find a good ordering in the sense that some function is
locally maximised.
Randomly move one item in an ordering to another location
Plot posterior for marginal log likelihoods of individual gene's
expression profiles
Test ordering score: sum every time consecutive items are in
order.
Average across a parameters samples.
Test fit for log normal and gamma
Melt an expression matrix.
Plot likelihoods of orderings against elapsed times taken
to generate them
ordering.metropolis.hastings
Metropolis-Hastings on orderings.
Test ordering Metropolis-Hastings sampler.
Analyse noise levels and assess which genes have the greatest
ratio of temporal variance to noise. This are labelled as the
'gene.high.psi' genes.
Process the posterior, that is extract and reformat the samples from
Stan. We also determine which sample has the highest likelihood, this
is labelled as the 'best' sample.
Partition de.lorean object by cells
Calculate covariance structure for gene over pseudotimes and test
inputs.
Analyse variance of expression between and within capture times.
calc.inducing.pseudotimes
Calculate inducing pseudotimes for sparse approximation
Plot pseudotime (tau) against observed capture time.
The 'DeLorean' package.
cov.calc.gene.conditioned
Calculate covariance for gene over test inputs when conditioned on
data at estimated pseudotimes.
Calculate the roughness of the vector. The roughness is the RMS
of the differences between consecutive points.
Plot best sample predicted expression.
Plot the Rhat convergence statistics. examine.convergence
must be called before this plot can be made. Calculate roughnesses under fit samples and also under random
permutations
Calculate distances between vectors of time points
Calculate distances over estimated pseudotimes and
test inputs.
Estimate hyperparameters for model using empirical Bayes.
The expected within sample variance of a Gaussian with the given covariance.
Centralises a periodic position into [period/2, period)
by shifting by n*period, where n is an integer
Fit held out genes
Analyse the samples and gather the convergence statistics. Note this
only makes sense if a sampling method was used to fit the model as
opposed to variational Bayes.
Dimensions of DeLorean object
Fit the model using specified method (sampling or variational Bayes).
pseudotimes.from.orderings
Convert best orderings into initialisations
Plot two sets of pseudotimes against each other.
Plot results of roughness test
The filename of the R markdown report.
The log marginal likelihood. See "2.3 Varying the Hyperparameters"
on page 19 of Rasmussen and Williams' book.
Plot the expression data by the capture points
Predictive mean, variance and log marginal likelihood of a GP.
See "2.3 Varying the Hyperparameters"
on page 19 of Rasmussen and Williams' book.
Find best tau to initialise chains with by sampling tau from the prior
and using empirical Bayes parameter estimates for the other parameters.
Estimate the cell sizes. We only consider genes that are expressed in
a certain proportion of cells.
Find best order of the samples assuming some smooth GP prior on the
expression profiles over this ordering.
Invert the ordering
Permute a data frame, x. If group.col is given it should name an ordered
factor that the order of the permutation should respect.
Permute cells and test roughness of expression.
Check that it is a valid ordering
Get posterior mean of samples
Run a find good ordering method and append results to existing orderings
Various DeLorean object plots
Perform all the steps necessary to fit the model:
prepare the data
find suitable initialisations
fit the model using the specified method (sampling or variational Bayes)
process the posterior
Melt held out genes
Get the Stan model for a DeLorean object.
Plot the posterior of held out genes
Calculate posterior covariance and estimate parameters for
held out genes given pseudotimes estimated by DeLorean model.
test.robustness.de.lorean
Test robustness of pseudotime estimation on subsets of de.lorean
object
Calculate the covariance structure of the inducing points
Windram et al. investigated the defense response in Arabidopsis
thaliana to the necrotrophic fungal pathogen Botrytis cinerea.
They collected data at 24 time points in two conditions for
30336 genes.
init.orderings.vs.pseudotimes.plot
Plot the orderings for initialisation against the estimated pseudotime.
Join with another data frame. Useful for adding gene names etc..
Move a block in an ordering and shift the other items.
Select held out genes by those with highest variance
Prepare for Stan
Print details of DeLorean object
Use seriation package to find good orderings
Plot the tau offsets, that is how much the pseudotimes (tau) differ
from their prior means over the full posterior.
Improve the ordering in the sense that some function is
maximised.
ordering.random.block.move
Randomly move a block in an ordering to another location
Move one item in an ordering and shift the other items.
Add expression data to a plot
plot.add.mean.and.variance
Add posterior representation to a plot.
roughness.of.permutations
Apply permutation based roughness test to held out genes
Calculate the roughness of the held out genes given the sample.
Perform an analysis of variance to select genes for the DeLorean model.