[Bio] / FigKernelPackages / ProtSims.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/ProtSims.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Sun Aug 23 01:37:28 2009 UTC revision 1.7, Sun Aug 23 17:23:53 2009 UTC
# Line 160  Line 160 
160    
161      my $best_sc = $pieces->[0]->[10];      my $best_sc = $pieces->[0]->[10];
162      my @sims = sort { ($a->[6] <=> $b->[6]) } @$pieces;      my @sims = sort { ($a->[6] <=> $b->[6]) } @$pieces;
163      while ((@sims > 1) &&      while (@sims > 1)
164             ($sims[1]->[6] <= ($sims[0]->[7] + 100)) &&      {
165             ($sims[1]->[8] <= ($sims[0]->[9] + 100)) &&          my $gap1 = $sims[1]->[6] - $sims[0]->[7];
166             (abs(($sims[1]->[6] - $sims[0]->[7]) - ($sims[1]->[8] - $sims[0]->[9])) < 20))          my $gap2 = $sims[1]->[8] - $sims[0]->[9];
167            my $diff = abs($gap1 - $gap2);
168            if (($gap1 <= 300) && ($gap2 <= 300) && ($diff <= (0.1 * &min($gap1,$gap2))))
169      {      {
170          $sims[0]->[7] = $sims[1]->[7];          $sims[0]->[7] = $sims[1]->[7];
171          $sims[0]->[9] = $sims[1]->[9];          $sims[0]->[9] = $sims[1]->[9];
172            }
173          splice(@sims,1,1);          splice(@sims,1,1);
174      }      }
175      $sims[0]->[10] = $best_sc;      $sims[0]->[10] = $best_sc;
176      return $sims[0];      return $sims[0];
177  }  }
178    
179    sub min {
180        my($x,$y) = @_;
181        return ($x <= $y) ? $x : $y;
182    }
183    
184  1;  1;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3