[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.43, Fri May 11 06:23:51 2007 UTC revision 1.44, Mon Jul 16 20:05:55 2007 UTC
# Line 155  Line 155 
155  =item Feature  =item Feature
156    
157  Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>,  Loads B<Feature>, B<FeatureAlias>, B<FeatureTranslation>, B<FeatureUpstream>,
158  B<IsLocatedIn>, B<FeatureLink>.  B<IsLocatedIn>, B<FeatureLink>, B<IsAliasOf>, B<CDD>, B<HasFeature>,
159    B<HasRoleInSubsystem>, B<FeatureEssential>, B<FeatureVirulent>, B<FeatureIEDB>,
160  =item Coupling  B<CDD>, and B<IsPresentOnProteinOf>
   
 Loads B<Coupling>, B<IsEvidencedBy>, B<PCH>, B<ParticipatesInCoupling>,  
 B<UsesAsEvidence>.  
161    
162  =item Subsystem  =item Subsystem
163    
# Line 168  Line 165 
165  B<IsRoleOf>, B<OccursInSubsystem>, B<ParticipatesIn>, B<HasSSCell>,  B<IsRoleOf>, B<OccursInSubsystem>, B<ParticipatesIn>, B<HasSSCell>,
166  B<Catalyzes>, B<ConsistsOfRoles>, B<RoleSubset>, B<HasRoleSubset>,  B<Catalyzes>, B<ConsistsOfRoles>, B<RoleSubset>, B<HasRoleSubset>,
167  B<ConsistsOfGenomes>, B<GenomeSubset>, B<HasGenomeSubset>, B<Diagram>,  B<ConsistsOfGenomes>, B<GenomeSubset>, B<HasGenomeSubset>, B<Diagram>,
168  B<RoleOccursIn>.  B<RoleOccursIn>, B<SubSystemClass>, B<RoleEC>, B<IsIdentifiedByEC>,
169    B<ContainsFeature>.
170    
171  =item Annotation  =item Annotation
172    
# Line 206  Line 204 
204    
205  =item Drug  =item Drug
206    
207  Loads B<DrugProject>, B<ContainsTopic>, B<DrugTopic>, B<ContainsAnalysisOf>,  Loads B<PDB>, B<DocksWith>, C<IsProteinForFeature>, and C<Ligand>.
 B<PDB>, B<IncludesBound>, B<PDB>, B<IsBoundIn>, B<BindsWith>, B<Ligand>,  
 B<DescribesProteinForFeature>, and B<FeatureConservation>.  
208    
209  =item *  =item *
210    
# Line 256  Line 252 
252  will not be created. This option is useful if you are setting up a copy of Sprout  will not be created. This option is useful if you are setting up a copy of Sprout
253  and have load files already set up from the original version.  and have load files already set up from the original version.
254    
 =item primaryOnly  
   
 If TRUE, only the group's primary entity will be loaded.  
   
255  =item background  =item background
256    
257  Redirect the standard and error output to files in the FIG temporary directory.  Redirect the standard and error output to files in the FIG temporary directory.
# Line 293  Line 285 
285  use Stats;  use Stats;
286  use SFXlate;  use SFXlate;
287    
288    # This is a list of the load groups in their natural order. We'll go through these in sequence, processing
289    # the ones the user asks for.
290    my @LoadGroups = qw(Genome Feature Subsystem Property Annotation Source External Reaction Synonym Family Drug);
291    
292  # Get the command-line parameters and options.  # Get the command-line parameters and options.
293  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',
294                                              'ERDB', 'Load', 'Sprout', 'Subsystem'],                                              'ERDB', 'Load', 'Sprout', 'Subsystem'],
# Line 301  Line 297 
297                                                dbLoad => [0, "load the database from generated files"],                                                dbLoad => [0, "load the database from generated files"],
298                                                dbCreate => [0, "drop and re-create the database"],                                                dbCreate => [0, "drop and re-create the database"],
299                                                loadOnly => [0, "load the database from previously generated files"],                                                loadOnly => [0, "load the database from previously generated files"],
                                               primaryOnly => [0, "only process the group's main entity"],  
