dandelion.base.tools.transfer

dandelion.base.tools.transfer(adata, vdj, expanded=False, gex_key=None, vdj_key=None, clone_key=None, collapse_nodes=False, overwrite=None, obs=True, obsm=True, uns=True, obsp=True)[source]
Return type:

None

Transfer data in Dandelion slots to AnnData, updating .obs, .uns, .obsm, and .obsp. Transfers both graphs:

  • graph[0] -> adata.uns[‘dandelion’][‘X_vdj_all’]

  • graph[1] -> adata.uns[‘dandelion’][‘X_vdj_expanded’]

The expanded flag controls which graph becomes the main adjacency written to adata.obsp[‘connectivities’] / [‘distances’] (but both graphs are stored).

Parameters:
  • adata (AnnData | MuData) – AnnData object or MuData object.

  • vdj (Dandelion) – Dandelion object.

  • expanded (bool, optional) – Whether or not to transfer the embedding with all cells with BCR (False) or only for expanded clones (True).

  • gex_key (str | None, optional) – prefix for stashed RNA connectivities and distances.

  • vdj_key (str | None, optional) – prefix for stashed VDJ connectivities and distances.

  • clone_key (str | None, optional) – column name of clone/clonotype ids. Only used for integration with scirpy.

  • collapse_nodes (bool, optional) – Whether or not to transfer a cell x cell or clone x clone connectivity matrix into .uns. Only used for integration with scirpy.

  • overwrite (bool | list[str] | str | None, optional) – Whether or not to overwrite existing anndata columns. Specifying a string indicating column name or list of column names will overwrite that specific column(s).