scirpy.ir_dist.metrics.IdentityDistanceCalculator

class scirpy.ir_dist.metrics.IdentityDistanceCalculator(cutoff=0)

Calculates the Identity-distance between CDR3 sequences.

The identity distance is defined as
  • 0, if sequences are identical

  • 1, if sequences are not identical.

Choosing a cutoff:

For this DistanceCalculator, per definition, the cutoff = 0. The cutoff argument is ignored.

Parameters
cutoff : int | NoneOptional[int] (default: 0)

Will eleminate distances > cutoff to make efficient use of sparse matrices. For the IdentityDistanceCalculator this argument will be ignored and is always 0.

Attributes

DTYPE

The sparse matrix dtype.

Methods

calc_dist_mat(seqs[, seqs2])

In this case, the offseted distance matrix is the identity matrix.

squarify(triangular_matrix)

Mirror a triangular matrix at the diagonal to make it a square matrix.