scFates.tl.curve#
- scFates.tl.curve(adata, Nodes=None, use_rep=None, ndims_rep=None, init=None, epg_lambda=0.01, epg_mu=0.1, epg_trimmingradius=inf, epg_extend_leaves=False, epg_verbose=False, device='cpu', plot=False, basis='umap', seed=None, copy=False, **kwargs)#
Generate a principal curve.
Learn a curved representation on any space, composed of nodes, approximating the position of the cells on a given space such as gene expression, pca, diffusion maps, … Uses ElpiGraph algorithm.
- Parameters:
- adata
AnnData Annotated data matrix.
- Nodes
Optional[int] (default:None) Number of nodes composing the principial tree, use a range of 10 to 100 for ElPiGraph approach and 100 to 2000 for PPT approach.
- use_rep
Optional[str] (default:None) Choose the space to be learned by the principal tree.
- ndims_rep
Optional[int] (default:None) Number of dimensions to use for the inference.
- epg_lambda
Union[float,int,None] (default:0.01) Parameter for ElPiGraph, coefficient of ‘stretching’ elasticity [Albergante20].
- epg_mu
Union[float,int,None] (default:0.1) Parameter for ElPiGraph, coefficient of ‘bending’ elasticity [Albergante20].
- epg_trimmingradius
Optional(default:inf) Parameter for ElPiGraph, trimming radius for MSE-based data approximation term [Albergante20].
- epg_extend_leaves
bool(default:False) Parameter for ElPiGraph, calls
elpigraph.ExtendLeaves()after graph learning.- epg_verbose
bool(default:False) show verbose output of epg algorithm
- device
Literal['cpu','gpu'] (default:'cpu') Run method on either cpu or on gpu
- plot
bool(default:False) Plot the resulting tree.
- basis
Optional[str] (default:'umap') Basis onto which the resulting tree should be projected.
- seed
Optional[int] (default:None) A numpy random seed.
- copy
bool(default:False) Return a copy instead of writing to adata.
- **kwargs
Arguments passsed to
elpigraph.computeElasticPrincipalCurve()
- adata
- Returns:
adata : anndata.AnnData if copy=True it returns or else add fields to adata:
- .uns[‘epg’]
dictionnary containing information from elastic principal curve
- .obsm[‘X_R’]
soft assignment of cells to principal points
- .uns[‘graph’][‘B’]
adjacency matrix of the principal points
- .uns[‘graph’][‘F’]
coordinates of principal points in representation space