in reply to Re^5: Compare hash with arrays and print
in thread Compare hash with arrays and print
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Compare hash with arrays and print
by almut (Canon) on Jul 13, 2010 at 18:23 UTC | |
by ad23 (Acolyte) on Jul 13, 2010 at 19:00 UTC | |
by almut (Canon) on Jul 13, 2010 at 19:25 UTC | |
by ad23 (Acolyte) on Jul 13, 2010 at 21:19 UTC | |
by ad23 (Acolyte) on Jul 14, 2010 at 13:32 UTC |