bin2cell.salvage_secondary_labels

bin2cell.salvage_secondary_labels(adata, primary_label='labels_he_expanded', secondary_label='labels_gex', labels_key='labels_joint')

Create a joint labels_key that takes the primary_label and fills in unassigned bins based on calls from secondary_label. Only objects that do not overlap with any bins called as part of primary_label are transferred over.

Input

adataAnnData

2um bin VisiumHD object. Needs primary_key and secodary_key in .obs.

primary_labelstr, optional (default: "labels_he_expanded")

.obs key holding the main labels. Integers, with 0 being unassigned to an object.

secondary_labelstr, optional (default: "labels_gex")

.obs key holding the labels to be inserted into unassigned bins. Integers, with 0 being unassigned to an object.

labels_keystr, optional (default: "labels_joint")

.obs key to store the combined label information into. Will also add a second column with "_source" appended to differentiate whether the bin was tagged from the primary or secondary label.