Computes an N x N integer matrix of Hamming distances between CDR3 sequences. For pairs of equal length, the distance is the number of mismatches. For pairs of unequal length, the distance is set to the length of the longer sequence (maximum penalty).
Examples
seqs <- c("CASSI", "CASSK", "CASRL")
hamming_matrix(seqs)
#> [,1] [,2] [,3]
#> [1,] 0 1 2
#> [2,] 1 0 2
#> [3,] 2 2 0