Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Error in Code: Need help

by tangent (Priest)
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; }
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
Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2015-11-25 12:03 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (674 votes), past polls