Commits

Sarah Richardson committed 2b672ff

this is a doozy. wasn't checking actual regular expressions for fixes. Aya, anything with an non standard nucleotide code would pass!

Comments (0)

Files changed (1)

lib/Bio/GeneDesign/Codons.pm

     #compute the changes possible
     for my $it (1..$len)
     {
-      my @map = map { join q{}, sort @$_ } combine($it,(1..$len));
+      my @map = map { join q{}, sort @{$_} } combine($it, (1..$len));
       foreach my $guide (@map)
       {
         my $rscuers = {};
                               @{$revcodon_t->{$codon_t->{$coda}}})
             {
               my $newstr = $str;
-              #substr($newstr, $coord*3-3, 3) = $codb;
               substr $newstr, ($coord * 3) - 3, 3, $codb;
               push @{$rscuers->{$passthrough+1}}, $newstr;
             }
                            || $newseqs{$a}->[1] <=> $newseqs{$b}->[1]}
                         keys %newseqs)
     {
-      if ($newseq !~ $pattern && _complement($newseq, 1) !~ $pattern)
+      my $qeswen = _complement($newseq, 1);
+      my $matchflag = 0;
+      foreach my $regex (@{$regarr})
+      {
+        $matchflag++ if ($newseq =~ $regex);
+        $matchflag++ if ($qeswen =~ $regex);
+      }
+      if ($matchflag == 0)
       {
         $newrepseg = $newseq;
         last;