Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am getting confused, do I need some sort of look-up table which says A -> T , C->G , G->C , T->A ?? If so, how can I do this?
Any help i'll be very grateful ;-> # below is my snippet of code, it is wrongly looking for exact matches, but I need to look for reverse complementary matches.
for (my $i=0; $i < @array1; $i++) { $dna = reverse $array1[$i]; $dna =~ tr/actg/tgac/; if ($dna eq $array1[$i]) { # problem is here, I am testing for equality, but need to test for com +plementarity! print "\nFOUND $array1[$i] \t $dna"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string complement question
by Limbic~Region (Chancellor) on Nov 21, 2003 at 13:45 UTC | |
|
Re: string complement question
by Abigail-II (Bishop) on Nov 21, 2003 at 12:21 UTC | |
|
Re: string complement question
by Art_XIV (Hermit) on Nov 21, 2003 at 13:49 UTC | |
by thospel (Hermit) on Nov 21, 2003 at 16:44 UTC | |
|
Re: string complement question
by b10m (Vicar) on Nov 21, 2003 at 12:28 UTC | |
by Anonymous Monk on Nov 21, 2003 at 13:10 UTC | |
by b10m (Vicar) on Nov 21, 2003 at 13:23 UTC | |
by Abigail-II (Bishop) on Nov 21, 2003 at 13:55 UTC | |
|
Re: string complement question
by duff (Parson) on Nov 21, 2003 at 16:17 UTC |