[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.46, Thu Dec 6 14:58:03 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 328  Line 323 
323  my $spl = SproutLoad->new($sprout, $fig, $geneFile, $options->{subsysFile}, $options);  my $spl = SproutLoad->new($sprout, $fig, $geneFile, $options->{subsysFile}, $options);
324  # Insure we have an output directory.  # Insure we have an output directory.
325  FIG::verify_dir($FIG_Config::sproutData);  FIG::verify_dir($FIG_Config::sproutData);
326    # Check for the "*" option.
327    if ($parameters[0] eq '*') {
328        @parameters = @LoadGroups;
329    }
330  # If we're resuming, we only want to have 1 parameter.  # If we're resuming, we only want to have 1 parameter.
331  my $resume = $options->{resume};  my $resume = $options->{resume};
332  if ($resume && @parameters > 1) {  if ($resume && @parameters > 1) {
# Line 335  Line 334 
334  } elsif (! @parameters) {  } elsif (! @parameters) {
335      Trace("No load groups were specified.") if T(0);      Trace("No load groups were specified.") if T(0);
336  }  }
337    # Process the resume option here. We modify the incoming parameters to
338    # contain the resume group and everything after it.
339    if ($resume) {
340        # Save the starting group.
341        my $resumeGroup = $parameters[0];
342        # Copy the load group list into the parameter array.
343        @parameters = @LoadGroups;
344        # Shift out the groups until we reach our desired starting point.
345        while (scalar(@parameters) && $parameters[0] ne $resumeGroup) {
346            shift @parameters;
347        }
348        if (! @parameters) {
349            Confess("Resume group \"$resumeGroup\" not found.");
350        }
351    }
352  # Set a variable to contain return type information.  # Set a variable to contain return type information.
353  my $rtype;  my $rtype;
354    # Set up a statistics object for statistics about the entire load.
355    my $totalStats = Stats->new();
356  # Insure we catch errors.  # Insure we catch errors.
357  eval {  eval {
358      # Process the parameters.      # Process the parameters.
359      for my $group (@parameters) {      for my $group (@parameters) {
360          Trace("Processing load group $group.") if T(2);          Trace("Processing load group $group.") if T(2);
361          my $stats;          # Compute the string we want to execute.
362          if ($group eq 'Genome' || $group eq '*') {          my $code = "\$spl->Load${group}Data()";
363              $spl->LoadGenomeData();          # Load this group.
364              $group = ResumeCheck($resume, $group);          my $stats = eval($code);
365          }          if ($@) {
366          if ($group eq 'Feature' || $group eq '*') {              Confess("Load group error: $@");
             $spl->LoadFeatureData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Coupling' || $group eq '*') {  
             $spl->LoadCouplingData();  
             $group = ResumeCheck($resume, $group);  
         }  
         if ($group eq 'Subsystem' || $group eq '*') {  
             $spl->LoadSubsystemData();  
             $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);  
367          }          }
368            # Merge the statistics into the master.
369            $totalStats->Accumulate($stats);
370        }
371        # Compute the statistical display.
372        my $statDisplay = $totalStats->Show();
373        # Display it.
374        Trace("Statistics for this load:\n$statDisplay") if T(2);
375        # Check for a "table load failed" message. If we find one, we want
376        # to end with an error.
377        if ($statDisplay =~ /table load failed/i) {
378            Confess("One or more table loads failed.");
379      }      }
380  };  };
381  if ($@) {  if ($@) {
# Line 413  Line 394 
394      }      }
395  }  }
396    
 # If the resume flag is set, return "*", else return "".  
 sub ResumeCheck {  
     my ($resume, $group) = @_;  
     return ($resume ? "*" : $group);  
 }  
   
397  1;  1;

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3