scirpy.pl.spectratype

scirpy.pl.spectratype(adata, chain='VJ_1', *, color, cdr3_col='junction_aa', combine_fun=<function sum>, normalize=None, viztype='bar', airr_mod='airr', airr_key='airr', chain_idx_key='chain_indices', **kwargs)

Show the distribution of CDR3 region lengths.
`

Show the distribution of CDR3 region lengths.

Ignores NaN values.

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

AnnData or MuData object that contains AIRR information.

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')

One or multiple chains to include in the plot.

color : 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 0x000001123C0631F0>)

A function definining how the cdr3_col columns should be merged, in case multiple ones were specified. (e.g. sum, mean, median, etc).

normalize : str | bool | NoneUnion[str, bool, None] (default: None)

If True, compute fractions of abundances relative to the cdr3_col column rather than reporting abosolute numbers. Alternatively, the name of a column containing a categorical variable can be provided according to which the values will be normalized.

viztype : {‘bar’, ‘line’, ‘curve’}Literal[‘bar’, ‘line’, ‘curve’] (default: 'bar')

Type of plot to produce.

airr_mod

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

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

chain_idx_key

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

**kwargs

Additional parameters passed to the base plotting function

Return type

List[Axes] | AnnDataUnion[List[Axes], AnnData]

Returns

Axes object