78 |
=item 1 |
=item 1 |
79 |
|
|
80 |
Type C<LoadSproutTables -dbLoad -dbCreate "*"> and press ENTER. This will create |
Type C<LoadSproutTables -dbLoad -dbCreate "*"> and press ENTER. This will create |
81 |
the C<dtx> files and load them. |
the C<dtx> files and load them. You may be asked for a password. If this is the |
82 |
|
case, simply press ENTER. If that does not work, use the C<dbpass> value specified |
83 |
|
in your C<FIG_Config.pm> file. |
84 |
|
|
85 |
=item 2 |
=item 2 |
86 |
|
|
87 |
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 |
88 |
against the SEED data. |
the Sprout database against the SEED data. |
89 |
|
|
90 |
=item 3 |
=item 3 |
91 |
|
|
186 |
|
|
187 |
Desired tracing level. The default is 3. |
Desired tracing level. The default is 3. |
188 |
|
|
|
=item limitedFeatures |
|
|
|
|
|
Only generate the B<Feature> and B<IsLocatedIn> tables when processing the feature group. |
|
|
|
|
189 |
=item dbLoad |
=item dbLoad |
190 |
|
|
191 |
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. |
195 |
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 |
196 |
dropped. Use the function with caution. |
dropped. Use the function with caution. |
197 |
|
|
198 |
|
=item loadOnly |
199 |
|
|
200 |
|
If TRUE, the database tables will be loaded from existing load files. Load files |
201 |
|
will not be created. This option is useful if you are setting up a copy of Sprout |
202 |
|
and have load files already set up from the original version. |
203 |
|
|
204 |
|
=item primaryOnly |
205 |
|
|
206 |
|
If TRUE, only the group's primary entity will be loaded. |
207 |
|
|
208 |
=back |
=back |
209 |
|
|
210 |
=cut |
=cut |
222 |
use SFXlate; |
use SFXlate; |
223 |
|
|
224 |
# Get the command-line parameters and options. |
# Get the command-line parameters and options. |
225 |
my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "", |
my ($options, @parameters) = StandardSetup(['SproutLoad', 'ERDBLoad', 'Stats', |
226 |
trace => 3, limitedFeatures => 0, |
'ERDB', 'Load', 'Sprout'], |
227 |
dbLoad => 0, dbCreate => 0 }, @ARGV); |
{ geneFile => ["", "name of the genome list file"], |
228 |
# Set up tracing. |
subsysFile => ["", "name of the trusted subsystem file"], |
229 |
TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Stats Tracer Load", "+>$FIG_Config::temp/trace.log"); |
dbLoad => [0, "load the database from generated files"], |
230 |
|
dbCreate => [0, "drop and re-create the database"], |
231 |
|
loadOnly => [0, "load the database from previously generated files"], |
232 |
|
primaryOnly => [0, "only process the group's main entity"] |
233 |
|
}, |
234 |
|
"<group1> <group2> ...", |
235 |
|
@ARGV); |
236 |
|
# If we're doing a load-only, turn on loading. |
237 |
|
if ($options->{loadOnly}) { |
238 |
|
$options->{dbLoad} = 1 |
239 |
|
} |
240 |
if ($options->{dbCreate}) { |
if ($options->{dbCreate}) { |
241 |
# Here we want to drop and re-create the database. |
# Here we want to drop and re-create the database. |
242 |
my $db = $FIG_Config::sproutDB; |
my $db = $FIG_Config::sproutDB; |
243 |
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); |
|
|
} |
|
|
|
|
244 |
} |
} |
245 |
# Create the sprout loader object. Note that the Sprout object does not |
# Create the sprout loader object. Note that the Sprout object does not |
246 |
# open the database unless the "dbLoad" option is turned on. |
# open the database unless the "dbLoad" option is turned on. |