scFates.tl.fit#
- scFates.tl.fit(adata, features=None, layer=None, n_map=1, n_jobs=1, gamma=1.5, knots=-1, save_raw=True, copy=False)#
Model feature expression levels as a function of tree positions.
The models are fit using mgcv R package. Note that since adata can currently only keep the same dimensions for each of its layers. While the dataset is subsetted to keep only significant feratures, the unsubsetted dataset is kept in adata.raw (save_raw parameter).
- Parameters:
- adata
AnnData Annotated data matrix.
- layer
Optional[str] (default:None) adata layer to use for the fitting.
- 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.
- gamma
float(default:1.5) stringency of penalty.
- knots
int(default:-1) number of knots for the GAM fit.
- save_raw
bool(default:True) save the unsubsetted anndata to adata.raw
- copy
bool(default:False) Return a copy instead of writing to adata.
- adata
- Returns:
adata : anndata.AnnData if copy=True it returns subsetted or else subset (keeping only significant features) and add fields to adata:
- .layers[‘fitted’]
fitted features on the trajectory for all mappings.