#!/usr/bin/perl -w =head1 Load Sprout Tables Load a group of Sprout tables from the command line. The parameters are the names of the table groups to load. The legal table group names are given below. =over 4 =item Genome Loads B, B, B, B, and B. =item Coupling Loads B, B, B, B, B. =item Feature Loads B, B, B, B, B, B, B. =item Subsystem Loads B, B, B, B, B, B, B, B, B, B. =back There are two command-line options, given below. Note that in the command line, spaces inside parameters should be represented by C<\b>. =over 4 =item geneFile The name of the file containing the genomes and their associated access codes. The file should have one line per genome, each line consisting of the genome ID followed by the access code, separated by a tab. If no file is specified, all complete genomes will be processed and the access code will be 1. =item subsysFile The name of the file containing the trusted subsystems. The file should have one line per trusted subsystem. If no file is specified, all subsystems will be trusted. =item trace Desired tracing level. The default is 3. =back =cut use strict; use Tracer; use DocUtils; use TestUtils; use Cwd; use FIG; use SFXlate; use File::Copy; use File::Path; use SproutLoad; use Stats; # Get the command-line parameters and options. my ($options, @parameters) = Tracer::ParseCommand({ geneFile => "", subsysFile => "", trace => 3 }, @ARGV); # Set up tracing. TSetup("$options->{trace} SproutLoad ERDBLoad ERDB Tracer Load", "+>$FIG_Config::temp/trace.log"); # Create the sprout loader object. my $fig = FIG->new(); my $sprout = SFXlate->new_sprout_only(); my $spl = SproutLoad->new($sprout, $fig, $options->{geneFile}, $options->{subsysFile}); # Process the parameters. for my $group (@parameters) { Trace("Processing load group $group.") if T(2); my $stats; if ($group eq 'Genome') { $spl->LoadGenomeData(); } elsif ($group eq 'Feature') { $spl->LoadFeatureData(); } elsif ($group eq 'Coupling') { $spl->LoadCouplingData(); } elsif ($group eq 'Subsystem') { $spl->LoadSubsystemData(); } elsif ($group eq 'Property') { $spl->LoadPropertyData(); } else { Confess("Invalid group name $group."); } } Trace("Load complete.") if T(2); 1;