Entering edit mode
4.5 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.
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.
You should explain how it failed: how is your data, what you expected, and what you got.
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?