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

Re^2: DNA Reverse Complement

by Aristotle (Chancellor)
on Sep 14, 2002 at 05:36 UTC ( #197797=note: print w/ replies, xml ) Need Help??

in reply to Re: DNA Reverse Complement
in thread DNA Reverse Complement

sub revcompl { return map { (my $rev = reverse $_) =~ tr/ACGTacgt/TGCAtgca/; $rev + } @_ }

Makeshifts last the longest.

Comment on Re^2: DNA Reverse Complement
Download Code
Replies are listed 'Best First'.
Re^3: DNA Reverse Complement
by Anonymous Monk on Aug 20, 2009 at 17:19 UTC
    The above sub does not work

      Of course it does. I'm guessing you called it in scalar context and got the count of the transform; e.g., 1.

      print revcompl("CGTAGTC"), $/; # GACTACG print scalar revcompl("CGTAGTC"), $/; # 1

      There was just a post on this issue this morning: Mini-Tutorial: Scalar vs List Assignment Operator.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-11-25 08:47 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 (672 votes), past polls