[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.17, Fri Jan 13 06:59:49 2006 UTC revision 1.21, Mon Feb 13 09:45:07 2006 UTC
# Line 199  Line 199 
199  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
200  and have load files already set up from the original version.  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 217  Line 221 
221    
222  # Get the command-line parameters and options.  # Get the command-line parameters and options.
223  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',
224                                              'ERDB', 'Load'],                                              'ERDB', 'Load', 'Sprout'],
225                                              { geneFile => "", subsysFile => "",                                              { geneFile => ["", "name of the genome list file"],
226                                                dbLoad => 0, dbCreate => 0,                                                subsysFile => ["", "name of the trusted subsystem file"],
227                                                loadOnly => 0 },                                                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);                                              @ARGV);
234  # If we're doing a load-only, turn on loading.  # If we're doing a load-only, turn on loading.
235  if ($options->{loadOnly}) {  if ($options->{loadOnly}) {
# Line 229  Line 238 
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("Creating new database.") 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("Creating new database.") 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.17  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3