how to sort fasta format DNA sequences based on a given sequence name list
Hello,
I have a fasta file with many DNA sequences. I want to sort these sequence based on a designated order in a sequence name list file. How to acheive this?
Thanks.
Yongjie
• 3,571 views
•
link
2 answers
Hi! I believe that this was answered before: Sort Sequences In A Fasta File According To The Sequence List In Another Fasta/Txt File
• 0 views
•
link
If you first linearise your fasta sequences (search this forum for many, many ways to do this), then the following should work:
while read line ; do grep -A 1 "$line" sequences.fasta >> sorted_sequences.fasta ; done < indexfile.txt
(Not tested)
• 0 views
•
link
Log in to answer this question.
Biopython or python, create a dictionary and then sort the keys as you wish :) .
Hello Yongjie Zhang!
Questions similar to yours can already be found at:
We have closed your question to allow us to keep similar content in the same thread.
If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.
Cheers!
PS: Thanks for the pointer, natallah