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

Annotation of /Sprout/SaplingXLoader.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     =head1 Sapling Incremental Load Script for Expression Data
4 :    
5 :     This script loads a single genome's expression data into the Sapling.
6 :     The two positional parameters are the ID of the genome and the
7 :     name of the directory containing the data.
8 :    
9 :     The currently-supported command-line options are as follows.
10 :    
11 :     =over 4
12 :    
13 :     =item user
14 :    
15 :     Name suffix to be used for log files. If omitted, the PID is used.
16 :    
17 :     =item trace
18 :    
19 :     Numeric trace level. A higher trace level causes more messages to appear. The
20 :     default trace level is 2. Tracing will be directly to the standard output
21 :     as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,
22 :     where I<User> is the value of the B<user> option above.
23 :    
24 :     =item sql
25 :    
26 :     If specified, turns on tracing of SQL activity.
27 :    
28 :     =item background
29 :    
30 :     Save the standard and error output to files. The files will be created
31 :     in the FIG temporary directory and will be named C<err>I<User>C<.log> and
32 :     C<out>I<User>C<.log>, respectively, where I<User> is the value of the
33 :     B<user> option above.
34 :    
35 :     =item h
36 :    
37 :     Display this command's parameters and options.
38 :    
39 :     =item host
40 :    
41 :     Alternate database host, if the database is located somewhere other than the
42 :     default. This is necessary on some Sapling machines to insure we get a writable
43 :     copy of the database.
44 :    
45 :     =back
46 :    
47 :     =cut
48 :    
49 :     use strict;
50 :     use Tracer;
51 :     use Sapling;
52 :     use SaplingDataLoader;
53 :     use Stats;
54 :    
55 :     use SaplingExpressionLoader;
56 :    
57 :     # Get the command-line options and parameters.
58 :     my ($options, @parameters) = StandardSetup([qw(SaplingDataLoader) ],
59 :     { host => ["", "alternate database host machine"] },
60 :     "<genomeID> <inDirectory>",
61 :     @ARGV);
62 :     # Create the statistics object.
63 :     my $stats = Stats->new();
64 :     # Insure we catch errors.
65 :     eval {
66 :     # Get the Sapling database.
67 :     my $sap = Sapling->new(dbhost => $options->{host});
68 :     # Compute the input file. If no file name is specified, we use "-", which translates to
69 :     # STDIN.
70 :     my ($genomeID, $inDirectory) = @parameters;
71 :     Trace("Loading expression data for $genomeID from $inDirectory.") if T(2);
72 :     $stats = SaplingExpressionLoader::Process($sap, $genomeID, $inDirectory);
73 :     Trace("Processing complete.") if T(2);
74 :     };
75 :     Trace("Statistics for this run: " . $stats->Show()) if T(2);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3