Re: Protein fragment recognition!

2015-09-20 Thread Raj Barath
+perl-beginners forgot to hit reply all On Sun, Sep 20, 2015, 7:00 PM Raj Barath wrote: > Hi, > I have added the comments. But to understand even better please go through > the official documentation such as: > http://perldoc.perl.org/index-tutorials.html > > > my %hash; > > while( my $line = )

Re: Protein fragment recognition!

2015-09-20 Thread Alaba, Oluwafemi (IITA)
Dear Raj, Thanks. Could you comment on the lines of code so that i can understand better ? Best On Sep 20, 2015, at 10:19 PM, Raj Barath mailto:barat...@live.com>> wrote: Hi, Is this is what you're looking for ? my %hash; while( my $line = ){ chomp $line; my ( $scaf, $pro_per ) = $line =~

Re: Protein fragment recognition!

2015-09-20 Thread Raj Barath
Hi, Is this is what you're looking for ? my %hash; while( my $line = ){ chomp $line; my ( $scaf, $pro_per ) = $line =~ m/\sHit=(.*?)\s.*?Percent_id=(.*?)$/g; push @{$hash{$1}}, $2; } print Dumper (\%hash); Output: $VAR1 = { 'scaffold293_size341291' => [

Protein fragment recognition!

2015-09-20 Thread Alaba, Oluwafemi (IITA)
Dear ALL, I have a file that looks like this. Query=sp|P59287|CASS_RICCO Hit=scaffold293_size341291 Bit=152 Length=349 Percent_id=228.36676217765 Query=sp|P59287|CASS_RICCO Hit=scaffold293_size341291 Bit=152 Length=110 Percent_id=241.818181818182 Query=sp|P59287|CASS_RICCO Hit=scaffold293_size3