Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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

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]
[LanX]: hm just read an article on claiming that RPerl is 250 times faster. ... it's that even possible?
[marto]: under certain circumstances perhaps
[RonW]: as I understand it, RPerl "compiles" a subset of Perl to C, so I would expect the final executable to run a lot faster

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-05-22 20:13 GMT
Find Nodes?
    Voting Booth?