Home > Community > How to create a .phy file for constructing a phylogenetic tree?
Upvote

22

Downvote
+ Bioinformatics
+ Biochemistry
+ Phylogenetics
+ Phylogeny
Posted by
Let us walk together

How to create a .phy file for constructing a phylogenetic tree?

Dipesh Nepal  Follow

Python works great for tying everything together and file manipulations. I find stepping out of Python, using system calls, best for alignment and tree building. For example:

os.system("mafft --auto {} > {}" .format("unaligned_16s_seq_in_file.fasta", "alignment_out_file.fasta"))os.system("raxml -f a -s {} -p 12345 -x 12345 -# 100 -m GTRCAT -n {}" .format("alignment_out_file.fasta", "tree_out_file.tre"))

More

Upvote

VOTE

Downvote
David Curran  Follow

You simply use Biopython's SeqIO and AlignIO.The documentation is https://biopython.org/wiki/AlignIO etc ...The format you seek is phylip

More

Upvote

VOTE

Downvote
Josh-D. Davis  Follow
, I got "ValueError: Sequences must all be the same length". I'm not sure why, because I explicitly checked that the sequences have the same length. Not sure what to do now :( Any thoughts?More
Upvote

VOTE

Downvote
Jim McElhinney  Follow
Possibly it is not a programming issue but formating. There is no simple answer to trouble shoot this. Could you ask this as a separate question please? Obviously it is solvable but there's several possibilities and the Moderators will intervene if there are multiple questions within a threadMore
Upvote

VOTE

Downvote
Greg Kaese  Follow
(except that in mine, the length of the sequences is 253). I ensured that they all have the same length. But when I ran More
Upvote

VOTE

Downvote
Giancarlo Bellucci  Follow
I have asked the question here More
Upvote

VOTE

Downvote
John Cass  Follow
Thank you for your response. I made a .phy file similar to the one here More
Upvote

VOTE

Downvote
more replies