in reply to how do i obtain blast result from the given file
Another way:
... my @seq; # read past the header while(<IN>){ last if /^Sequences producing/; } # assuming remaining data is fixed while(<IN>){ chomp; next if /^\s*$/; # capture the score /^.{67}\s*(\d+)/; # push anonymous array - [score,line] push @seq, [$1,$_]; } close IN; print join $/, ( map { $_->[1] } # print original line sort { $b->[0] <=> $a->[0] } # sorted by score @seq )[0..9]; # top ten
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how do i obtain blast result from the given file
by bingalee (Acolyte) on Jun 18, 2013 at 19:58 UTC |
In Section
Seekers of Perl Wisdom