In a project we're doing (in python), we want to create a distance matrix for a phylogenetic tree with multiple, different length sequences. However, what we've seen so far (AlignIO in biopython, etc.) requires the sequences' length to be equal. Is there any pythonic way to get the matrix with sequences of different length? Or any other indirect way that would get us to the same result?
There are two possibilities:
- Do not use the sequences per se but a scalar metric of sequence similarity for distance values
- Introduce gaps in the alignment. You can also do an end to end gapped alignment such as the Needleman-Wunsch and use the alignment scores for the distance matrix.