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 sequencestarget_col (
str) – Color by this column fromobs. E.g. sample or diagnosiscdr3_col (
str(default:'junction_aa')) – AIRR rearrangement column from which sequences are obtainedcombine_fun (
Callable(default:<function sum at 0x7f7c9d7d0eb0>)) – 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 thegroupbycolumn 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 theMuDataobject. if anAnnDataobject 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:
- Returns:
A DataFrame with spectratype information.