dynamo.tl.recipe_one_shot_data

dynamo.tl.recipe_one_shot_data(adata, tkey=None, reset_X=True, X_total_layers=False, splicing_total_layers=False, n_top_genes=1000, keep_filtered_cells=None, keep_filtered_genes=None, keep_raw_layers=None, one_shot_method='sci-fate', del_2nd_moments=None, ekey='M_t', vkey='velocity_T', basis='umap', rm_kwargs={})[source]

An analysis recipe that properly pre-processes different layers for an one-shot experiment with both labeling and splicing data.

Parameters
  • adata (AnnData) – AnnData object that stores data for the the kinetics experiment, must include uu, ul, su, sl four different layers.

  • tkey (str (default: time)) – The column key for the labeling time of cells in .obs. Used for labeling based scRNA-seq data (will also support for conventional scRNA-seq data). Note that tkey will be saved to adata.uns[‘pp’][‘tkey’] and used in dyn.tl.dynamics in which when group is None, tkey will also be used for calculating 1st/2st moment or covariance. We recommend to use hour as the unit of time.

  • reset_X (bool (default: False)) – Whether do you want to let dynamo reset adata.X data based on layers stored in your experiment. One critical functionality of dynamo is about visualizing RNA velocity vector flows which requires proper data into which the high dimensional RNA velocity vectors will be projected. (1) For kinetics experiment, we recommend the use of total layer as adata.X; (2) For degradation/conventional experiment scRNA-seq, we recommend using splicing layer as adata.X. Set reset_X to True to set those default values if you are not sure.

  • splicing_total_layers (bool (default False)) – Whether to also normalize spliced / unspliced layers by size factor from total RNA. Paramter to recipe_monocle function.

  • X_total_layers (bool (default False)) – Whether to also normalize adata.X by size factor from total RNA. Paramter to recipe_monocle function.

  • n_top_genes (int (default: 1000)) – How many top genes based on scoring method (specified by sort_by) will be selected as feature genes. Arguments required by the recipe_monocle function.

  • keep_filtered_cells (bool (default: False)) – Whether to keep genes that don’t pass the filtering in the returned adata object. Used in recipe_monocle.

  • keep_filtered_genes (bool (default: False)) – Whether to keep genes that don’t pass the filtering in the returned adata object. Used in recipe_monocle.

  • keep_raw_layers (bool (default: False)) – Whether to keep layers with raw measurements in the returned adata object. Used in recipe_monocle.

  • one_shot_method (str (default: sci-fate)) – The method to use for calculate the absolute labeling and splicing velocity for the one-shot data of use.

  • del_2nd_moments (bool (default: None)) – Whether to remove second moments or covariances. Default it is None rgument used for dynamics function.

  • tkey – The column key for the time label of cells in .obs. Used for the “kinetic” model. mode with labeled data. When group is None, tkey will also be used for calculating 1st/2st moment or covariance. {tkey} column must exist in your adata object and indicates the labeling time period. Parameters required for dynamics function.

  • ekey (str or None (optional, default None)) – The dictionary key that corresponds to the gene expression in the layer attribute. By default, ekey and vkey will be automatically detected from the adata object. Parameters required by cell_velocities.

  • vkey (str or None (optional, default None)) – The dictionary key that corresponds to the estimated velocity values in the layers attribute. Parameters required by cell_velocities

  • basis (int (optional, default umap)) – The dictionary key that corresponds to the reduced dimension in .obsm attribute. Can be X_spliced_umap or X_total_umap, etc. Parameters required by cell_velocities

  • rm_kwargs (dict or None (default: None)) – Other Parameters passed into the pp.recipe_monocle function.

Return type

An updated adata object that went through a proper and typical time-resolved RNA velocity analysis.