Thanks again almut!
I really appreciate your inputs.
I am trying to manipulate $_ to obtain the desired results. But when I split it with a newline the data-lines also split up. In this case, if a record holds more than one sequence data, the remaining records are not getting printed!
while (<FASTA>) { s/^>//mg; # print "$_"; my ($name) = /^([^\n]+)/; #my ($name) = /^([\w.]+)/; #print "$name\n"; if($hash{$name} == 10){ select FILE1; } if($hash{$name} == 20){ select FILE2; } if($hash{$name} == 30){ select FILE3; } #print ">$_"; my $output = $_; my (@title) = split(/\n/,$output); print ">".$title[0]."\n".$title[1]."\n"; }
I am splitting it with a new line character, in order to print the complete header line in my output files (and I am going wrong here).
Please suggest?
Thanks!
In reply to Re^6: Compare hash with arrays and print
by ad23
in thread Compare hash with arrays and print
by ad23
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |