in reply to need help comparing DNA compliments
I don't know how the pairing works, so this sample code only includes the pairs you specifically mentioned in your post, if there are other possible pairs you would have to add them to %good_pairs.
my %good_pairs = ( 'A' => 'T', 'T' => 'A', 'G' => 'C', 'C' => 'G', ); for(0 .. $#dna) { if($dna[$_] ne $good_pairs{$comp[$_]}) { print "mismatch: $dna[$_] $comp[$_]\n"; } }
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|