scRNAseq Normalization

Types

SeqSpace.Normalize.FitTypeType
FitType = NamedTuple{
(
 :likelihood,
 :parameters,
 :uncertainty,
 :residual
),
Tuple{Float64, Vector{Float64}, Vector{Float64}, Vector{Float64}}

Stores the result of MLE fit of one gene.

Functions

SeqSpace.Normalize.bootstrapMethod
bootstrap(count, depth; stochastic=negativebinomial, samples=50)

Empirically verify the MLE fit of count, using a GLM model generated by stochastic with confounding depth variables by bootstrap. One third of cells are removed and the parameters are re-estimated with the remaining cells. This process is repeated samples times. The resultant distribution of estimation is returned.

SeqSpace.Normalize.fitMethod
fit(stochastic, count, depth)

Fit a generative model stochastic to gene expression count data, assuming confounding sequencing depth. stochastic can be either negativebinomial or gamma.

SeqSpace.Normalize.gammaMethod
gamma(count, depth)

Compute the log likelihood of a gamma distributed generalized linear model (GLM) with log link function for the estimated mean count of a single gene. The sequencing depth for each sequenced cell is assumed to be the only confounding variables.

SeqSpace.Normalize.glmMethod
glm(data; stochastic=negativebinomial, ϵ=1)

Fit a generalized linear model (GLM) to the matrix data. Genes are assumed to be on rows, cells over columns. The underlying generative model is passed by stochastic.

SeqSpace.Normalize.logmeanFunction
logmean(x;ϵ=1)

Compute the geometric mean: $xp\left(\langle \log\left(x + \epsilon \right) \rangle\right) - \epsilon$

SeqSpace.Normalize.logvarFunction
logmean(x;ϵ=1)

Compute the geometric variance: $exp\left(\langle \log\left(x + \epsilon \right)^2 \rangle_c\right) - \epsilon$

SeqSpace.Normalize.negativebinomialMethod
negativebinomial(count, depth)

Compute the log likelihood of a negative binomial generalized linear model (GLM) with log link function for count of a single gene. The sequencing depth for each sequenced cell is assumed to be the only confounding variables.

SeqSpace.Normalize.priorMethod
prior(params)

Estimate a generalized normal distribution to params by maximum likelihood estimation. In practice, used to compute the empirical prior for overdispersion factor Θ₃ in the negative binomial.