scirpy.get.airr

scirpy.get.airr(adata, airr_variable, chain=('VJ_1', 'VDJ_1', 'VJ_2', 'VDJ_2'), *, airr_mod='airr', airr_key='airr', chain_idx_key='chain_indices')

Retrieve AIRR variables for each cell, given a specific chain.

Parameters
adata : AnnData | MuData | DataHandlerUnion[AnnData, MuData, DataHandler]

AnnData or MuData object that contains AIRR information.

airr_variable : str | Sequence[str]Union[str, Sequence[str]]

One or multiple columns from the AIRR Rearrangment schema (see adata.var). If multiple values are specified, a dataframe will be returned.

chain : {‘VJ_1’, ‘VJ_2’, ‘VDJ_1’, ‘VDJ_2’} | Sequence[Literal[‘VJ_1’, ‘VJ_2’, ‘VDJ_1’, ‘VDJ_2’]]Union[Literal[‘VJ_1’, ‘VJ_2’, ‘VDJ_1’, ‘VDJ_2’], Sequence[Literal[‘VJ_1’, ‘VJ_2’, ‘VDJ_1’, ‘VDJ_2’]]] (default: ('VJ_1', 'VDJ_1', 'VJ_2', 'VDJ_2'))

choose the recptor arm (VJ/VDJ) and if you want to retrieve the primary or secondary chain. If multiple chains are specified, a adataframe will be returned

airr_mod : str (default: 'airr')

Name of the modality with AIRR information is stored in the MuData object. if an AnnData object is passed to the function, this parameter is ignored.

airr_key : str (default: 'airr')

Key under which the AIRR information is stored in adata.obsm as an awkward array.

chain_idx_key : str (default: 'chain_indices')

Key under which the chain indices are stored in adata.obsm. If chain indices are not present, index_chains() is run with default parameters.

Return type

DataFrame | SeriesUnion[DataFrame, Series]

Returns

A Series or DataFrame aligned to adata.obs. Contains missing values in places where a cell does not have the requested chain.