Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Error in Code: Need help

by tangent (Deacon)
on Mar 28, 2012 at 23:13 UTC ( #962278=note: print w/ replies, xml ) Need Help??


in reply to Error in Code: Need help

A more general error is that you seem to be doing far more than you need to. Try replacing your first while loop with:

while($line=<INPUTR>){ chomp $line; my ($freq,$gene) = split(/\t/, $line); next if (exists $hashfreq{$gene} and $hashfreq{$gene} >= $freq); $hashfreq{$gene} = $freq; }
Output:
20 SEMA4G 20 80 CTBP2 80 80 CTBP2 80 80 CTBP2 80 100 SPRN 100 40 SVIL 40 80 TIMM23 80 80 MINPP1 80 80 BTAF1 80 20 MUC2 100 60 MUC2 100 80 MUC2 100 100 MUC2 100 60 OR10G9 60 60 C11orf91 60 80 OR4S1 80 40 OR4C3 40 40 OR4C3 40 20 OR4C3 40 40 OR4C45 60 60 OR4C45 60


Comment on Re: Error in Code: Need help
Select or Download Code
Re^2: Error in Code: Need help
by angerusso (Novice) on Mar 29, 2012 at 00:22 UTC

    Thanks so much for teaching this SUPERCOOL way to code the same thing. I will keep this in mind next time for similar situations that arise. THANKS a TRILLION!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2014-09-18 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (108 votes), past polls