iss_patcher.patch_twostep

iss_patcher.patch_twostep(iss, gex, annot_key, min_genes=3, obs_to_take=None, cont_obs_to_take=None, nanmean=False, round_counts=True, chunk_size=100000, computation='annoy', neighbours_annot=15, neighbours=15, obsm_fraction=False, obsm_pbs=False)

A two-step version of the procedure, identifying each low dimensional cell’s KNN in the shared high dimensional feature space in the first go, and then finding each low dimensional cell’s KNN only among the high dimensional cells matching in annotation. Prior to execution, high dimensional cells annotated with categories with fewer than neighbours total representatives are removed. annot_key-derived entries in the output object are based on the first-pass KNN on the full space, all other transferred gex.obs are based on the second pass subset KNNs.

All undescribed arguments as in ip.patch().

Input

annot_keystr

gex.obs key to use as the annotation.

neighbours_annotint, optional (default: 15)

How many neighbours in gex to identify for each iss cell when performing the first annotation step.

neighboursint, optional (default: 15)

How many neighbours in gex to identify for each iss cell when performing the second within-cell-type step.

obsm_fractionbool, optional (default: False)

If True, will additionally store the annot_key cell fractions from the first pass KNN.

obsm_pbsbool, optional (default: False)

If True, will additionally store the first pass annotation determining KNN in .obsm['pbs_annot'].