scirpy.tl.repertoire_overlap

scirpy.tl.repertoire_overlap(adata, groupby, *, target_col='clone_id', overlap_measure='jaccard', overlap_threshold=None, fraction=None, inplace=True, added_key='repertoire_overlap')

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

AnnData object to work on.

groupby : strstr

Column with group labels (e.g. samples, tussue source, diagnosis, etc).

target_col : strstr (default: 'clone_id')

Category that overlaps among groups (clonotype by default, but can in principle be any group or cluster)

overlap_measure : strstr (default: 'jaccard')

Any distance measure accepted by scipy.spatial.distance; by default it is jaccard.

overlap_threshold : float | NoneOptional[float] (default: None)

The minimum required weight to accept presence.

fraction : None | str | boolUnion[None, str, bool] (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 or an iterable providing cell weights directly. Setting it to False or None assigns equal weight to all cells.

inplace : boolbool (default: True)

Whether results should be added to uns or returned directly.

added_key : strstr (default: 'repertoire_overlap')

Results will be added to uns under this key.

Return type

None | Tuple[DataFrame, ndarray, ndarray]Optional[Tuple[DataFrame, ndarray, ndarray]]

Returns

A DataFrame used by the pairwise scatterplot, distance matrix and linkage.