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

Annotation of /Sprout/UpdateSaplingDbd.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 :     # -*- perl -*-
4 :     #
5 :     # Copyright (c) 2003-2011 University of Chicago and Fellowship
6 :     # for Interpretations of Genomes. All Rights Reserved.
7 :     #
8 :     # This file is part of the SEED Toolkit.
9 :     #
10 :     # The SEED Toolkit is free software. You can redistribute
11 :     # it and/or modify it under the terms of the SEED Toolkit
12 :     # Public License.
13 :     #
14 :     # You should have received a copy of the SEED Toolkit Public License
15 :     # along with this program; if not write to the University of Chicago
16 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
17 :     # Genomes at veronika@thefig.info or download a copy from
18 :     # http://www.theseed.org/LICENSE.TXT.
19 :     #
20 :    
21 :     =head1 UpdateSaplingDbd
22 :    
23 :     This script updates the Sapling DBD stored in the database from a DBD stored
24 :     on the hard drive. The single positional parameter is the DBD file name.
25 :    
26 :     The currently-supported command-line options are as follows.
27 :    
28 :     =over 4
29 :    
30 :     =item user
31 :    
32 :     Name suffix to be used for log files. If omitted, the PID is used.
33 :    
34 :     =item trace
35 :    
36 :     Numeric trace level. A higher trace level causes more messages to appear. The
37 :     default trace level is 2. Tracing will be directly to the standard output
38 :     as well as to a C<trace>I<User>C<.log> file in the FIG temporary directory,
39 :     where I<User> is the value of the B<user> option above.
40 :    
41 :     =item sql
42 :    
43 :     If specified, turns on tracing of SQL activity.
44 :    
45 :     =item background
46 :    
47 :     Save the standard and error output to files. The files will be created
48 :     in the FIG temporary directory and will be named C<err>I<User>C<.log> and
49 :     C<out>I<User>C<.log>, respectively, where I<User> is the value of the
50 :     B<user> option above.
51 :    
52 :     =item h
53 :    
54 :     Display this command's parameters and options.
55 :    
56 :     =item dbname
57 :    
58 :     Name of the Sapling database to use. This option is generally only useful for debugging.
59 :    
60 :     =item dbhost
61 :    
62 :     SQL host for the Sapling database to use. This option is generally only useful for debugging.
63 :    
64 :     =item dbport
65 :    
66 :     Database port to use for the Sapling database. This option is generally only useful for debugging.
67 :    
68 :    
69 :     =back
70 :    
71 :     =cut
72 :    
73 :     use strict;
74 :     use Tracer;
75 :     use Sapling;
76 :    
77 :     # Parse the command line.
78 :     my ($options, @parameters) = StandardSetup([qw(ERDB Sapling)],
79 :     {dbname => [$FIG_Config::saplingDB, "name of the Sapling database to use"],
80 :     dbhost => ["", "host containing the Sapling database"],
81 :     dbport => ["", "port for connecting to the Sapling database"],
82 :     },
83 :     "<DBDfile>", @ARGV);
84 :     # Get the DBD file name.
85 :     my $dbdFile = $parameters[0];
86 :     Trace("DBD file is $dbdFile.") if T(2);
87 :     # Get the Sapling database.
88 :     my $sap = Sapling->new(DBD => $dbdFile, dbName => $options->{dbname},
89 :     dbhost => $options->{dbhost}, port => $options->{dbport});
90 :     # Store the DBD internally.
91 :     $sap->InternalizeDBD();
92 :     Trace("DBD update complete.") if T(2);

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3