[Bio] / Sprout / Sapling.pm Repository:
ViewVC logotype

Diff of /Sprout/Sapling.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.34, Fri Nov 5 16:51:17 2010 UTC revision 1.35, Tue Dec 14 19:48:38 2010 UTC
# Line 181  Line 181 
181    
182  =item port  =item port
183    
184  MYSQL port number to use.  MYSQL port number to use (MySQL only).
185    
186    =item dbms
187    
188    Database management system to use (e.g. C<SQLite> or C<postgres>, default C<mysql>).
189    
190  =back  =back
191    
# Line 198  Line 202 
202      my $userData = $options{userData} || "seed/";      my $userData = $options{userData} || "seed/";
203      my $dbhost = $options{dbhost} || $FIG_Config::saplingHost || "localhost";      my $dbhost = $options{dbhost} || $FIG_Config::saplingHost || "localhost";
204      my $port = $options{port} || 3306;      my $port = $options{port} || 3306;
205        my $dbms = $options{dbms} || 'mysql';
206      # Compute the socket. An empty string is a valid override here.      # Compute the socket. An empty string is a valid override here.
207      my $sock = $options{sock};      my $sock = $options{sock};
208      if (! defined $sock) {      if (! defined $sock) {
# Line 208  Line 213 
213      $pass = "" if ! defined $pass;      $pass = "" if ! defined $pass;
214      Trace("Connecting to sapling database.") if T(2);      Trace("Connecting to sapling database.") if T(2);
215      # Connect to the database.      # Connect to the database.
216      my $dbh = DBKernel->new('mysql', $dbName, $user, $pass, $port, $dbhost, $sock);      my $dbh = DBKernel->new($dbms, $dbName, $user, $pass, $port, $dbhost, $sock);
217      # Create the ERDB object.      # Create the ERDB object.
218      my $retVal = ERDB::new($class, $dbh, $dbd, %options);      my $retVal = ERDB::new($class, $dbh, $dbd, %options);
219      # Add the load directory pointer.      # Add the load directory pointer.
# Line 1259  Line 1264 
1264      return ($name eq GLOBAL);      return ($name eq GLOBAL);
1265  }  }
1266    
1267    =head3 LoadGenome
1268    
1269        my $stats = $sap->LoadGenome($genome, $directory);
1270    
1271    Load the specified genome directory into the database. The genome's DNA, features,
1272    protein sequences, and other supporting information will be inserted. If the
1273    genome already exists, numerous errors will occur; therefore, it is recommended
1274    that the genome be deleted first using the L<ERDB/Delete> method.
1275    
1276    =over 4
1277    
1278    =item genom
1279    
1280    The ID of the genome being loaded.
1281    
1282    =item directory
1283    
1284    Name of the genome directory.
1285    
1286    =item RETURN
1287    
1288    Returns a statistics object describing the load activity.
1289    
1290    =back
1291    
1292    =cut
1293    
1294    sub LoadGenome {
1295        # Get the parameters.
1296        my ($self, $genome, $directory) = @_;
1297        # Verify that the directory exists.
1298        Confess ("Genome directory $directory not found.") if ! -d $directory;
1299        # Verify that the ID is valid.
1300        Confess("Invalid genome ID $genome.") if $genome !~ /^\d+\.\d+$/;
1301        # Import the loader and call it.
1302        require SaplingGenomeLoader;
1303        my $retVal = SaplingGenomeLoader::Load($self, $genome, $directory);
1304        # Return the statistics object.
1305        return $retVal;
1306    }
1307    
1308  =head2 Special-Purpose Methods  =head2 Special-Purpose Methods
1309    
1310  =head3 ComputeFeatureFilter  =head3 ComputeFeatureFilter

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3