in reply to What is wrong in this code???
Try the following:
use strict; use warnings; my %sequences; while (<>) { for my $char ( split '', (split)[1] ) { $sequences{$char}++; } } print "$_ => $sequences{$_}", "\n" for keys %sequences;
Output on your data set:
- => 406 A => 1708 T => 1639 C => 2057 G => 1946
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: What is wrong in this code???
by Anonymous Monk on Dec 07, 2012 at 21:06 UTC | |
by Kenosis (Priest) on Dec 07, 2012 at 22:50 UTC | |
by Anonymous Monk on Dec 07, 2012 at 21:33 UTC |
In Section
Seekers of Perl Wisdom