And just in case you wanted to search by GeneID (which is very likely in a next step):
my %myArray; #my @myArray; my $GeneID = shift @columns; $myArray{$GeneID} = \@columns; #push @myA +rray, \@columns; # and how to calculate sum of each row for my $GeneID (sort keys %myArray){ # optionally sort to have a consi +stent view my $sum = 0; for my $colItem (@{$myArray{$GeneID}}){ $sum += $colItem; } print "sum for $GeneID: $sum\n"; }
bw, bliako
In reply to Re^2: Query of multi dimentional array
by bliako
in thread Query of multi dimentional array
by shabird
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |