Entering edit mode
7.2 years ago
Mehmet
▴
820
Dear all,
I have a ids list that has random order of ids and a fasta file that has the ids. I want to extract sequence of each id from the fasta file.
I tried but each time output has different order rather than the order in the ids file.
How to extract sequences based on the order in the ids file?
Thank you very much. It was what I really wanted.
I Tried it by typing the same in the terminal but the result file is empty.
That's too bad. Post your files somewhere and maybe I can take a look.
Alex, I have a fasta file containing many sequences like
I also have an ID file containing a list of sequence IDs as
NOw I want to extract these sequences from the fasta file bu in the same order. I tried different tools but they do not maintain the order of the sequences extracted. All of these extract sequences in the order as found in the fasta file as seq1 seq3 seq6. but I need in the above order. Thanks thanks
Worked fine for me:
Then:
Then:
Looks like the same order, where there are matches found.
Note that
Seq1
is uppercase in yoursequences.fa
file and lowercaseseq1
inpatterns.txt
.If case-sensitivity is an issue, pre-process your data to fix patterns or sequence headers. Or perhaps modify the test in
awk
to applytoupper()
or similar on both the pattern and sequence header, before testing for a pattern match.Do I need to cat file even if I have all the sequences and IDs list in their corresponding files
I just typed in terminal but I am getting nothing, where is the result file produced.
Please make sure that ID names in your id file are exactly the same with those in your fasta file as Alex suggested.
the
output.fa
fileHey! I have the same issue and wanted to ask whether it is possible to change the code in order to also get results in the following case:
pattern.txt:
sequences.fa:
(the " " are just used to display the format, they are not part of the file) Thanks