scpdac.tl.predict_labels

Contents

scpdac.tl.predict_labels#

scpdac.tl.predict_labels(adata, species, *, layer='log1p_norm', device='cpu')#

Predict hierarchical Level-4 cell-type labels for a query dataset.

Routes cells through the root classifier then the matching Level-4 sub-classifier, appending predictions to adata.obs in place.

Parameters:
  • adata (AnnData) – Query data. Log-normalised expression is read from adata.layers[layer] (falling back to adata.X if the layer is absent). The original object is preserved; a gene-aligned copy is used internally for inference.

  • species (str) – "human" or "mouse".

  • layer (str (default: 'log1p_norm')) – Layer holding the log-normalised counts ("log1p_norm" by default).

  • device (str (default: 'cpu')) – Torch device for inference.

Return type:

AnnData

Returns:

The input adata with obs["predicted_malignant"] (Malignant / Non-Malignant) and obs["predicted_celltype"] (Level-4 labels).