Re: Protein fragment recognition!

2015-09-21 Thread Shlomi Fish
Hi Raj, some comments on your code. On Sun, 20 Sep 2015 18:19:30 -0300 Raj Barath wrote: > Hi, > > Is this is what you're looking for ? > Always start with "use strict;" and "use warnings;" or equivalent. > my %hash; > > while( my $line = ){ 1. There should be a space before the "(". 2.

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' => [