SpatialQuery.spatial_query_multi.__init__

spatial_query_multi.__init__(adatas, datasets, spatial_key, label_key, leaf_size=10, build_gene_index=False, feature_name=None, if_lognorm=True, if_normalize_spatial_coord=True)[source]

Initiate models, including setting attributes and building kd-tree for each field of view.

Parameters:
  • adatas (List[AnnData]) – List of AnnData objects.

  • datasets (List[str]) – List of dataset names.

  • spatial_key (str) – Spatial coordination name in AnnData.obsm object.

  • label_key (str) – Label name in AnnData.obs object.

  • leaf_size (int, default=10) – The largest number of points stored in each leaf node.

  • build_gene_index (bool, default=False) – Whether to build scfind index or use adata.X directly.

  • feature_name (str, optional) – The label or key in the AnnData object’s variables (var) that corresponds to the feature names.

  • if_lognorm (bool, default=True) – Whether to log normalize the expression data.

  • if_normalize_spatial_coord (bool, default=True) – If True, normalizes spatial coordinates so mean nearest neighbor distance equals 1. Set to False if original spatial units should be preserved.