Question: How To Convert A Fasta Or Alignment File To Nexus (.Nex) File That Is To Be Used In The Beast Program
2
gravatar for triinlakspere
5.7 years ago by
triinlakspere20 wrote:

Dear fellow scientists!

I'm new in the field and need some help with a small problem.

I have an .aln and .fas files of aligned nucleotide samples.

For phylogenetical analysis, I'm using BEAST program which requires the input file to be in NEXUS format (especially .nex not .nxs).

I've tried many options but just keep getting errors.

Do you know how can I properly convert FASTA or alignment file to NEXUS file?

Triin

• 23k views
ADD COMMENTlink modified 4.7 years ago by Irene0 • written 5.7 years ago by triinlakspere20
5
gravatar for csmall
5.0 years ago by
csmall50
United States
csmall50 wrote:

You might want to try using seqmagick. It's a command line utility inspired by imagemagick that provides a number of very handy utilities for modifying sequence files. You can accomplish the desired conversion using

seqmagick convert --output-format nexus --alphabet dna input.fasta output.nex
ADD COMMENTlink written 5.0 years ago by csmall50
1

this looks really cool,  never heard of it before, needs to be a default install on every bio system

ADD REPLYlink written 5.0 years ago by Istvan Albert ♦♦ 80k
2
gravatar for Hamish
5.7 years ago by
Hamish3.1k
UK
Hamish3.1k wrote:

I assume that by '.aln' you mean Clustal alignment format and that your '.fas' is a fasta sequence format alignment. In which case the following options suggest themselves for reformatting the alignment:

However your comments suggest that you need to add additional information, beyond just the sequence alignment, to the NEXUS file to get something that will work with BEAUti and thus generate the XML file to input to BEAST. For an overview of some of the information that can be included in a NEXUS file see:

The example NEXUS files provided in the BEAST distribution may provide suggestions as to the missing information.

ADD COMMENTlink written 5.7 years ago by Hamish3.1k
0
gravatar for Prakki Rama
5.0 years ago by
Prakki Rama2.2k
Singapore
Prakki Rama2.2k wrote:

another online sequence conversion tool.

ADD COMMENTlink written 5.0 years ago by Prakki Rama2.2k
0
gravatar for Irene
4.7 years ago by
Irene0
Spain
Irene0 wrote:

You can now import FASTA files to BEAST 2, but I still needed to use a NEXUS file because I wanted to link the trees of different partitions and this isn't possible if you import the partitions as separated FASTA files, only if they are partitions within a NEXUS file. I recommend Sequence Matrix (https://code.google.com/p/sequencematrix/downloads/list) to solve this problems. It's written in Java, very easy to use, and if you have different FASTA files with different sequences from the same samples you can import all of them and if the names (>name) are the same, then you can export it as a NEXUS file that records the partitions, so if you use this file as input for Beauti the partitions are automatically recognised and you can link their trees. Of course if you import a single FASTA file and export it as NEXUS it will be acting as a converter. 

ADD COMMENTlink written 4.7 years ago by Irene0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 683 users visited in the last hour