Hello. I am writing a function to find identical columns of alignment and then store those columns in a dictionary such that key should be the column (as a string) and the value is a list containing the indexes of the columns. I have having some difficulty. My current code can make just one alignment:
from Bio.Align import MultipleSeqAlignment
from Bio.Alphabet import IUPAC, Gapped, generic_dna
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
align1 = MultipleSeqAlignment([
SeqRecord(Seq("ACTGCTAGCTAG", generic_dna), id="Alpha"),
SeqRecord(Seq("ACT-CTAGCTAG", generic_dna), id="Beta"),
SeqRecord(Seq("ACTGCTAGDTAG", generic_dna), id="Gamma"),
])
print align1.format("phylip")
I am not sure how to proceed from here.
The output should be a dictionary containing the identical columns of alignment as key and indexing of identical columns as the value.