Computes overlap metrics between two named count vectors representing clonotype abundances from two samples. Available metrics:
Usage
tcr_repertoire_overlap(
counts_a,
counts_b,
metrics = c("jaccard", "morisita_horn", "overlap_coef")
)Details
- Jaccard index
|A intersect B| / |A union B|— proportion of shared clonotype species (presence/absence).- Morisita-Horn
2 * sum(p_a * p_b) / (sum(p_a^2) + sum(p_b^2))— abundance-weighted overlap.- Overlap coefficient
|A intersect B| / min(|A|, |B|)— overlap normalized by the smaller set.