pegasus.markers

pegasus.markers(data, head=None, de_key='de_res', alpha=0.05)[source]

Extract DE results into a human readable structure.

This function extracts information from data.varm[de_key], and return as a human readible dictionary of pandas DataFrame objects.

Parameters
  • data (MultimodalData, UnimodalData, or anndata.AnnData) – Data matrix with rows for cells and columns for genes.

  • head (int, optional, default: None) – List only top head genes for each cluster. If None, show any DE genes.

  • de_key (str, optional, default, de_res) – Keyword of DE result stored in data.varm.

  • alpha (float, optional, default: 0.05) – q-value threshold for getting significant DE genes. Only those with q-value of MWU test no less than alpha are significant, and thus considered as DE genes.

Returns

results – A Python dictionary containing markers. If DE is performed between clusters, the structure is dict[cluster_id]['up' or 'down'][dataframe]. If DE is performed between conditions within each cluster, the structure is dict[cluster_id][condition_id]['up' or 'down'][dataframe]. ‘up’ refers to up-regulated genes, which should have ‘auroc’ > 0.5. ‘down’ refers to down-regulated genes, which should have ‘auroc’ < 0.5.

Return type

Dict[str, Dict[str, pd.DataFrame]]

Examples

>>> marker_dict = pg.markers(data)