
anzdro
New User
Apr 13, 2013, 11:06 AM
Post #1 of 4
(1062 views)
|
Hashes, Bioinformatics, Counting Codons
|
Can't Post
|
|
Hi, I'm just starting out with bioinformatics while using Perl. There's a certain problem I've been having in getting the data I want. There is a list of codons and it's my job to go through it and count how many times each specific codon observed throughout the data and print out the name of the codon and the number of times it was seen. I've written the following code: while (<>) { @codon = split; %hash = @codon; } foreach $key (keys %hash) { $tallyscore{$key}++; print "$key $tally{$key}\n"; } The code gives me the codon names that I want but does not give the numbers that I'm looking for. I'm just starting out with perl and any help would be greatly appreciated!
|