muon.tl.snf#

muon.tl.snf(mdata: mudata._core.mudata.MuData, n_neighbors: int = 20, neighbor_keys: Optional[Union[str, Dict[str, Optional[str]]]] = None, key_added: Optional[str] = None, n_iterations: int = 20, sigma: float = 0.5, eps: float = 2.220446049250313e-16, copy: bool = False) Optional[mudata._core.mudata.MuData]#

Similarity network fusion (SNF)

See Wang et al., 2014 (DOI: 10.1038/nmeth.2810).

Reference implementation can be found in the SNFtool R package: https://github.com/cran/SNFtool/blob/master/R/SNF.R

Parameters
  • mdata – MuData object

  • n_neighbors (int (default: 20)) – Number of neighbours to be used in the K-nearest neighbours step

  • neighbor_keys (Keys in .uns where per-modality neighborhood information is stored. Defaults to "neighbors".) – If set as a dictionary, only the modalities present in neighbor_keys will be used for multimodal nearest neighbor search. If set as a string, has to exist in all modalities.

  • key_added (If not specified, the multimodal neighbors data is stored in .uns["neighbors"], distances and) – connectivities are stored in .obsp["distances"] and .obsp["connectivities"], respectively. If specified, the neighbors data is added to .uns[key_added], distances are stored in .obsp[key_added + "_distances"] and connectivities in .obsp[key_added + "_connectivities"].

  • n_iterations (int (default: 20)) – Number of iterations for the diffusion process

  • sigma (float (default: 0.5)) – Variance for the local model when calculating affinity matrices

  • eps (Small number to avoid numerical errors.) –

  • copy (Return a copy instead of writing to mdata.) –