API

Import scFates as:

import scFates as scf

Some convenient preprocessing functions translated from pagoda2 have been included:

Pre-processing

pp.filter_cells(adata[, device, p_level, …])

Filter cells using on gene/molecule relationship.

pp.batch_correct(adata, batch_key[, layer, …])

batch correction of the count matrix.

pp.find_overdispersed(adata[, gam_k, alpha, …])

Find overdispersed gene, using pagoda2 strategy.

pp.diffusion(adata[, n_components, knn, …])

Wrapper to generate diffusion maps using Palantir.

Tree inference

tl.tree(adata[, Nodes, use_rep, ndims_rep, …])

Generate a principal tree.

tl.curve(adata[, Nodes, use_rep, ndims_rep, …])

Generate a principal curve.

tl.circle(adata[, Nodes, use_rep, …])

Generate a principal circle.

tl.cellrank_to_tree(adata, time, Nodes[, …])

Converts CellRank [Lange21] fate probabilities into a principal tree that can be analysed by scFates.

tl.explore_sigma(adata, Nodes[, use_rep, …])

Explore varisou sigma parameters for best tree fitting.

Tree operations

tl.cleanup(adata[, minbranchlength, leaves, …])

Remove spurious branches from the tree.

tl.subset_tree(adata[, root_milestone, …])

Subset the fitted tree.

tl.attach_tree(adata, adata_branch[, linkage])

Attach a tree to another!

tl.simplify(adata[, n_nodes, copy])

While keeping nodes defining forks and tips (milestones), reduce the number of nodes composing the segments.

tl.convert_to_soft(adata, sigma, lam[, …])

Convert an hard assignment matrix to a soft one, allowing for probabilistic mapping.

Pseudotime analysis

tl.root(adata, root[, tips_only, min_val, …])

Define the root of the trajectory.

tl.roots(adata, roots, meeting[, copy])

Define 2 roots of the tree.

tl.pseudotime(adata[, n_jobs, n_map, seed, copy])

Compute pseudotime.

tl.dendrogram(adata[, crowdedness, n_jobs])

Generate a single-cell dendrogram embedding.

tl.test_association(adata[, n_map, n_jobs, …])

Determine a set of genes significantly associated with the trajectory.

tl.test_association_covariate(adata, group_key)

Separately test for associated features for each covariates on the same trajectory path.

tl.test_association_monocle3(adata[, …])

Determine a set of genes significantly associated with the trajectory.

tl.fit(adata[, features, layer, n_map, …])

Model feature expression levels as a function of tree positions.

tl.cluster(adata[, layer, n_neighbors, …])

Cluster features.

tl.test_covariate(adata, group_key[, …])

Test for branch differential gene expression between covariates on the same trajectory path.

tl.linearity_deviation(adata, …[, …])

Identifies genes that specifically characterize a given transition but not the progenitors neither the progenies.

tl.unroll_circle(adata[, copy])

Unroll circle to get full spectrum of pseudotime values along it.

Bifurcation analysis

Branch specific feature extraction and classification

tl.test_fork(adata, root_milestone, milestones)

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

tl.branch_specific(adata, root_milestone, …)

Assign genes differentially expressed between two post-bifurcation branches.

tl.activation(adata, root_milestone, milestones)

Identify pseudotime of activation of branch-specififc features.

tl.activation_lm(adata, root_milestone, …)

A more robust version of tl.activation.

Correlation analysis

tl.module_inclusion(adata, root_milestone, …)

Estimates the pseudotime onset of a feature within its fate-specific module.

tl.slide_cells(adata, root_milestone, milestones)

Assign cells in a probabilistic manner to non-intersecting windows along pseudotime.

tl.slide_cors(adata, root_milestone, milestones)

Obtain gene module correlations in the non-intersecting windows along pseudotime.

tl.synchro_path(adata, root_milestone, …)

Estimates pseudotime trends of local intra- and inter-module correlations of fates-specific modules.

tl.synchro_path_multi(adata, root_milestone, …)

Wrappers that call tl.synchro_path on the pairwise combination of all selected branches.

Plot

Trajectory

pl.graph(adata[, basis, size_nodes, …])

Project principal graph onto embedding.

pl.trajectory(adata[, basis, …])

Project trajectory onto embedding.

pl.trajectory_3d(adata[, basis, color, …])

Project trajectory onto 3d embedding.

pl.dendrogram(adata[, root_milestone, …])

Plot the single-cell dendrogram embedding.

pl.milestones(adata[, basis, annotate, …])

Display the milestone graph in PAGA style.

Pseudotime features

pl.test_association(adata[, log_A])

Plot a set of fitted features over pseudotime.

pl.single_trend(adata[, feature, …])

Plot a single feature fit over pseudotime.

pl.trends(adata[, features, cluster, …])

Plot a set of fitted features over pseudotime.

pl.matrix(adata, features[, nbins, layer, …])

Plot a set of features as per-segment matrix plots of binned pseudotimes.

pl.linearity_deviation(adata, …[, …])

Plot the results generated by tl.linearity_deviation.

pl.binned_pseudotime_meta(adata, key[, …])

Plot a dot plot of proportion of cells from a given category over binned sections of pseudotime.

Bifurcation & correlation analysis

pl.modules(adata, root_milestone, milestones)

Plot the mean expression of the early and late modules.

pl.test_fork(adata, root_milestone, milestones)

Plot results generated from tl.test_fork.

pl.slide_cors(adata, root_milestone, milestones)

Plot results generated from tl.slide_cors.

pl.synchro_path(adata, root_milestone, …)

Plot results generated from tl.synchro_path.

pl.module_inclusion(adata, root_milestone, …)

Plot results generated from tl.module_inclusion.

Getting analysed data

get.fork_stats(adata, root_milestone, milestones)

Extract statistics from the fork analysis.

get.modules(adata, root_milestone, milestones)

Extract mean expression of identified early and late modules.

get.slide_cors(adata, root_milestone, …)

Extract statistics from the sliding window correlation analysis.