300                                                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"],
301                                                phone => ["", "phone number (international format) to call when load finishes"],                                                phone => ["", "phone number (international format) to call when load finishes"],
302                                              },                                              },
# Line 335  Line 330 
330  } elsif (! @parameters) {  } elsif (! @parameters) {
331      Trace("No load groups were specified.") if T(0);      Trace("No load groups were specified.") if T(0);
332  }  }
333    # Process the resume option here. We modify the incoming parameters to
334    # contain the resume group and everything after it.
335    if ($resume) {
336        # Save the starting group.
337        my $resumeGroup = $parameters[0];
338        # Copy the load group list into the parameter array.
339        @parameters = @LoadGroups;
340        push @parameters, @LoadGroups;
341        # Shift out the groups until we reach our desired starting point.
342        while (scalar(@parameters) && $parameters[0] ne $resumeGroup) {
343            shift @parameters;
344        }
345        if (! @parameters) {
346            Confess("Resume group \"$resumeGroup\" not found.");
347        }
348    }
349  # Set a variable to contain return type information.  # Set a variable to contain return type information.
350  my $rtype;  my $rtype;
351    # Set up a statistics object for statistics about the entire load.
352    my $totalStats = Stats->new();
353  # Insure we catch errors.  # Insure we catch errors.
354  eval {  eval {
355      # Process the parameters.      # Process the parameters.
356      for my $group (@parameters) {      for my $group (@parameters) {
357          Trace("Processing load group $group.") if T(2);          Trace("Processing load group $group.") if T(2);
358          my $stats;          # Compute the string we want to execute.
359          if ($group eq 'Genome' || $group eq '*') {          my $code = "\$spl->Load${group}Data()";
360              $spl->LoadGenomeData();          # Load this group.
361              $group = ResumeCheck($resume, $group);          my $stats = eval($code);
362          }          # Merge the statistics into the master.
363          if ($group eq 'Feature' || $group eq '*') {          $totalStats->Accumulate($stats);
364              $spl->LoadFeatureData();      }
365              $group = ResumeCheck($resume, $group);      # Compute the statistical display.
366          }      my $statDisplay = $totalStats->Show();
367          if ($group eq 'Coupling' || $group eq '*') {      # Display it.
368              $spl->LoadCouplingData();      Trace("Statistics for this load:\n$statDisplay") if T(2);
369              $group = ResumeCheck($resume, $group);      # Check for a "table load failed" message. If we find one, we want
370          }      # to end with an error.
371          if ($group eq 'Subsystem' || $group eq '*') {      if ($statDisplay =~ /table load failed/i) {
372              $spl->LoadSubsystemData();          Confess("One or more table loads failed.");
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Property' || $group eq '*') {  
             $spl->LoadPropertyData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Annotation' || $group eq '*') {  
             $spl->LoadAnnotationData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Group' || $group eq '*') {  
             $spl->LoadGroupData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Source' || $group eq '*') {  
             $spl->LoadSourceData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'External' || $group eq '*') {  
             $spl->LoadExternalData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Reaction' || $group eq '*') {  
             $spl->LoadReactionData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Synonym' || $group eq '*') {  
             $spl->LoadSynonymData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Family' || $group eq '*') {  
             $spl->LoadFamilyData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Drug' || $group eq '*') {  
             $spl->LoadDrugData();  
             $group = ResumeCheck($resume, $group);  
         }  
373      }      }
374  };  };
375  if ($@) {  if ($@) {
# Line 413  Line 388 
388      }      }
389  }  }
390    
 # If the resume flag is set, return "*", else return "".  
 sub ResumeCheck {  
     my ($resume, $group) = @_;  
     return ($resume ? "*" : $group);  
 }  
   
391  1;  1;

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3