sccloud.infer_cell_types¶
-
sccloud.infer_cell_types(data, markers, de_test, 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 (
anndata.AnnData) – AnnData object of count matrix and DE analysis results.markers (
strorDict) –- If
str, it either refers to a JSON file containing legacy markers, or
'human_immune'for predefined sccloud markers on human immune cells;'mouse_immune'for mouse immune cells;'human_brain'for human brain cells;'mouse_brain'for mouse brain cells.
- If
If
Dict, it refers to a Python dictionary describing the markers.
de_test (
str) – sccloud determines cell types using DE test results. This argument indicates which DE test result to use, can be either't','fisher'or'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 indata.varmthat stores DE analysis results.threshold (
float, optional, defaut:0.5) – Only report putative cell types with a score larger than or equal tothreshold.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. IfNone, 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 = scc.infer_cell_types(adata, markers = 'human_immune', de_test = 't')