scparadise.scnoah.explain

Contents

scparadise.scnoah.explain#

scparadise.scnoah.explain(adata, layer=None, celltype=None, path_model='', num_cells=100, random_state=0, max_evals=2000, batch_size=256, prefix='pred_', device='auto', verbose=True)[source]#

Identify the genes that are most important for determining cell type using a model.

Parameters:
  • adata (AnnData) – Annotated data matrix.

  • layer (str (default: None)) – If specified, use adata.layers[layer] for expression values instead of adata.X.

  • celltype (str (default: None)) – Specific cell type in annotation to calculate explanations.

  • path_model (str, path object) – Path to the folder containing the trained scAdam model.

  • num_cells (int (default: 100)) – Number of cells to make explanations. Increasing the number of cells will lead to an increase in computation time.

  • random_state (int (default: 0)) – Controls the random selection of cells from dataset and explainer for reproducibility. Pass an int for reproducible output across multiple function calls.

  • max_evals (int (default: 2000)) – The max_evals parameter in SHAP is a tunable setting that significantly affects both the accuracy and computational efficiency of SHAP value calculations. By adjusting this parameter, you can balance between obtaining detailed explanations and managing computational resources effectively. For a larger number of genes, it is necessary to increase max_evals.

  • prefix (str (default: ‘pred_’)) – Prefix of predicted cell type columns in adata.obs.

  • batch_size (int, (default: 256)) – Number of examples per batch.

  • device (str (default: 'auto')) – Type of device to use in training model (‘cpu’, ‘cuda’). Set ‘auto’ for automatic selection.

  • verbose (bool (default: True)) – Show progress bar for each epoch during training.

Returns:

Explanations of specific cell type.