[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.28, Wed Apr 19 03:34:15 2006 UTC revision 1.38, Wed Aug 2 23:51:19 2006 UTC
# Line 214  Line 214 
214    
215  Loads B<Genome>, B<HasContig>, B<Contig>, B<IsMadeUpOf>, and B<Sequence>.  Loads B<Genome>, B<HasContig>, B<Contig>, B<IsMadeUpOf>, and B<Sequence>.
216    
 =item Coupling  
   
 Loads B<Coupling>, B<IsEvidencedBy>, B<PCH>, B<ParticipatesInCoupling>,  
 B<UsesAsEvidence>.  
   
217  =item Feature  =item Feature
218    
219  Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>,  Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>,
220  B<IsLocatedIn>, B<FeatureLink>.  B<IsLocatedIn>, B<FeatureLink>.
221    
222    =item Coupling
223    
224    Loads B<Coupling>, B<IsEvidencedBy>, B<PCH>, B<ParticipatesInCoupling>,
225    B<UsesAsEvidence>.
226    
227  =item Subsystem  =item Subsystem
228    
229  Loads B<Subsystem>, B<Role>, B<SSCell>, B<ContainsFeature>, B<IsGenomeOf>,  Loads B<Subsystem>, B<Role>, B<SSCell>, B<ContainsFeature>, B<IsGenomeOf>,
# Line 262  Line 262 
262  Loads B<ReactionURL>, B<Compound>, B<CompoundName>,  Loads B<ReactionURL>, B<Compound>, B<CompoundName>,
263  B<CompoundCAS>, B<IsAComponentOf>, B<Reaction>.  B<CompoundCAS>, B<IsAComponentOf>, B<Reaction>.
264    
265    =item Synonym
266    
267    Loads B<SynonymGroup> and B<IsSynonymGroupFor>.
268    
269    =item Family
270    
271    Loads B<Family> and B<IsFamilyForFeature>.
272    
273  =item *  =item *
274    
275  Loads all of the above tables.  Loads all of the above tables.
# Line 290  Line 298 
298    
299  =item user  =item user
300    
301  Suffix to use for trace, output, and error files created in  Suffix to use for trace, output, and error files created.
302    
303  =item dbLoad  =item dbLoad
304    
# Line 324  Line 332 
332    
333  Trace SQL statements.  Trace SQL statements.
334    
335    =item phone
336    
337    Phone number to message when the load finishes.
338    
339  =back  =back
340    
341  =cut  =cut
# Line 350  Line 362 
362                                                loadOnly => [0, "load the database from previously generated files"],                                                loadOnly => [0, "load the database from previously generated files"],
363                                                primaryOnly => [0, "only process the group's main entity"],                                                primaryOnly => [0, "only process the group's main entity"],
364                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],                                                resume => [0, "resume a complete load starting with the first group specified in the parameter list"],
365                                                  phone => ["", "phone number (international format) to call when load finishes"],
366                                              },                                              },
367                                              "<group1> <group2> ...",                                              "<group1> <group2> ...",
368                                              @ARGV);                                              @ARGV);
# Line 374  Line 387 
387  if ($resume && @parameters > 1) {  if ($resume && @parameters > 1) {
388      Confess("If resume=1, only one load group can be specified.");      Confess("If resume=1, only one load group can be specified.");
389  } elsif (! @parameters) {  } elsif (! @parameters) {
390      Confess("No load groups were specified.");      Trace("No load groups were specified.") if T(0);
391  }  }
392    # Set a variable to contain return type information.
393    my $rtype;
394    # Insure we catch errors.
395    eval {
396  # Process the parameters.  # Process the parameters.
397  for my $group (@parameters) {  for my $group (@parameters) {
398      Trace("Processing load group $group.") if T(2);      Trace("Processing load group $group.") if T(2);
399      my $stats;      my $stats;
400      if ($group eq 'Genome' || $group eq '*') {      if ($group eq 'Genome' || $group eq '*') {
401          $spl->LoadGenomeData();          $spl->LoadGenomeData();
402          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
403      }      }
404      if ($group eq 'Feature' || $group eq '*') {      if ($group eq 'Feature' || $group eq '*') {
405          $spl->LoadFeatureData();          $spl->LoadFeatureData();
406          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
407      }      }
408      if ($group eq 'Coupling' || $group eq '*') {      if ($group eq 'Coupling' || $group eq '*') {
409          $spl->LoadCouplingData();          $spl->LoadCouplingData();
410          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
411      }      }
412      if ($group eq 'Subsystem' || $group eq '*') {      if ($group eq 'Subsystem' || $group eq '*') {
413          $spl->LoadSubsystemData();          $spl->LoadSubsystemData();
414          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
415      }      }
416      if ($group eq 'Property' || $group eq '*') {      if ($group eq 'Property' || $group eq '*') {
417          $spl->LoadPropertyData();          $spl->LoadPropertyData();
418          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
419      }      }
420      if ($group eq 'Annotation' || $group eq '*') {      if ($group eq 'Annotation' || $group eq '*') {
421          $spl->LoadAnnotationData();          $spl->LoadAnnotationData();
422          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
423      }      }
424      if ($group eq 'BBH' || $group eq '*') {      if ($group eq 'BBH' || $group eq '*') {
425          $spl->LoadBBHData();          $spl->LoadBBHData();
426          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
427      }      }
428      if ($group eq 'Group' || $group eq '*') {      if ($group eq 'Group' || $group eq '*') {
429          $spl->LoadGroupData();          $spl->LoadGroupData();
430          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
431      }      }
432      if ($group eq 'Source' || $group eq '*') {      if ($group eq 'Source' || $group eq '*') {
433          $spl->LoadSourceData();          $spl->LoadSourceData();
434          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
435      }      }
436      if ($group eq 'External' || $group eq '*') {      if ($group eq 'External' || $group eq '*') {
437          $spl->LoadExternalData();          $spl->LoadExternalData();
438          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
439      }      }
440      if ($group eq 'Reaction' || $group eq '*') {      if ($group eq 'Reaction' || $group eq '*') {
441          $spl->LoadReactionData();          $spl->LoadReactionData();
442          $group = ResumeCheck($resume);              $group = ResumeCheck($resume, $group);
     }  
   
443  }  }
444            if ($group eq 'Synonym' || $group eq '*') {
445                $spl->LoadSynonymData();
446                $group = ResumeCheck($resume, $group);
447            }
448            if ($group eq 'Family' || $group eq '*') {
449                $spl->LoadFamilyData();
450                $group = ResumeCheck($resume, $group);
451            }
452        }
453    };
454    if ($@) {
455        Trace("Load failed with error: $@") if T(0);
456        $rtype = "error";
457    } else {
458  Trace("Load complete.") if T(2);  Trace("Load complete.") if T(2);
459        $rtype = "no error";
460    }
461    if ($options->{phone}) {
462        my $msgID = Tracer::SendSMS($options->{phone}, "Sprout load terminated with $rtype.");
463        if ($msgID) {
464            Trace("Phone message sent with ID $msgID.") if T(2);
465        } else {
466            Trace("Phone message not sent.") if T(2);
467        }
468    }
469    
470  # If the resume flag is set, return "*", else return "".  # If the resume flag is set, return "*", else return "".
471  sub ResumeCheck {  sub ResumeCheck {
472      my ($resume) = @_;      my ($resume, $group) = @_;
473      return ($resume ? "*" : "");      return ($resume ? "*" : $group);
474  }  }
475    
476  1;  1;

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.38

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3