CompBio::DB - Methods for accessing data stored acording to the CompBio base schema.
use CompBio::DB; my $cbdb = CompBio::DB->new({host => "foo.bar.edu");
my $AR_defs = $cbdb->get_annotation([keys %seqs]);
Example code for parsing the return for a simple print:
my $AR_result = $cbdb->get_aa_seq(\@id_list); foreach my $AR_row (@$AR_result) { next unless @$AR_row; print join("\t",@$AR_row) , "\n"; } # return list
This module and the related database schemas where developed to be used with a MySQL server. Although I would certainly prefer it to be portable, that was not a priority at this time. However, I expect the manual alterations that may be necisary to use this module should be very resonable for someone sufficiently familiar with the new target database server, and I would be happy to collaborate with anyone who wants to work on this!
Most of the methods in this database fetch a type of data from a given id or list of ids. Unless otherwise stated for a specific method, only two arguments are ever used; the id or an array reference to a list of ids, and a hash reference containing any optional arguments. The request will be made against the default database defined when the CompBio::DB object was created, but most methods accept a ``database'' option to use a different database on the same server.
All methods that return query results return a reference to a 2D array. See the documentaion for specific methods for the order of returned fields.
db_help
Call to run perldoc on CompBio::DB. Uses exec to launch perldoc, so should be last ditch effort in place of die, perhaps when caller can't negotiate proper usage and will fail regardless.
Creates the CompBio::DB object. This requires succesfully connecting to the default database. There are no required arguments. Below are the optional parameters. Defaults may be changed by setting them in environment variables, such as COMPBIO_DBUSER, or by altering the defaults in CompBio.conf.
OPTIONS:
Name or IP of the host on which the database server is located. Defaults to localhost. Environment variable is COMPBIO_DB_HOST.
Type of database server to connect to (determines DBI driver). Defaults to mysql. Environment variable is COMPBIO_DB_SERVER.
Name of the database to have handle connected to. Defaults to Key. Environment variable is COMPBIO_DB_DATABASE.
Username to use in connection. Defaults to nobody. Environment variable is COMPBIO_DB_USER.
Password to use in connection. Defaults to empty string. Environment variable is COMPBIO_DB_PASSWORD.
Returns the peptide sequence for the supplied id(s).
OPTIONS:
Specify a specific database to search. Default is the merged table.
Signals that the id(s)
supplied are already unique database keys. This is
preffered when speed is desired.
Combines the suffix with the id supplied in the return, such as a genbank accesion number's version. This argument is ignored when used with ISKEY. Please note that if the id has a suffix which is not used in matching with the require_suffix option, and the id is repeated in the database, you will get only one of the possible results returned with no predictable preference.
Requires the suplied suffix to match as well as the id. The value may be NULL for some ids as appropriate. This option is ignored when option ISKEY is true.
OPTIONS:
OPTIONS:
stub method pod
OPTIONS:
-AXC -n CompBio::DB
All basic optional parameters that effect building the should be defined now, at least as much as possible, so that the stub for new methods can be fairly complete and stable.
Fix case discrepencies between CompBio ID table and actual database names.
How to handle using suffixes, in search and returns.
A seperate README is needed on creating the databases!
Developed at the BioMolecular Engineering Research Center at Boston University under the NHLBI's Programs for Genomic Applications grant.
Copyright Sean Quinlan, Trustees of Boston University 2000-2002.
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Sean Quinlan, seanq@molbio.mgh.harvard.edu
Please email me with any changes you make or suggestions for changes/additions. Latest versions are available through SourceForge http://sourceforge.net/projects/compbio/, or you can get the latest release version on the CPAN http://www.cpan.org/authors/id/S/SE/SEANQ/. Thank you!
perl(1), CompBio.