[Bio] / FigKernelScripts / check_for_new_genomes.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/check_for_new_genomes.pl

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

revision 1.1, Wed Nov 26 16:21:22 2008 UTC revision 1.3, Tue May 19 02:27:26 2009 UTC
# Line 35  Line 35 
35  foreach my $x (@poss)  foreach my $x (@poss)
36  {  {
37      my($g1,$g2) = @$x;      my($g1,$g2) = @$x;
38  #    my $gs1 = $fig->genus_species($g1);      my $gs1 = $fig->genus_species($g1);
39  #    my $gs2 = $fig->genus_species($g2);      my $gs2 = $fig->genus_species($g2);
40  #    print STDERR "Checking $gs1 [$g1] and $gs2 [$g2]\n";      print STDERR "Checking $gs1 [$g1] and $gs2 [$g2]\n";
41      &test(@$x,$file_of,$replace,$fig);      &test(@$x,$file_of,$replace,$fig);
42  }  }
43    
44  my %oldH = map { $_ =~ /^(\S+)/; $1 } `cat $old`;  my %oldH = map { $_ =~ /^(\S+)/; $1 => 1 } `cat $old`;
45  my %newH = map { $_ =~ /^(\S+)/; $1 } `cat $new`;  my %newH = map { $_ =~ /^(\S+)/; $1 => 1 } `cat $new`;
46    
47  my($from,$to,$n);  my($from,$to,$n);
48  foreach $_ (keys(%$replace))  foreach $_ (keys(%$replace))
# Line 217  Line 217 
217    
218      my $cov1 = &covered(\@blast1,$sizes1,$genome1);      my $cov1 = &covered(\@blast1,$sizes1,$genome1);
219      my $cov2 = &covered(\@blast2,$sizes2,$genome2);      my $cov2 = &covered(\@blast2,$sizes2,$genome2);
220  #   print STDERR "cov1=$cov1 cov2=$cov2\n";      print STDERR "cov1=$cov1 cov2=$cov2\n";
221    
222      my $THRESH = 0.98;      my $THRESH = 0.98;
223      if    (($cov1 >= $THRESH) && (! ($cov2 >= $THRESH))) { &replace($fig,$replace,$genome1,$genome2,$cov1,$cov2) }      if    (($cov1 >= $THRESH) && (! ($cov2 >= $THRESH))) { &replace($fig,$replace,$genome1,$genome2,$cov1,$cov2) }
# Line 287  Line 287 
287          }          }
288      }      }
289      my $frac = sprintf("%0.3f",$tot/$all);      my $frac = sprintf("%0.3f",$tot/$all);
290      print STDERR "coverage: $frac\n";  #   print STDERR "coverage: $frac\n";
291      return $frac;      return $frac;
292  }  }
293    
# Line 320  Line 320 
320  sub replace {  sub replace {
321      my($fig,$replace,$genome1,$genome2) = @_;      my($fig,$replace,$genome1,$genome2) = @_;
322    
323  #    my $gs1 = $fig->genus_species($genome1);      my $gs1 = $fig->genus_species($genome1);
324  #    my $gs2 = $fig->genus_species($genome2);      my $gs2 = $fig->genus_species($genome2);
325  #    print STDERR "$genome1 [$gs1] => $genome2 [$gs2]\n";      print STDERR "$genome1 [$gs1] => $genome2 [$gs2]\n";
326      $replace->{$genome1} = {$genome2};      $replace->{$genome1} = $genome2;
327  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3