scFates.tl.test_fork

scFates.tl.test_fork(adata, root_milestone, milestones, features=None, rescale=False, layer=None, n_jobs=1, n_map=1, copy=False)

Test for branch differential gene expression and differential upregulation from progenitor to terminal state.

First, differential gene expression between two branches is performed. The following model is used:

\(g_{i} \sim\ s(pseudotime)+s(pseudotime):Branch+Branch\)

Where \(s()\) denotes the penalized regression spline function and \(s(pseudotime):Branch\) denotes interaction between the smoothed pseudotime and branch terms. From this interaction term, the p-value is extracted.

Then, each feature is tested for its upregulation along the path from progenitor to terminal state, using the linear model \(g_{i} \sim\ pseudotime\).

Parameters
adata : AnnData

Annotated data matrix.

root_milestone

tip defining progenitor branch.

milestones

tips defining the progenies branches.

features : str | NoneOptional[str] (default: None)

Which features to test (all by default).

rescale : bool (default: False)

By default, analysis restrict to only cells having a pseudotime lower than the shortest branch maximum pseudotime, this can be avoided by rescaling the post bifurcation pseudotime of both branches to 1.

layer : str | NoneOptional[str] (default: None)

layer to use for the test

n_map : int (default: 1)

number of cell mappings from which to do the test.

n_jobs : int (default: 1)

number of cpu processes used to perform the test.

copy : bool (default: False)

Return a copy instead of writing to adata.

Returns

adata – if copy=True it returns or else add fields to adata:

.uns[‘root_milestone->milestoneA<>milestoneB’][‘fork’]

DataFrame with fork test results.

Return type

anndata.AnnData