Parent Directory
|
Revision Log
Removed obsolete use clauses.
#!/usr/bin/perl -w =head1 Delete Genomes from Sprout This method deletes genomes from the Sprout database. Simply list the genomes as command-line parameters. The currently-supported command-line options are as follows. =over 4 =item showOnly If specified, the DELETE statements will be displayed but no records will be deleted. =item trace Numeric trace level. A higher trace level causes more messages to appear. The default trace level is 2. =item sql If specified, turns on tracing of SQL activity. =item h Display this commands parameters and options. =back =cut use strict; use Tracer; use Cwd; use FIG; use Stats; use Sprout; use SFXlate; use File::Copy; use File::Path; # Get the command-line options. my ($options, @parameters) = StandardSetup(['ERDB', 'Sprout'], { showOnly => [0, 'Display DELETE statements without deleting.'], trace => [2, 'tracing level'], }, '<genome1> <genome2> ...', @ARGV); # Get the Sprout object. my $sprout = SFXlate->new_sprout_only(); # Save the show-only flag. my $showOnly = $options->{showOnly}; # Create the statistics object. my $retVal = Stats->new('genomesFound', 'genomesNotFound'); # Loop through the genome IDs. for my $genomeID (@parameters) { # Find out if the genome is real. if (! $sprout->Exists('Genome', $genomeID)) { # Warn the user. Nothing can get deleted if the genome is not in the Genome # table. Trace("Genome $genomeID not found in the genome table.") if T(1); $retVal->Add('genomesNotFound'); } else { # Here we can delete it. my $stats = $sprout->DeleteGenome($genomeID, $showOnly); # Update the statistics. $retVal->Add('genomesFound'); $retVal->Accumulate($stats); } } # Display the statistcs. Trace($retVal->Show()) if T(0); 1;
MCS Webmaster | ViewVC Help |
Powered by ViewVC 1.0.3 |