How to write relaxed AND sequential Phylip format using AlignIO?
1
0
Entering edit mode
10.1 years ago
jon.brate ▴ 310

Hi,

I want to convert alignments in fasta-format to phylip format, and I need to use phylip relaxed unless my taxon-names would be identical. I would also prefer to have non-interleaved phylip format, but "phylip-sequential" shortens the names.

Here's my code:

from Bio import SeqIO
from Bio import AlignIO
from Bio.Alphabet import IUPAC, Gapped

alignment = AlignIO.read(open("test.fas"), "fasta", alphabet=Gapped(IUPAC.protein))
g = open("test.phy", "w")
g.write (alignment.format("phylip-relaxed"))
alignment Phylip AlignIO • 4.3k views
ADD COMMENT
0
Entering edit mode
10.0 years ago
zeeefa ▴ 90

You can use this tool http://bit.ly/1utdbFg to convert FASTA format to a relaxed PHYLIP format :)

ADD COMMENT

Login before adding your answer.

Traffic: 1388 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6