My problem is (should be) pretty simple.
I have a series of 10 sequences which I wish to convert into a Newick format file - what would be good software to do this? I've tried using Jalview and am getting nowhere.
Any help appreciated.
Bioinformatics Stack Exchange is a question and answer site for researchers, developers, students, teachers, and end users interested in bioinformatics. It only takes a minute to sign up.Sign up to join this community
The best would be Biopython using AlignIO, given they are all in a single file otherise SeqIO. The alignment approach,
from Bio import AlignIO align = AlignIO.read("/home/path/myseq.fa", "fasta") print(align) with open("/home/path/example.nex", "w") as handle: SeqIO.write(align, handle, "nexus")
I tried compiling Clustalx (GUI - problem with qmake) which didn't work, but Clustalw (compiled to exe clustalw2) - the command line tool - worked a treat.
So, I had my
clustalw2 executable and my 25 Drosophila alcohol dehydrogenase protein sequences and I ran the following commands (from Christoph's page):
./clustalw2 -align -type=protein -infile=droso.fasta
This produces a droso.aln file which looks like this (only a few lines shown):
D_paulistorum ETRVAEKLLEHPTQTTLACAQNFVKAIELNKNGAIWKLDLGTLEPIEWTK D_insularis ETRVAEKLLEHPTQTTLACAQNFVKAIELNKNGAIWKLDLGTLEPIEWTK D_equinoxialis ETRVAEKLLEHPTQTTLACAQNFVKAIELNKNGAIWKLDLGTLEPIEWTK D_willistoni ETRVAEKLLEHPTQTTLACAQNFVKAIELNKNGAIWKLDLGTLEPIEWTK *. *:**** ** *.: *.:*********:*****:** .***.* *::
Then on Christoph's page, there is a section:
So, I followed the instructions and ran:
./clustalw2 -tree -infile=droso.aln
and obtained a file droso.ph which looks like a Newick format file to me (some lines):
( ( ( D_madeirensis:0.00000, D_subobscura:0.00787) :0.00257, D_guanche:0.00530) :0.00336, ( ( D_pseudoobscura:0.00000, D_pseudoobscura_pseudo:0.00000) :0.00262, D_persimilis:0.00131) :0.01239) :0.01132, D_ambigua:0.01821) :0.00839,
So, it looks like I have a path to doing what I wanted in the first place - getting from .fasta to Newick format.
I think you can do this in Jalview. In your alignment window, open the Calculate menu and select Calculate Tree or PCA.... This will open a Choose Calculation window which you can use to select what kind of tree to build. When you click on the Calculate button you will get another window with the tree in it. In that window you can open the File menu and then select Save as... → Newick Format. Hopefully this will do what you need.