[Bio] / FortyEight / imp_salvage.pl Repository:
ViewVC logotype

Diff of /FortyEight/imp_salvage.pl

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

revision 1.3, Wed Oct 31 23:16:50 2007 UTC revision 1.4, Fri Nov 9 20:27:31 2007 UTC
# Line 70  Line 70 
70      my $rj = new Job48($rjdir);      my $rj = new Job48($rjdir);
71      my $rj_id = $rj->id;      my $rj_id = $rj->id;
72      my $orgdir = $rj->orgdir();      my $orgdir = $rj->orgdir();
     my $repfile = "$orgdir/REPLACES";  
73    
74      my $repl = &FIG::file_head($repfile);      my $repl = $rj->meta->get_metadata("replace.seedID");
75    
76      my $salvage_msg;      my $salvage_msg;
77    
78      if ($repl)      if ($repl ne "")
79      {      {
80          chomp $repl;          my $repfile = "$orgdir/REPLACES";
81            my $fh = $stage->open_file(">$repfile");
82            print $fh "$repl\n";
83            close($fh);
84    
85          my $n = do_salvage($rj, $repl);          my $n = do_salvage($rj, $repl);
86    
87          $salvage_msg = "$n function assignments salvaged from $repl " . $fig->genus_species($repl);          $salvage_msg = "$n function assignments salvaged from $repl " . $fig->genus_species($repl);
# Line 252  Line 255 
255      #      #
256    
257      my %rast;      my %rast;
258      my $imp_af = $stage->open_file(">$orgdir/imp_assigned_functions");  
259      for my $f (qw(assigned_functions proposed_non_ff_functions proposed_functions))      for my $f (qw(assigned_functions proposed_non_ff_functions proposed_functions))
260      {      {
261          my $path = "$orgdir/$f";          my $path = "$orgdir/$f";
# Line 261  Line 264 
264          {          {
265              while (<AF>)              while (<AF>)
266              {              {
267                  print $imp_af $_;                  print $new_af $_;
268                  chomp;                  chomp;
269                  my($peg, $fn) = split(/\t/);                  my($peg, $fn) = split(/\t/);
270                  $rast{$peg} = $fn;                  $rast{$peg} = $fn;
# Line 269  Line 272 
272              close(AF);              close(AF);
273          }          }
274      }      }
     close($imp_af);  
275    
276      #      #
277      # Copy annotations to imp_annotations to initialize it; leave the      # Copy annotations to imp_annotations to initialize it; leave the
# Line 356  Line 358 
358    
359          if ($old_func eq '')          if ($old_func eq '')
360          {          {
361              print "$ent->{old} => $new_peg No existing function\n";              # print "$ent->{old} => $new_peg No existing function\n";
362              print $new_anno join("\n", $new_peg, time, "salvage",              print $new_anno join("\n", $new_peg, time, "salvage",
363                                   "No function found in original organism $ent->{old}"), "\n//\n";                                   "No function found in original organism $ent->{old}"), "\n//\n";
364    
365          }          }
366          elsif ($old_func eq $new_func)          elsif ($old_func eq $new_func)
367          {          {
368              print "$ent->{old} => $new_peg functions are the same\n";              # print "$ent->{old} => $new_peg functions are the same\n";
369              print $new_anno join("\n", $new_peg, time, "salvage",              print $new_anno join("\n", $new_peg, time, "salvage",
370                                   "Old and new assignments are the same", $old_func), "\n//\n";                                   "Old and new assignments are the same", $old_func), "\n//\n";
371    
# Line 372  Line 374 
374          {          {
375              if (@ss_list > 0)              if (@ss_list > 0)
376              {              {
377                  print "$ent->{old} => $new_peg is in a ss\n";                  # print "$ent->{old} => $new_peg is in a ss\n";
378    
379                  print $new_anno join("\n", $new_peg, time, "salvage",                  print $new_anno join("\n", $new_peg, time, "salvage",
380                                       "Retaining old assignment due to membership in subsystems", "@ss_list", $old_func), "\n//\n";                                       "Retaining old assignment due to membership in subsystems", "@ss_list", $old_func), "\n//\n";
# Line 383  Line 385 
385              }              }
386              else              else
387              {              {
388                  print "$ent->{old} => $new_peg is not in a ss\n";                  # print "$ent->{old} => $new_peg is not in a ss\n";
389    
390                  print $new_anno join("\n", $new_peg, time, "salvage",                  print $new_anno join("\n", $new_peg, time, "salvage",
391                                       "Using RAST assignment due to no subsystem membership", $new_func), "\n//\n";                                       "Using RAST assignment due to no subsystem membership", $new_func), "\n//\n";

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3