[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.22, Sun Mar 26 17:28:20 2006 UTC revision 1.26, Sun Apr 2 17:33:52 2006 UTC
# Line 77  Line 77 
77    
78  =item 1  =item 1
79    
80  Type C<LoadSproutTables -dbLoad -dbCreate "*"> and press ENTER. This will create  Type
81  the C<dtx> files and load them. You may be asked for a password. If this is the  
82  case, simply press ENTER. If that does not work, use the C<dbpass> value specified      nohup LoadSproutTables -dbLoad -dbCreate -user=you -background "*" >null &
83  in your C<FIG_Config.pm> file.  
84    where C<you> is your user ID, and press ENTER. This will create the C<dtx> files
85    and load them. You may be asked for a password. If this is the case, simply
86    press ENTER. If that does not work, use the C<dbpass> value specified in
87    your C<FIG_Config.pm> file.
88    
89    The above command line runs the load in the background. The standard output,
90    standard error, and trace output will be directed to files in the FIG temporary
91    directory. If your user name is C<Bruce> then the files will be named
92    C<outBruce.log>, C<errBruce.log>, and C<traceBruce.log> respectively.
93    
94    If the load fails at some point and you are able to correct the problem, use the
95    C<resume> option to restart it. For example, if the load failed while doing the
96    Feature load group, you would resume it using
97    
98        nohup LoadSproutTables -dbLoad -dbCreate -user=you -resume -background Feature >null &
99    
100  =item 2  =item 2
101    
# Line 96  Line 111 
111  =item 4  =item 4
112    
113  Type C<index_sprout> and press ENTER. This will create the Glimpse indexes  Type C<index_sprout> and press ENTER. This will create the Glimpse indexes
114  for the Sprout data.  for the Sprout data. (The Windows version of SEED does not support Glimpse,
115    so only do this for the Unix version.)
116    
117  =back  =back
118    
# Line 186  Line 202 
202    
203  Desired tracing level. The default is 3.  Desired tracing level. The default is 3.
204    
205    =item user
206    
207    Suffix to use for trace, output, and error files created in
208    
209  =item dbLoad  =item dbLoad
210    
211  If TRUE, the database tables will be loaded automatically from the load files created.  If TRUE, the database tables will be loaded automatically from the load files created.
# Line 205  Line 225 
225    
226  If TRUE, only the group's primary entity will be loaded.  If TRUE, only the group's primary entity will be loaded.
227    
228    =item background
229    
230    Redirect the standard and error output to files in the FIG temporary directory.
231    
232    =item resume
233    
234    Resume an interrupted load, starting with the load group specified in the first
235    positional parameter.
236    
237    =item sql
238    
239    Trace SQL statements.
240    
241  =back  =back
242    
243  =cut  =cut
# Line 223  Line 256 
256    
257  # Get the command-line parameters and options.  # Get the command-line parameters and options.
258  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',
259                                              'ERDB', 'Load', 'Sprout'],                                              'ERDB', 'Load', 'Sprout', 'Subsystem'],
260                                              { geneFile => ["", "name of the genome list file"],                                              { geneFile => ["", "name of the genome list file"],
261                                                subsysFile => ["", "name of the trusted subsystem file"],                                                subsysFile => ["", "name of the trusted subsystem file"],
262                                                dbLoad => [0, "load the database from generated files"],                                                dbLoad => [0, "load the database from generated files"],
263                                                dbCreate => [0, "drop and re-create the database"],                                                dbCreate => [0, "drop and re-create the database"],
264                                                loadOnly => [0, "load the database from previously generated files"],                                                loadOnly => [0, "load the database from previously generated files"],
265                                                primaryOnly => [0, "only process the group's main entity"]                                                primaryOnly => [0, "only process the group's main entity"],
266                                                  resume => [0, "resume a complete load starting with the first group specified in the parameter list"],
267                                              },                                              },
268                                              "<group1> <group2> ...",                                              "<group1> <group2> ...",
269                                              @ARGV);                                              @ARGV);
# Line 249  Line 283 
283  my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile}, $options);  my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile}, $options);
284  # Insure we have an output directory.  # Insure we have an output directory.
285  FIG::verify_dir($FIG_Config::sproutData);  FIG::verify_dir($FIG_Config::sproutData);
286    # If we're resuming, we only want to have 1 parameter.
287    my $resume = $options->{resume};
288    if ($resume && @parameters > 1) {
289        Confess("If resume=1, only one load group can be specified.");
290    } elsif (! @parameters) {
291        Confess("No load groups were specified.");
292    }
293  # Process the parameters.  # Process the parameters.
294  for my $group (@parameters) {  for my $group (@parameters) {
295      Trace("Processing load group $group.") if T(2);      Trace("Processing load group $group.") if T(2);
296      my $stats;      my $stats;
297      if ($group eq 'Genome' || $group eq '*') {      if ($group eq 'Genome' || $group eq '*') {
298          $spl->LoadGenomeData();          $spl->LoadGenomeData();
299            $group = ResumeCheck($resume);
300      }      }
301      if ($group eq 'Feature' || $group eq '*') {      if ($group eq 'Feature' || $group eq '*') {
302          $spl->LoadFeatureData();          $spl->LoadFeatureData();
303            $group = ResumeCheck($resume);
304      }      }
305      if ($group eq 'Coupling' || $group eq '*') {      if ($group eq 'Coupling' || $group eq '*') {
306          $spl->LoadCouplingData();          $spl->LoadCouplingData();
307            $group = ResumeCheck($resume);
308      }      }
309      if ($group eq 'Subsystem' || $group eq '*') {      if ($group eq 'Subsystem' || $group eq '*') {
310          $spl->LoadSubsystemData();          $spl->LoadSubsystemData();
311            $group = ResumeCheck($resume);
312      }      }
313      if ($group eq 'Property' || $group eq '*') {      if ($group eq 'Property' || $group eq '*') {
314          $spl->LoadPropertyData();          $spl->LoadPropertyData();
315            $group = ResumeCheck($resume);
316      }      }
317      if ($group eq 'Annotation' || $group eq '*') {      if ($group eq 'Annotation' || $group eq '*') {
318          $spl->LoadAnnotationData();          $spl->LoadAnnotationData();
319            $group = ResumeCheck($resume);
320      }      }
321      if ($group eq 'BBH' || $group eq '*') {      if ($group eq 'BBH' || $group eq '*') {
322          $spl->LoadBBHData();          $spl->LoadBBHData();
323            $group = ResumeCheck($resume);
324      }      }
325      if ($group eq 'Group' || $group eq '*') {      if ($group eq 'Group' || $group eq '*') {
326          $spl->LoadGroupData();          $spl->LoadGroupData();
327            $group = ResumeCheck($resume);
328      }      }
329      if ($group eq 'Source' || $group eq '*') {      if ($group eq 'Source' || $group eq '*') {
330          $spl->LoadSourceData();          $spl->LoadSourceData();
331            $group = ResumeCheck($resume);
332      }      }
333      if ($group eq 'External' || $group eq '*') {      if ($group eq 'External' || $group eq '*') {
334          $spl->LoadExternalData();          $spl->LoadExternalData();
335            $group = ResumeCheck($resume);
336      }      }
337      if ($group eq 'Reaction' || $group eq '*') {      if ($group eq 'Reaction' || $group eq '*') {
338          $spl->LoadReactionData();          $spl->LoadReactionData();
339            $group = ResumeCheck($resume);
340      }      }
341    
342  }  }
343  Trace("Load complete.") if T(2);  Trace("Load complete.") if T(2);
344    
345    # If the resume flag is set, return "*", else return "".
346    sub ResumeCheck {
347        my ($resume) = @_;
348        return ($resume ? "*" : "");
349    }
350    
351  1;  1;

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.26

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3