classify
Short Description
sm.hl.classify
: This utility function enables users to annotate cells by assessing
the presence or absence of specific markers. It offers flexibility to apply classifications
across the entire dataset or within previously defined subsets, such as phenotyped or
clustered cell groups, facilitating targeted analyses based on marker expression.
Function
classify(adata, pos=None, neg=None, classify_label='passed_classify', failed_label='failed_classify', phenotype=None, subclassify_phenotype=None, threshold=0.5, collapse_failed=True, label='classify', showPhenotypeLabel=False, verbose=True)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
adata |
AnnData
|
The annotated data matrix for classification. |
required |
pos |
list
|
Markers that should be expressed in the cells of interest. |
None
|
neg |
list
|
Markers that should not be expressed in the cells of interest. |
None
|
classify_label |
str
|
Label for cells that meet the classification criteria. |
'passed_classify'
|
failed_label |
str
|
Label for cells that do not meet the classification criteria. |
'failed_classify'
|
phenotype |
str, required if subclassify_phenotype or collapse_failed is used
|
Column in |
None
|
subclassify_phenotype |
list
|
Phenotypes within which classification should be performed. |
None
|
threshold |
float
|
Threshold for determining positive or negative expression. |
0.5
|
collapse_failed |
bool
|
If True, unclassified cells are grouped under a single failed label. |
True
|
label |
str
|
Key under which classification results are stored in |
'classify'
|
showPhenotypeLabel |
bool
|
If True, appends classification status to existing phenotype labels in the results. If True, classification
results will instead be stored under "[phenotype]_[label]" key in |
False
|
verbose |
bool
|
If True, prints progress and informational messages during the classification process. |
True
|
Returns:
Name | Type | Description |
---|---|---|
adata |
AnnData
|
The input AnnData object, updated with classification results in |
Example
1 2 3 4 5 6 7 8 9 10 |
|
Source code in scimap/helpers/classify.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|