[Bio] / Sprout / LoadSproutTables.pl Repository:
ViewVC logotype

Diff of /Sprout/LoadSproutTables.pl

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

revision 1.1, Wed Jul 27 20:05:24 2005 UTC revision 1.10, Thu Oct 20 09:31:30 2005 UTC
# Line 2  Line 2 
2    
3  =head1 Load Sprout Tables  =head1 Load Sprout Tables
4    
5  Load a group of Sprout tables from the command line. The parameters are the names of  Create the load files for a group of Sprout tables. The parameters are the names of
6  the table groups to load. The legal table group names are given below.  the table groups whose data is to be created. The legal table group names are given below.
7    
8  =over 4  =over 4
9    
# Line 19  Line 19 
19  =item Feature  =item Feature
20    
21  Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>,  Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>,
22  B<IsLocatedIn>, B<IsBidirectionalBestHitOf>, B<FeatureLink>.  B<IsLocatedIn>, B<FeatureLink>.
23    
24  =item Subsystem  =item Subsystem
25    
26  Loads B<Subsystem>, B<Role>, B<SSCell>, B<Diagram>, B<ContainsFeature>, B<IsGenomeOf>,  Loads B<Subsystem>, B<Role>, B<SSCell>, B<ContainsFeature>, B<IsGenomeOf>,
27  B<IsRoleOf>, B<OccursInSubsystem>, B<ParticipatesIn>, B<HasSSCell>.  B<IsRoleOf>, B<OccursInSubsystem>, B<ParticipatesIn>, B<HasSSCell>,
28    B<Catalyzes>, B<Reaction>, B<ConsistsOfRoles>, B<RoleSubset>, B<HasRoleSubset>,
29    B<ConsistsOfGenomes>, B<GenomeSubset>, B<HasGenomeSubset>
30    
31    =item Annotation
32    
33    Loads B<SproutUser>, B<UserAccess>, B<Annotation>, B<IsTargetOfAnnotation>,
34    B<MadeAnnotation>.
35    
36    =item Diagram
37    
38    Loads B<Diagram>, B<RoleOccursIn>.
39    
40    =item Property
41    
42    Loads B<Property>, B<HasProperty>.
43    
44    =item BBH
45    
46    Loads B<IsBidirectionalBestHitOf>.
47    
48    =item Group
49    
50    Loads B<GenomeGroups>.
51    
52    =item Source
53    
54    Loads B<Source>, B<ComesFrom>, B<SourceURL>.
55    
56    =item External
57    
58    Loads B<ExternalAliasOrg>, B<ExternalAliasFunc>.
59    
60    =item Reaction
61    
62    Loads B<ReactionURL>, B<Compound>, B<CompoundName>,
63    B<CompoundCAS>, B<IsAComponentOf>.
64    
65    =item *
66    
67    Loads all of the above tables.
68    
69  =back  =back
70    
71  There are two command-line options, given below. Note that in the command line, spaces  The command-line options are given below.
 inside parameters should be represented by C<\b>.  
72    
73  =over 4  =over 4
74    
# Line 49  Line 88 
88    
89  Desired tracing level. The default is 3.  Desired tracing level. The default is 3.
90    
91    =item limitedFeatures
92    
93    Only generate the B<Feature> and B<IsLocatedIn> tables when processing the feature group.
94    
95    =item dbLoad
96    
97    If TRUE, the database tables will be loaded automatically from the load files created.
98    
99  =back  =back
100    
101  =cut  =cut
# Line 56  Line 103 
103  use strict;  use strict;
104  use Tracer;  use Tracer;
105  use DocUtils;  use DocUtils;
 use TestUtils;  
106  use Cwd;  use Cwd;
107  use FIG;  use FIG;
108  use SFXlate;  use SFXlate;
# Line 64  Line 110 
110  use File::Path;  use File::Path;
111  use SproutLoad;  use SproutLoad;
112  use Stats;  use Stats;
113    use SFXlate;
114    
115  # Get the command-line parameters and options.  # Get the command-line parameters and options.
116  my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "",  my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "",
117                                                      trace => 3 },                                                      trace => 3, limitedFeatures => 0,
118                                                                 @ARGV);                                                      dbLoad => 0 }, @ARGV);
119  # Set up tracing.  # Set up tracing.
120  TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Tracer Load", "+>$FIG_Config::temp/trace.log");  TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log");
121  # Create the sprout loader object.  # Create the sprout loader object. Note that the Sprout object does not
122    # open the database unless the "dbLoad" option is turned on.
123  my $fig = FIG->new();  my $fig = FIG->new();
124  my $sprout = SFXlate->new_sprout_only();  my $sprout = SFXlate->new_sprout_only(undef, undef, undef, ! $options->{dbLoad});
125  my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile},  my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile}, $options);
                           $options->{subsysFile});  
126  # Process the parameters.  # Process the parameters.
127  for my $group (@parameters) {  for my $group (@parameters) {
128      Trace("Processing load group $group.") if T(2);      Trace("Processing load group $group.") if T(2);
129      my $stats;      my $stats;
130      if ($group eq 'Genome') {      if ($group eq 'Genome' || $group eq '*') {
131          $spl->LoadGenomeData();          $spl->LoadGenomeData();
132      } elsif ($group eq 'Feature') {      }
133        if ($group eq 'Feature' || $group eq '*') {
134          $spl->LoadFeatureData();          $spl->LoadFeatureData();
135      } elsif ($group eq 'Coupling') {      }
136        if ($group eq 'Coupling' || $group eq '*') {
137          $spl->LoadCouplingData();          $spl->LoadCouplingData();
138      } elsif ($group eq 'Subsystem') {      }
139        if ($group eq 'Subsystem' || $group eq '*') {
140          $spl->LoadSubsystemData();          $spl->LoadSubsystemData();
141      } elsif ($group eq 'Property') {      }
142        if ($group eq 'Property' || $group eq '*') {
143          $spl->LoadPropertyData();          $spl->LoadPropertyData();
     } else {  
         Confess("Invalid group name $group.");  
144      }      }
145        if ($group eq 'Diagram' || $group eq '*') {
146            $spl->LoadDiagramData();
147        }
148        if ($group eq 'Annotation' || $group eq '*') {
149            $spl->LoadAnnotationData();
150        }
151        if ($group eq 'BBH' || $group eq '*') {
152            $spl->LoadBBHData();
153        }
154        if ($group eq 'Group' || $group eq '*') {
155            $spl->LoadGroupData();
156        }
157        if ($group eq 'Source' || $group eq '*') {
158            $spl->LoadSourceData();
159        }
160        if ($group eq 'External' || $group eq '*') {
161            $spl->LoadExternalData();
162        }
163        if ($group eq 'Reaction' || $group eq '*') {
164            $spl->LoadReactionData();
165        }
166    
167  }  }
168  Trace("Load complete.") if T(2);  Trace("Load complete.") if T(2);
169    

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3