in reply to Count # of occurrences per column
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Count # of occurrences per column
by ikegami (Patriarch) on May 11, 2011 at 18:07 UTC | |
by wind (Priest) on May 11, 2011 at 18:40 UTC |