Commits

Sarah Richardson committed 767f1d7

non NEB buffers are a headache

  • Participants
  • Parent commits 196c525

Comments (0)

Files changed (2)

lib/Bio/GeneDesign/RestrictionEnzyme.pm

   {
     my $sval = $sbuffs->{$skey};
     my $bval = $bbuffs->{$skey};
-    if ($skey eq "Other" && $sval && $bval && $sval == $bval)
+    if ($skey eq "Other" && $sval && $bval && "$sval" eq "$bval")
     {
       push @answer, $skey;
     }
-    elsif ($sval && $bval && $sval == 100 && $bval == 100)
+    elsif ($sval && $bval && "$sval" == 100 && "$bval" == 100)
     {
       push @answer, $skey;
     }
   
   $buffer = $buffer || $self->acceptable_buffer($self, 100);
   my $buff = $self->buffers->{$buffer} || 1;
-  my $adj = 1 / ($buff / 100);
+  my $jad = $buff / 100;
+  my $adj = $jad > 0  ? 1 / $jad : 0;
   
   my $units = sprintf("%.1f", $freq * $aggr * $adj);
   

lib/Bio/GeneDesign/RestrictionEnzymes.pm

 {
   my ($seq, $RES) = @_;
   my $SITE_STATUS = {};
-  foreach my $re (@$RES)
+  foreach my $re (@{$RES})
   {
     my $tmphsh = $re->positions($seq);
-    $SITE_STATUS->{$re->id} = scalar(keys %$tmphsh);
+    $SITE_STATUS->{$re->id} = scalar keys %{$tmphsh};
   }
   return $SITE_STATUS;
 }