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.

  • $\begingroup$ I am not sure if I follow. Do you want to create a phylogenetic tree? $\endgroup$ Nov 27, 2020 at 16:27

3 Answers 3


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")
with open("/home/path/example.nex", "w") as handle:
    SeqIO.write(align, handle, "nexus")

(not debugged)

MEGAX or ClustalX which are nice GUI's that will also work. If you've not got Biopython installed then ClustalX is probably the easiest.

  • 1
    $\begingroup$ Thanks for your input - I'm a Python novice and don't have Biopython and looked at ClustalX - and then I found a solution using Clustalw which works quite nicely - see my answer - but I gave you a +1 for your contribution which led me to my answer. $\endgroup$
    – Vérace
    Nov 27, 2020 at 2:20

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. Combined 2-stage screenshot. Calculate->Calculate Tree or PCA...->Calculate->Save as...->Newick Format


@M__'s answer led me to clustal.org and some searching led me to this page (Christoph's).

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):

                            *. *:**** ** *.:  *.:*********:*****:** .***.* *::

Then on Christoph's page, there is a section:

  • Generate a Newick tree file

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):


So, it looks like I have a path to doing what I wanted in the first place - getting from .fasta to Newick format.

Then, using the programs jalview and figtree, I was able to draw trees and the like!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.