dandelion.base.tools.to_scirpy
- dandelion.base.tools.to_scirpy(vdj, transfer=False, to_mudata=True, gex_adata=None, key=('gex', 'airr'), **kwargs)[source]
Convert Dandelion data to scirpy-compatible format.
- Parameters:
vdj (Dandelion) – The Dandelion object containing the data to be converted.
transfer (bool, optional) – Whether to transfer additional information from Dandelion to the converted data. Defaults to False.
to_mudata (bool, optional) – Whether to convert the data to MuData format instead of AnnData. Defaults to True. If converting to AnnData, it will assert that the same cell_ids and .obs_names are present in the gex_adata provided.
gex_adata (AnnData, optional) – An existing AnnData object to be used as the base for the converted data if provided.
key (tuple[str, str], optional) – A tuple specifying the keys for the ‘gex’ and ‘airr’ fields in the converted data. Defaults to (“gex”, “airr”).
**kwargs – Additional keyword arguments passed to scirpy.io.read_airr.
- Returns:
The converted data in either AnnData or MuData format.
- Return type:
AnnData | MuData
- Raises:
ImportError – if
scirpyis not installed.