[Bio] / Sprout / UpdateSaplingDbd.pl Repository:
ViewVC logotype

View of /Sprout/UpdateSaplingDbd.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Sep 21 21:05:15 2011 UTC (7 years, 7 months ago) by parrello
Branch: MAIN
CVS Tags: rast_rel_2014_0912, rast_rel_2014_0729, mgrast_release_3_1_2, rast_rel_2011_0928, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_10262011, HEAD
Changes to support complexes.

#!/usr/bin/perl -w

# -*- perl -*-
#
# Copyright (c) 2003-2011 University of Chicago and Fellowship
# for Interpretations of Genomes. All Rights Reserved.
#
# This file is part of the SEED Toolkit.
#
# The SEED Toolkit is free software. You can redistribute
# it and/or modify it under the terms of the SEED Toolkit
# Public License.
#
# You should have received a copy of the SEED Toolkit Public License
# along with this program; if not write to the University of Chicago
# at info@ci.uchicago.edu or the Fellowship for Interpretation of
# Genomes at veronika@thefig.info or download a copy from
# http://www.theseed.org/LICENSE.TXT.
#

=head1 UpdateSaplingDbd

This script updates the Sapling DBD stored in the database from a DBD stored
on the hard drive. The single positional parameter is the DBD file name.

The currently-supported command-line options are as follows.

=over 4

=item user

Name suffix to be used for log files. If omitted, the PID is used.

=item trace

Numeric trace level. A higher trace level causes more messages to appear. The
default trace level is 2. Tracing will be directly to the standard output
as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,
where I<User> is the value of the B<user> option above.

=item sql

If specified, turns on tracing of SQL activity.

=item background

Save the standard and error output to files. The files will be created
in the FIG temporary directory and will be named C<err>I<User>C<.log> and
C<out>I<User>C<.log>, respectively, where I<User> is the value of the
B<user> option above.

=item h

Display this command's parameters and options.

=item dbname

Name of the Sapling database to use. This option is generally only useful for debugging.

=item dbhost

SQL host for the Sapling database to use. This option is generally only useful for debugging.

=item dbport

Database port to use for the Sapling database. This option is generally only useful for debugging.


=back

=cut

    use strict;
    use Tracer;
    use Sapling;

    # Parse the command line.
    my ($options, @parameters) = StandardSetup([qw(ERDB Sapling)],
        {dbname => [$FIG_Config::saplingDB, "name of the Sapling database to use"],
         dbhost => ["", "host containing the Sapling database"],
         dbport => ["", "port for connecting to the Sapling database"],
        },
        "<DBDfile>", @ARGV);
    # Get the DBD file name.
    my $dbdFile = $parameters[0];
    Trace("DBD file is $dbdFile.") if T(2);
    # Get the Sapling database.
    my $sap = Sapling->new(DBD => $dbdFile, dbName => $options->{dbname},
        dbhost => $options->{dbhost}, port => $options->{dbport});
    # Store the DBD internally.
    $sap->InternalizeDBD();
    Trace("DBD update complete.") if T(2);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3