scirpy.tl.spectratype

Contents

scirpy.tl.spectratype#

scirpy.tl.spectratype(adata, chain='VJ_1', *, target_col, cdr3_col='junction_aa', combine_fun=<function sum>, fraction=None, airr_mod='airr', airr_key='airr', chain_idx_key='chain_indices', **kwargs)#

Summarizes the distribution of CDR3 region lengths.

Ignores NaN values.

Parameters:
  • adata (Union[AnnData, MuData, DataHandler]) – AnnData or MuData object that contains AIRR information.

  • chain (Union[Literal['VJ_1', 'VJ_2', 'VDJ_1', 'VDJ_2'], Sequence[Literal['VJ_1', 'VJ_2', 'VDJ_1', 'VDJ_2']]] (default: 'VJ_1')) – One or multiple chains from which to use CDR3 sequences

  • target_col (str) – Color by this column from obs. E.g. sample or diagnosis

  • cdr3_col (str (default: 'junction_aa')) – AIRR rearrangement column from which sequences are obtained

  • combine_fun (Callable (default: <function sum at 0x7ffb1012f5b0>)) – A function definining how the groupby columns should be merged (e.g. sum, mean, median, etc).

  • fraction (Union[str, bool, None] (default: None)) – If True, compute fractions of abundances relative to the groupby column rather than reporting abosolute numbers. Alternatively, a column name can be provided according to that the values will be normalized.

  • airr_mod (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 (default: 'airr') – Key under which the AIRR information is stored in adata.obsm as an awkward array.

  • chain_idx_key (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

Returns:

A DataFrame with spectratype information.