This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Which Alphabet should I use for making a substitution matrix

Hello,

In order to make a custom substitution matrix I use clastalo to perform a msa and subsequently I use the SubsMat module trying to create a substition matrix.

I have to specify an alphabet and, with the biopython Alphabet and IUPAC modules being though to understand, I haven't been able to find the right alpabet. This results in a python KeyError on '-'.

My msa contains "-", which alphabet should I specify?

Sincerely

biopython alphabet

1 answer

Probably something like this (which is a bit horrible, I would agree):

from Bio.Alphabet.IUPAC import ambiguous_dna
from Bio.Alphabet import Gapped

gapped_dna = Gapped(ambiguous_dna, gap_char="-")

Log in to answer this question.