Title: | Switch-like differential expression across single-cell trajectories |
---|---|
Description: | Inference and detection of switch-like differential expression across single-cell RNA-seq trajectories. |
Authors: | Kieran Campbell [aut, cre] |
Maintainer: | Kieran Campbell <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.33.0 |
Built: | 2024-12-18 04:25:22 UTC |
Source: | https://github.com/bioc/switchde |
A vector with example pseudotimes for the synthetic
gene expression data in example_gex
ex_pseudotime
ex_pseudotime
An object of class array
of length 100.
A vector of length 100
Plot an example sigmoid function. For demonstration and documentation.
example_sigmoid()
example_sigmoid()
An object of class ggplot
example_sigmoid()
example_sigmoid()
Extract maximum likelihood parameter estimates from a call to switchde
.
extract_pars(sde, gene)
extract_pars(sde, gene)
sde |
The |
gene |
The gene for which to extract parameters |
A vector of length 3 corresonding to the parameters ,
and
data(synth_gex) data(ex_pseudotime) sde <- switchde(synth_gex, ex_pseudotime) pars <- extract_pars(sde, "Gene1")
data(synth_gex) data(ex_pseudotime) sde <- switchde(synth_gex, ex_pseudotime) pars <- extract_pars(sde, "Gene1")
Fits a sigmoidal expression model for a single gene vector, returning MLE model parameters and p-value.
fit_nzi_model(y, pst)
fit_nzi_model(y, pst)
y |
Vector of gene expression values |
pst |
Pseudotime vector, of same length as y |
A vector with 5 entries: maximum likelihood estimates for ,
,
and a p-value
data(synth_gex) data(ex_pseudotime) y <- synth_gex[1, ] fit <- fit_nzi_model(y, ex_pseudotime)
data(synth_gex) data(ex_pseudotime) y <- synth_gex[1, ] fit <- fit_nzi_model(y, ex_pseudotime)
Fits a zero-inflated sigmoidal model for a single gene vector, returning MLE model parameters and p-value.
fit_zi_model(y, pst, maxiter = 10000, log_lik_tol = 0.001, verbose = FALSE)
fit_zi_model(y, pst, maxiter = 10000, log_lik_tol = 0.001, verbose = FALSE)
y |
Vector of gene expression values |
pst |
Pseudotime vector, of same length as y |
maxiter |
Maximum number of iterations for EM algorithm if zero inflation enabled. Default 100 |
log_lik_tol |
If the change in the log-likelihood falls below this for zero inflated EM the algorithm is assumed to have converged |
verbose |
Print convergence update for EM algorithm |
A vector with 6 entries: maximum likelihood estimates for ,
,
,
and a p-value
data(synth_gex) data(ex_pseudotime) y <- synth_gex[1, ] fit <- fit_zi_model(y, ex_pseudotime)
data(synth_gex) data(ex_pseudotime) y <- synth_gex[1, ] fit <- fit_zi_model(y, ex_pseudotime)
Fit sigmoidal differential expression models to gene expression across pseudotime. Parameter estimates are returned along with a p-value for switch-like differential expression over a null model (constant expression).
switchde(object, pseudotime = NULL, zero_inflated = FALSE, lower_threshold = 0.01, maxiter = 1000, log_lik_tol = 0.01, verbose = FALSE, sce_assay = "exprs")
switchde(object, pseudotime = NULL, zero_inflated = FALSE, lower_threshold = 0.01, maxiter = 1000, log_lik_tol = 0.01, verbose = FALSE, sce_assay = "exprs")
object |
Gene expression data that is either
|
pseudotime |
A pseudotime vector with a pseudotime corresponding to
every cell. Can be |
zero_inflated |
Logical. Should zero inflation be implemented? Default |
lower_threshold |
The minimum threshold below which to set expression to zero to avoid numerical issues. Default is 0.01 |
maxiter |
Maximum number of iterations for EM algorithm if zero inflation enabled. Default 100 |
log_lik_tol |
If the change in the log-likelihood falls below this for zero inflated EM the algorithm is assumed to have converged |
verbose |
Print convergence update for EM algorithm |
sce_assay |
The assay from the |
A matrix where each column corresponds to a gene, the first row is the p-value for that gene and subsequent rows are model parameters.
data(synth_gex) data(ex_pseudotime) sde <- switchde(synth_gex, ex_pseudotime)
data(synth_gex) data(ex_pseudotime) sde <- switchde(synth_gex, ex_pseudotime)
Plot gene behaviour and MLE sigmoid as a function of pseudotime.
switchplot(x, pseudotime, pars)
switchplot(x, pseudotime, pars)
x |
Gene expression vector |
pseudotime |
Pseudotime vector (of same length as x) |
pars |
Fitted model parameters |
This plots expression of a single gene. Fitted model parameters can
either be specified manually or can be extracted from the data.frame
returned
by switchde
using the function extract_pars
.
A ggplot2
plot of gene expression and MLE sigmoid
data(synth_gex) data(ex_pseudotime) sde <- switchde(synth_gex, ex_pseudotime) switchplot(synth_gex[1, ], ex_pseudotime, extract_pars(sde, "Gene1"))
data(synth_gex) data(ex_pseudotime) sde <- switchde(synth_gex, ex_pseudotime) switchplot(synth_gex[1, ], ex_pseudotime, extract_pars(sde, "Gene1"))
A matrix containing some synthetic gene expression data for 100 cells and 12 genes
synth_gex
synth_gex
An object of class matrix
with 12 rows and 100 columns.
A 12 by 100 matrix