NAME
TFBS::DB::JASPAR5 - interface to MySQL relational database of pattern matrices. Currently status: experimental.
SYNOPSIS
- •
-
creating a database object by connecting to the existing JASPAR5-type database
my $db = TFBS::DB::JASPAR5->connect("dbi:mysql:JASPAR5:myhost","myusername","mypassword");
- •
-
retrieving a TFBS::Matrix::* object from the database
# retrieving a PFM by IDmy $pfm = $db->get_Matrix_by_ID('M0079','PFM');#retrieving a PWM by namemy $pwm = $db->get_Matrix_by_name('NF-kappaB', 'PWM');
- •
-
retrieving a set of matrices as a TFBS::MatrixSet object according to various criteria
# retrieving a set of PWMs from a list of IDs:my @IDlist = ('M0019', 'M0045', 'M0073', 'M0101');my $matrixset = $db->get_MatrixSet(-IDs => \@IDlist,-matrixtype => "PWM");# retrieving a set of ICMs from a list of names:@namelist = ('p50', 'p53', 'HNF-1'. 'GATA-1', 'GATA-2', 'GATA-3');my $matrixset = $db->get_MatrixSet(-names => \@namelist,-matrixtype => "ICM");
- •
-
creating a new JASPAR5-type database named MYJASPAR5:
my $db = TFBS::DB::JASPAR4->create("dbi:mysql:MYJASPAR5:myhost","myusername","mypassword");
- •
-
storing a matrix in the database (currently only PFMs):
#let $pfm is a TFBS::Matrix::PFM object$db->store_Matrix($pfm);
DESCRIPTION
TFBS::DB::JASPAR5 is a read/write database interface module that retrieves and stores TFBS::Matrix::* and TFBS::MatrixSet objects in a relational database. The interface is nearly identical to the JASPAR2 and JASPAR4 interface, while the underlying data model is different
JASPAR5 DATA MODEL
JASPAR5 is working name for a relational database model used for storing transcriptional factor pattern matrices in a MySQL database. It was initially designed (JASPAR2) to store matrices for the JASPAR database of high quality eukaryotic transcription factor specificity profiles by Albin Sandelin and Wyeth W. Wasserman. Besides the profile matrix itself, this data model stores profile ID (unique), name, structural class, basic taxonomic and bibliographic information as well as some additional, and custom, tags.
Here goes a moore thorough description on tables and IDs
----------------------- ADVANCED ---------------------------------
For the developers and the curious, here is the JASPAR5 data model:
MISSING TEXT HEER ON HOW IT WORKS
It is our best intention to hide the details of this data model, which we are using on a daily basis in our work, from most TFBS users. Most users should only know the methods to store the data and which tags are supported.
-------------------------------------------------------------------------
FEEDBACK
Please send bug reports and other comments to the author.
AUTHOR - Boris Lenhard
Boris Lenhard <[email protected]>
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are preceded with an underscore.
new
Title : newUsage : DEPRECATED - for backward compatibility onlyUse connect() or create() instead
connect
Title : connectUsage : my $db =TFBS::DB::JASPAR5->connect("dbi:mysql:DATABASENAME:HOSTNAME","USERNAME","PASSWORD");Function: connects to the existing JASPAR5-type database andreturns a database object that interfaces the databaseReturns : a TFBS::DB::JASPAR5 objectArgs : a standard database connection triplet("dbi:mysql:DATABASENAME:HOSTNAME", "USERNAME", "PASSWORD")In place of DATABASENAME, HOSTNAME, USERNAME and PASSWORD,use the actual values. PASSWORD and USERNAME might beoptional, depending on the user's access permissions forthe database server.
dbh
Title : dbhUsage : my $dbh = $db->dbh();$dbh->do("UPDATE matrix_data SET name='ADD1' WHERE NAME='SREBP2'");Function: returns the DBI database handle of the MySQL databaseinterfaced by $db; THIS IS USED FOR WRITING NEW METHODSFOR DIRECT RELATIONAL DATABASE MANIPULATION - if youhave write access AND do not know what you are doing,you can severely corrupt the dataFor documentation about database handle methods, see L<DBI>Returns : the database (DBI) handle of the MySQL JASPAR2-typerelational database associated with the TFBS::DB::JASPAR2objectArgs : none
store_Matrix
Title : store_MatrixUsage : $db->store_Matrix($matrixobject);Function: Stores the contents of a TFBS::Matrix::DB object in the databaseReturns : 0 on success; $@ contents on failure(this is too C-like and may change in future versions)Args : (PFM_object)A TFBS::Matrix::PFM, FBS::Matrix::PWM or FBS::Matrix::ICM object.PFM object are recommended to use, as they are eaily converted toother formats# might have to give version and collection hereComment : this is an experimental method that is not 100% bulletproof;use at your own risk
get_Matrix_by_ID
Title : get_Matrix_by_IDUsage : my $pfm = $db->get_Matrix_by_ID('M00034', 'PFM');Function: fetches matrix data under the given ID from thedatabase and returns a TFBS::Matrix::* objectReturns : a TFBS::Matrix::* object; the exact type of theobject depending on what form the matrix is storedin the database (PFM is default)Args : (Matrix_ID)Matrix_ID id is a string which refers to the stableJASPAR ID (usually something like "MA0001") withor without version numbers. "MA0001" will give thelatest version on MA0001, while "MA0001.2" will givethe second version, if existing. Warnings will begiven for non-existing matrices.
get_Matrix_by_name
Title : get_Matrix_by_nameUsage : my $pfm = $db->get_Matrix_by_name('HNF-1');Function: fetches matrix data under the given name from thedatabase and returns a TFBS::Matrix::* objectReturns : a TFBS::Matrix::* object; the exact type of the objectdepending on what form the matrix object was stored inthe database (default PFM))Args : (Matrix_name)Warning : According to the current JASPAR5 data model, name isnot necessarily a unique identifier. Also, names changeover time.In the case wherethere are several matrices with the same name in thedatabase, the function fetches the first one and printsa warning on STDERR. You've been warned.Some matrices have multiple versions. The function willreturn the latest version. For specific versions, useget_Matrix_by_ID($ID.$version)
get_MatrixSet
Title : get_MatrixSetUsage : my $matrixset = $db->get_MatrixSet(%args);Function: fetches matrix data under for all matrices in the databasematching criteria defined by the named argumentsand returns a TFBS::MatrixSet objectReturns : a TFBS::MatrixSet objectArgs : This method accepts named arguments, corresponding to arbitrary tags, and also some utility functionsNote that this is different from JASPAR2 and to some extent JASPAR4. As any tag is supported fordatabase storage, any tag can be used for information retrieval.Additionally, arguments as 'name','class','collection' can be used (even thoughthey are not tags.Per default, only the last version of the matrix is given. The only way to get older matrices out of thisto use an array of IDs with actual versions like MA0001.1, or set the argyment -all_versions=>1, in which case you get all versions for each stable IDExamples include:Fundamental matrix features-all # gives absolutely all matrix entry, regardless of versin and collection. Only useful for backup situations and sanity checks. Takes precedence over everything else-ID # a reference to an array of stable IDs (strings), with or without version, as above. tyically something like "MA0001.2" . Takes precedence over everything salve -all-name # a reference to an array of# transcription factor names (string). Will only take latest version. NOT a preferred way to access since names change over time-collection # a string corresponding to a JASPAR collection. Per default CORE-all_versions # gives all matrix versions that fit with rest of criteria, including obsolete ones.Is off per default.# Typical usage is in combiation with a stable IDs withou versions to get all versinos of a particular matrixTypical tag queries:These can be either a string or a reference to an array of strings. If it is an arrau it will be interpreted as as an "or"s statement-class # a reference to an array of# structural class names (strings)-species # a reference to an array of# NCBI Taxonomy IDs (integers)-taxgroup # a reference to an array of# higher taxonomic categories (string)
Computed features of the matrices
-min_ic # float, minimum total information content
# of the matrix.
-matrixtype #string describing type of matrix to retrieve. If left out, the format
will revert to the database format, which is PFM.
The arguments that expect list references are used in database query formulation: elements within lists are combined with 'OR' operators, and the lists of different types with 'AND'. For example,
my $matrixset = $db->(-class => ['TRP_CLUSTER', 'FORKHEAD'],-species => ['Homo sapiens', 'Mus musculus'],);
gives a set of TFBS::Matrix::PFM objects (given that the matrix models are stored as such)
whose (structural clas is 'TRP_CLUSTER' OR'FORKHEAD') AND (the species they are derived
from is 'Homo sapiens'OR 'Mus musculus').
As above, unless IDs with version numbers are used, only one matrix per stable ID wil be returned: the matrix with the highest version number
The -min_ic filter is applied after the query in the sense that the matrices profiles with total information content less than specified are not included in the set.
delete_Matrix_having_ID
Title : delete_Matrix_having_IDUsage : $db->delete_Matrix_with_ID('M00045.1');Function: Deletes the matrix having the given ID from the databaseReturns : 0 on success; $@ contents on failure(this is too C-ike and may change in future versions)Args : (ID)A string. Has to be a matrix ID with version suffix in JASPAR5.Comment : Yeah, yeah, 'delete_Matrix_having_ID' is a stupid namefor a method, but at least it should be obviuos what it does.