How to convert FASTA to NEXUS in Python
0
0
Entering edit mode
3.7 years ago
adrian18_07 ▴ 10

I have a FASTA file which has different sequences of different lengths. I would like to convert this file to NEXUS format. I tried with SeqIO.convert but it didn't work properly.

Thanks for any answer.

fasta biopython nexus • 3.4k views
ADD COMMENT
1
Entering edit mode

Past relevant thread: How To Convert A Fasta Or Alignment File To Nexus (.Nex) File That Is To Be Used In The Beast Program

This link also lists the python code to use, if you did not write your's properly.

ADD REPLY
0
Entering edit mode

I tried with SeqIO.convert but it didn't work properly.

You should explain how it failed: how is your data, what you expected, and what you got.

I have a FASTA file which has different sequences of different lengths.

The nexus format is tightly to phylogenetics, and sequences are only useful in phylogenetics when they are aligned. When sequences are aligned, they typically end up with the same length, either by trimming the extremities of the sequences such as all have the same length, or by filling with gaps the shorter sequences. Are your sequences aligned?

ADD REPLY

Login before adding your answer.

Traffic: 2957 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