my @cols; while (<DATA>) { chomp; my ($id, @markers) = split; for my $i (0..$#markers) { $cols[$i]{$markers[$i]}++; } } for my $i (0..$#cols) { print "column $i\n"; print "$_ $cols[$i]{$_} " for sort keys %{$cols[$i]}; print "\n"; } __DATA__ 3851 A A G G T T A A C C 3854 A A G G T T A A C C 3871 A A G G T T A A G G
In reply to Re: Count # of occurrences per column
by wind
in thread Count # of occurrences per column
by Renyulb28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |