scirpy.tl.repertoire_overlap#
- scirpy.tl.repertoire_overlap(adata, groupby, *, target_col='clone_id', overlap_measure='jaccard', overlap_threshold=None, fraction=False, inplace=True, added_key='repertoire_overlap', airr_mod='airr')#
Compute distance between cell groups based on clonotype overlap.
Adds parwise overlaps, distance matrix and linkage to
uns.Warning
This function is experimental and is likely to change in the future.
- Parameters:
adata (
Union[AnnData,MuData,DataHandler]) – AnnData or MuData object that contains AIRR information.groupby (
str) – Column with group labels (e.g. samples, tussue source, diagnosis, etc).target_col (
str(default:'clone_id')) – Category that overlaps among groups (clone_idby default, but can in principle be any group or cluster)overlap_measure (
str(default:'jaccard')) – Any distance measure accepted byscipy.spatial.distance; by default it isjaccard.overlap_threshold (
Optional[float] (default:None)) – The minimum required weight to accept presence.fraction (
Union[str,bool] (default:False)) – IfTrue, 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 or an iterable providing cell weights directly. Setting it toFalse, assigns equal weight to all cells.inplace (
bool(default:True)) – Whether results should be added tounsor returned directly.added_key (
str(default:'repertoire_overlap')) – Results will be added tounsunder this key.airr_mod (
str(default:'airr')) – Name of the modality with AIRR information is stored in theMuDataobject. if anAnnDataobject is passed to the function, this parameter is ignored.
- Return type:
- Returns:
A DataFrame used by the pairwise scatterplot, distance matrix and linkage.