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

View of /Sprout/SaplingXLoader.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Mon Feb 11 02:06:57 2013 UTC (6 years, 6 months ago) by parrello
Branch: MAIN
CVS Tags: rast_rel_2014_0729, rast_rel_2014_0912, HEAD
New script for updating expression data.

#!/usr/bin/perl -w

=head1 Sapling Incremental Load Script for Expression Data

This script loads a single genome's expression data into the Sapling.
The two positional parameters are the ID of the genome and the
name of the directory containing the data.

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 host

Alternate database host, if the database is located somewhere other than the
default. This is necessary on some Sapling machines to insure we get a writable
copy of the database.

=back

=cut

use strict;
use Tracer;
use Sapling;
use SaplingDataLoader;
use Stats;

use SaplingExpressionLoader;

# Get the command-line options and parameters.
my ($options, @parameters) = StandardSetup([qw(SaplingDataLoader) ],
                                           { host => ["", "alternate database host machine"] },
                                           "<genomeID> <inDirectory>",
                                           @ARGV);
# Create the statistics object.
my $stats = Stats->new();
# Insure we catch errors.
eval {
    # Get the Sapling database.
    my $sap = Sapling->new(dbhost => $options->{host});
    # Compute the input file. If no file name is specified, we use "-", which translates to
    # STDIN.
    my ($genomeID, $inDirectory) = @parameters;
    Trace("Loading expression data for $genomeID from $inDirectory.") if T(2);
    $stats = SaplingExpressionLoader::Process($sap, $genomeID, $inDirectory);
    Trace("Processing complete.") if T(2);
};
Trace("Statistics for this run: " . $stats->Show()) if T(2);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3