in reply to Parsing multispecies database BLAST output

#!perl use strict; my %hash=(); while (<DATA>){ my ($spec,$sub,$id,$pc) = split; push @{$hash{$spec}{$sub}},[$id,$pc]; } for my $spec (sort keys %hash){ for my $sub (sort keys %{$hash{$spec}}){ my @f = sort {$b->[1] <=> $a->[1]} @{$hash{$spec}{$sub}}; printf "%s %s %s %s\n",$spec,$sub,@{$f[0]}; } }
poj

Replies are listed 'Best First'.
Re^2: Parsing multispecies database BLAST output
by Q.and (Novice) on Mar 24, 2016 at 20:20 UTC
    Excellent, thanks so much!