This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to convert FASTA to NEXUS in Python

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

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?

0 answers

No answers yet.

Log in to answer this question.