harpy.tb.correct_marker_genes#
- harpy.tb.correct_marker_genes(sdata, labels_name, table_name, output_table_name, celltype_correction_dict, overwrite=False)#
Correct celltype expression in
sdata.tables[table_name]usingcelltype_correction_dict.Corrects celltype scores (found in
.obsattribute of theAnnDatatable) that are higher expessed by dividing them by a value if they exceed a certain threshold. Thecelltype_correction_dicthas as keys the celltypes that should be corrected and as values the threshold and the divider.Deprecated since version 0.3.0:
harpy.tb.correct_marker_genesis deprecated and may be removed in a future release.- Parameters:
sdata (
SpatialData) – TheSpatialDataobject.labels_name (
list[str]) – The labels element(s) ofsdataused to select the cells via the region key insdata.tables[table_name].obs. Note that ifoutput_table_nameis equal totable_nameand overwrite is True, cells insdata.tables[table_name]linked to otherlabels_name(via the region key), will be removed fromsdata.tables[table_name](also from the backing Zarr store if it is backed).table_name (
str) – The table element insdata.output_table_name (
str) – The output table element insdata.celltype_correction_dict (
dict[str,tuple[float,float]]) – Thecelltype_correction_dicthas as keys the celltypes that should be corrected and as values the threshold and the divider.
- Return type:
- Returns:
: The updated
SpatialDataobject.
See also
harpy.tb.score_genesscore genes using
score_genes().