[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.18, Sun Jan 15 21:32:17 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  =back  =back
203    
204  =cut  =cut
# Line 214  Line 216 
216  use SFXlate;  use SFXlate;
217    
218  # Get the command-line parameters and options.  # Get the command-line parameters and options.
219  my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "",  my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats',
220                                                      trace => 3, limitedFeatures => 0,                                              'ERDB', 'Load'],
221                                                      dbLoad => 0, dbCreate => 0 }, @ARGV);                                              { geneFile => ["", "name of the genome list file"],
222  # Set up tracing.                                                subsysFile => ["", "name of the trusted subsystem file"],
223  TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log");                                                dbLoad => [0, "load the database from generated files"],
224                                                  dbCreate => [0, "drop and re-create the database"],
225                                                  loadOnly => [0, "load the database from previously generated files"]
226                                                },
227                                                "<group1> <group2> ...",
228                                                @ARGV);
229    # If we're doing a load-only, turn on loading.
230    if ($options->{loadOnly}) {
231        $options->{dbLoad} = 1
232    }
233  if ($options->{dbCreate}) {  if ($options->{dbCreate}) {
234      # Here we want to drop and re-create the database.      # Here we want to drop and re-create the database.
235      my $db = $FIG_Config::sproutDB;      my $db = $FIG_Config::sproutDB;
# Line 227  Line 238 
238          my $dbuser = $FIG_Config::dbuser;          my $dbuser = $FIG_Config::dbuser;
239          Trace("Dropping old database (failure is okay).") if T(2);          Trace("Dropping old database (failure is okay).") if T(2);
240          system("dropdb -p $dbport -U $dbuser $db");          system("dropdb -p $dbport -U $dbuser $db");
241          Trace("Dropping old database (failure is okay).") if T(2);          Trace("Creating new database.") if T(2);
242          &FIG::run("createdb -p $dbport -U $dbuser $db");          &FIG::run("createdb -p $dbport -U $dbuser $db");
243      } elsif ($FIG_Config::dbms eq "mysql") {      } elsif ($FIG_Config::dbms eq "mysql") {
244          Trace("Dropping old database (failure is okay).") if T(2);          Trace("Dropping old database (failure is okay).") if T(2);
245          system("mysqladmin -u $FIG_Config::dbuser -p drop $db");          system("mysqladmin -u $FIG_Config::dbuser -p drop $db");
246          &FIG::run("mysqladmin -u $FIG_Config::dbuser -p create $db");          &FIG::run("mysqladmin -u $FIG_Config::dbuser -p create $db");
247          Trace("Dropping old database (failure is okay).") if T(2);          Trace("Creating new database.") if T(2);
248      }      }
   
249  }  }
250  # Create the sprout loader object. Note that the Sprout object does not  # Create the sprout loader object. Note that the Sprout object does not
251  # 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.18

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3