pegasus.infer_cell_types

pegasus.infer_cell_types(data, markers, de_test='mwu', de_alpha=0.05, de_key='de_res', threshold=0.5, ignore_nonde=False, output_file=None)[source]

Infer putative cell types for each cluster using legacy markers.

Parameters
  • data (MultimodalData, UnimodalData, or anndata.AnnData.) – Data structure of count matrix and DE analysis results.

  • markers (str or Dict) –

    • If str, it is a string representing a comma-separated list; each element in the list
      • either refers to a JSON file containing legacy markers, or

      • 'human_immune' for predefined pegasus markers on human immune cells;

      • 'mouse_immune' for mouse immune cells;

      • 'human_brain' for human brain cells;

      • 'mouse_brain' for mouse brain cells.

    • If Dict, it refers to a Python dictionary describing the markers.

  • de_test (str, optional, default: "mwu") – pegasus determines cell types using DE test results. This argument indicates which DE test result to use, can be either 't', 'fisher' or 'mwu'. By default, it uses 'mwu'.

  • de_alpha (float, optional, default: 0.05) – False discovery rate for controling family-wide error.

  • de_key (str, optional, default: "de_res") – The keyword in data.varm that stores DE analysis results.

  • threshold (float, optional, defaut: 0.5) – Only report putative cell types with a score larger than or equal to threshold.

  • ignore_nonde (bool, optional, default: False) – Do not consider non DE genes as weak negative markers.

  • output_file (str, optional, default: None) – File name of output cluster annotation. If None, do not write to any file.

Returns

Python dictionary with cluster ID’s being keys, and their corresponding cell type lists sortec by scores being values.

Return type

Dict[str, List["CellType"]]

Examples

>>> cell_type_dict = pg.infer_cell_types(adata, markers = 'human_immune,human_brain')