go ahead... be a heretic | |
PerlMonks |
Extract multiple lists od Identifiers from a FASTA fileby joluito (Novice) |
on Aug 04, 2022 at 11:20 UTC ( [id://11145943]=perlquestion: print w/replies, xml ) | Need Help?? |
joluito has asked for the wisdom of the Perl Monks concerning the following question: Hello everybody, I'm trying to extract a set of diferent ID lists from a FASTA file in a batch. I have a code that allows me to do it but it only extracts the first list of the loop (even though it reads the other lists and tell how many od each list's ID are found in the FASTA file). There must be an issue with the OUTFILE opening/closing in the for loop, but I seem unable to find what the problem is. Any help would be appreciated. Here is the code (and I can provide dummy test files if needed):
Example of FASTA format:
Example of ID list:
I expect to get a new FASTA file (for each of the ID lists) containing only the sequences matching to the ID on the specific list. The code expects to, basically, be a kind of Sequences retriever in batch. I mean, I expect the script to: -open the original FASTA file -open each of the ID lists -read and chomp it -match & retrieve the correspondent sequences from the original FASTA -write them to individual files (named like the lists but in FASTA format) The output should ne in FASTA format (the same format in the above example). Leaving aside the format specifications, I think the issue here is why it only works in the first "for" loop iteration and not in the following ones. Can you spot any error I can't, regarding the outfile opening or how I try to write my results in it inside the loop? Thank you very much in advance.
Back to
Seekers of Perl Wisdom
|
|