Sarah Richardson avatar Sarah Richardson committed 767f1d7

non NEB buffers are a headache

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;
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.