scirpy.ir_dist.metrics.DistanceCalculator.calc_dist_mat
- abstract DistanceCalculator.calc_dist_mat(seqs, seqs2=None)
Calculate pairwise distance matrix of all sequences in
seqs
andseqs2
.When
seqs2
is omitted, computes the pairwise distance ofseqs
against itself.Calculates the full pairwise distance matrix.
Important
Distances are offset by 1 to allow efficient use of sparse matrices (\(d' = d+1\)).
That means, a
distance > cutoff
is represented as0
, adistance == 0
is represented as1
, adistance == 1
is represented as2
and so on.Only returns distances
<= cutoff
. Larger distances are eliminated from the sparse matrix.Distances are non-negative.