http://qs321.pair.com?node_id=913862


in reply to Re: renaming 1000's of FASTA files
in thread renaming 1000's of FASTA files

Yes that's correct, in the .txt file there are id's with 4 different endings, so the script would scan the multiple fasta file and generate (in this example) 4 files with headers:

F0Z7V0F01A03EB_210 F0Z7V0F01A03EB_180 F0Z7V0F01A03EB_136 F0Z7V0F01A03EB_362

and the sequence would be the same for all files, ie the sequence from the fasta file F0Z7V0F01A03EB

Replies are listed 'Best First'.
Re^3: renaming 1000's of FASTA files
by CountZero (Bishop) on Jul 12, 2011 at 13:18 UTC
    You realize you have a problem here?

    You keep a hash with key the ID without the ending of "_xxx" and value the ID with the ending. But a hash-element can have only ONE value, so you overwrite the older elements with the newer, unless you take care and store the IDs in an array and then store the arrayref as a value in the hash-element.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James