Entering edit mode
6.7 years ago
amartinez.ull
•
0
Dear all, I am trying to sort the sequences in a fasta file after the tip order of a phylogenetic tree containing the same sequences but arranged in a different order. Do you know any quick way to do it in R or in Biopython?
So far, I only managed to do it if by first converting the fasta file into a .csv, but this is not very efficient...
Thanks a lot, Alejandro
Hard to answer without the proper phylogenetic tree. I would say that you need to move in a list your fasta headers ordered from your phylogenetic tree (this is the hard part actually). Then, with Biopython you will be able to sort your fasta sequences according to that list.
Thanks for the answer. I will try to be more precise... I have this fasta file:
and I want to sort it after a text file containing this:
Do you know how to do it? Thanks a lot for your time!
duplicate of how to sort fasta format DNA sequences based on a given sequence name list Sort Sequences In A Fasta File According To The Sequence List In Another Fasta/Txt File