Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: dividing numbers

by Not_a_Number (Parson)
on Sep 20, 2011 at 18:49 UTC ( #926999=note: print w/ replies, xml ) Need Help??


in reply to dividing numbers

Well, just to show the Power of Perl, you could replace the entire contents of your foreach(my $protein=$seq->seq){ loop with:

my %count; $count{$_}++ for map uc, split '', $protein; for ( 'A' .. 'Z' ) { say RESULT "$_: ", $count{$_} / length $protein if $count{$_}; }


Comment on Re: dividing numbers
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://926999]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2014-09-19 15:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (141 votes), past polls