Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: need help comparing DNA compliments

by perlguy (Deacon)
on Mar 17, 2003 at 15:53 UTC ( [id://243667]=note: print w/replies, xml ) Need Help??


in reply to need help comparing DNA compliments

here's my go at it:
my $string1 = 'ACTG'; my $string2 = 'TGAT'; my %corresponding = ('A' => 'T', 'T' => 'A', 'C' => 'G', 'G' => 'C'); my $count = 0; for (split '', $string1) { my $char = substr($string2, $count++, 1); if ($char ne $corresponding{$_}) { print "Position $count incorrect: 1: $_, 2: $char\n"; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-23 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found