[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.15, Wed Dec 7 01:19:00 2005 UTC revision 1.21, Mon Feb 13 09:45:07 2006 UTC
# Line 82  Line 82 
82    
83  =item 2  =item 2
84    
85  Type C<TestSproutLoad> and press ENTER. This will validate the Sprout database  Type C<TestSproutLoad 100226.1 83333.1> and press ENTER. This will validate
86  against the SEED data.  the Sprout database against the SEED data.
87    
88  =item 3  =item 3
89    
# Line 184  Line 184 
184    
185  Desired tracing level. The default is 3.  Desired tracing level. The default is 3.
186    
 =item limitedFeatures  
   
 Only generate the B<Feature> and B<IsLocatedIn> tables when processing the feature group.  
   
187  =item dbLoad  =item dbLoad
188    
189  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 197  Line 193 
193  If TRUE, the database will be created. If the database exists already, it will be  If TRUE, the database will be created. If the database exists already, it will be
194  dropped. Use the function with caution.  dropped. Use the function with caution.
195    
196    =item loadOnly
197    
198    If TRUE, the database tables will be loaded from existing load files. Load files
199    will not be created. This option is useful if you are setting up a copy of Sprout
200    and have load files already set up from the original version.
201    
202    =item primaryOnly
203    
204    If TRUE, only the group's primary entity will be loaded.
205    
206  =back  =back
207    
208  =cut  =cut
# Line 214  Line 220 
220  use SFXlate;  use SFXlate;
221    
222  # Get the command-line parameters and options.  # Get the command-line parameters and options.
223  my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "",  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',
224                                                      trace => 3, limitedFeatures => 0,                                              'ERDB', 'Load', 'Sprout'],
225                                                      dbLoad => 0, dbCreate => 0 }, @ARGV);                                              { geneFile => ["", "name of the genome list file"],
226  # Set up tracing.                                                subsysFile => ["", "name of the trusted subsystem file"],
227  TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log");                                                dbLoad => [0, "load the database from generated files"],
228                                                  dbCreate => [0, "drop and re-create the database"],
229                                                  loadOnly => [0, "load the database from previously generated files"],
230                                                  primaryOnly => [0, "only process the group's main entity"]
231                                                },
232                                                "<group1> <group2> ...",
233                                                @ARGV);
234    # If we're doing a load-only, turn on loading.
235    if ($options->{loadOnly}) {
236        $options->{dbLoad} = 1
237    }
238  if ($options->{dbCreate}) {  if ($options->{dbCreate}) {
239      # Here we want to drop and re-create the database.      # Here we want to drop and re-create the database.
240      my $db = $FIG_Config::sproutDB;      my $db = $FIG_Config::sproutDB;
241      if ($FIG_Config::dbms eq "Pg") {      DBKernel::CreateDB($db);
         my $dbport = $FIG_Config::dbport;  
         my $dbuser = $FIG_Config::dbuser;  
         Trace("Dropping old database (failure is okay).") if T(2);  
         system("dropdb -p $dbport -U $dbuser $db");  
         Trace("Dropping old database (failure is okay).") if T(2);  
         &FIG::run("createdb -p $dbport -U $dbuser $db");  
     } elsif ($FIG_Config::dbms eq "mysql") {  
         Trace("Dropping old database (failure is okay).") if T(2);  
         system("mysqladmin -u $FIG_Config::dbuser -p drop $db");  
         &FIG::run("mysqladmin -u $FIG_Config::dbuser -p create $db");  
         Trace("Dropping old database (failure is okay).") if T(2);  
     }  
   
242  }  }
243  # Create the sprout loader object. Note that the Sprout object does not  # Create the sprout loader object. Note that the Sprout object does not
244  # open the database unless the "dbLoad" option is turned on.  # open the database unless the "dbLoad" option is turned on.

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3