I want to be able to write a multiple sequence alignments using files I have downloaded in the same directory as my script. However in the Biopython Cookbook, the only way this is shown is via writing out strings rather then loading files. I would like to be able to do the latter. Here is how the multiple sequence alignment is made in Chapter 6.2 of The biopython cookbook
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Align import MultipleSeqAlignment
align1 = MultipleSeqAlignment([
SeqRecord(Seq("ACTGCTAGCTAG", generic_dna), id="Alpha"),
SeqRecord(Seq("ACT-CTAGCTAG", generic_dna), id="Beta"),
SeqRecord(Seq("ACTGCTAGDTAG", generic_dna), id="Gamma"),
])
The goal is to use this in order to make a phylum tree out of all the protein sequences.