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

Annotation of /FigKernelScripts/salvage_master_annotations.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (view) (download) (as text)

1 : overbeek 1.1 ########################################################################
2 :     #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 :     #
8 :     # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 :     # Public License.
11 :     #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :    
19 :     use FIG;
20 :     my $fig = new FIG;
21 :    
22 :     my $usage = "usage: salvage_master_annotations OldData NewData Maps OldNewMap";
23 :    
24 :     (
25 :     ($oldData = shift @ARGV) &&
26 :     ($newData = shift @ARGV) &&
27 :     ($maps = shift @ARGV) &&
28 :     ($old_new = shift @ARGV)
29 :     )
30 :     || die $usage;
31 :    
32 :     my $oldOrg = "$oldData/Organisms";
33 :     my $newOrg = "$newData/Organisms";
34 :    
35 :     if (! -d $maps)
36 :     {
37 :     &run("make_peg_maps $oldOrg $newOrg $maps < $old_new");
38 :     }
39 :    
40 :     opendir(NEW,"$newOrg") || die "could not open $newOrg";
41 :     foreach my $org (grep { $_ =~ /^\d+\.\d+$/ } readdir(NEW))
42 :     {
43 :     if (-d "$oldOrg/$org")
44 :     {
45 :     if (-s "$oldOrg/$org/assigned_functions")
46 :     {
47 :     system("cp", "$oldOrg/$org/assigned_functions","$newOrg/$org/assigned_functions");
48 :     }
49 :    
50 :     if (-s "$oldOrg/$org/annotations")
51 :     {
52 :     system("cp", "$oldOrg/$org/annotations","$newOrg/$org/annotations");
53 :     }
54 :     }
55 :     }
56 :    
57 :     foreach $_ (`cat $old_new`)
58 :     {
59 :     if ($_ =~ /^(\d+\.\d+)\t(\d+\.\d+)$/)
60 :     {
61 :     $old = $1;
62 :     $new = $2;
63 :     if ((-d "$oldOrg/$old") && (-d "$newOrg/$new") && (-s "$maps/$old-$new"))
64 :     {
65 :     print STDERR "making assignments for $new from $old\n";
66 :     &FIG::run("salvage_annotations $oldOrg/$old $newOrg/$new $maps/$old-$new");
67 :     }
68 :     else
69 :     {
70 :     print STDERR "bad input pair: $_";
71 :     }
72 :     }
73 :     }
74 :     system "rm -r $newData/Subsystems/*" # clear out subsystems to pull in from master
75 :     &FIG::run("salvage_subsystem_rows $oldData/Subsystems $newData/Subsystems $maps $newData");
76 :     &FIG::run("index_annotations");
77 : overbeek 1.3 &FIG::run("index_subsystems");
78 : overbeek 1.1 &FIG::run("add_assertions_of_function");
79 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3