scirpy.pl.vdj_usage

Contents

scirpy.pl.vdj_usage#

scirpy.pl.vdj_usage(adata, *, vdj_cols=('VJ_1_v_call', 'VJ_1_j_call', 'VDJ_1_v_call', 'VDJ_1_d_call', 'VDJ_1_j_call'), normalize_to=False, ax=None, max_segments=None, max_labelled_segments=5, max_ribbons=10, barwidth=0.4, draw_bars=True, full_combination=True, fig_kws=None, airr_mod='airr', airr_key='airr', chain_idx_key='chain_indices')#

Creates a ribbon plot of the most abundant VDJ combinations.
`

Creates a ribbon plot of the most abundant VDJ combinations.

Currently works with primary alpha and beta chains only.

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

  • vdj_cols (Sequence (default: ('VJ_1_v_call', 'VJ_1_j_call', 'VDJ_1_v_call', 'VDJ_1_d_call', 'VDJ_1_j_call'))) – Columns containing gene segment information. Overwrite default only if you know what you are doing!

  • normalize_to (Union[bool, str, Sequence[float]] (default: False)) – Either the name of a categorical column that should be used as the base for computing fractions, or an iterable specifying a size factor for each cell. By default, each cell count as 1, but due to normalization to different, for instance, sample sizes, it is possible that one cell in a small sample is weighted more than a cell in a large sample.

  • ax (Optional[Axes] (default: None)) – Custom axis if needed.

  • max_segments (Optional[int] (default: None)) – The maximum number of segments in a bar (number of different V, D or J segments that should be shown separately).

  • max_labelled_segments (Optional[int] (default: 5)) – The maximum number of segments that receive a gene label

  • max_ribbons (Optional[int] (default: 10)) – The maximum number of ribbons (individual VDJ combinations). If set to None, all ribbons are drawn. If full_combination=False, the max number of ribbons is additionally constrained by the number of segments.

  • barwidth (float (default: 0.4)) – Width of bars.

  • draw_bars (bool (default: True)) – If False, only ribbons are drawn and no bars.

  • full_combination (bool (default: True)) – If set to False, the bands represent the frequency of a binary gene segment combination of the two connectec loci (e.g. combination of TRBD and TRBJ genes). By default each band represents an individual combination of all five loci.

  • fig_kws (Optional[dict] (default: None)) – Dictionary of keyword args that will be passed to the matplotlib figure (e.g. figsize)

  • 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:

Axes

Returns:

Axes object.