TFBS::...JASPAR4(3pm)
β¨ TFBS::DB::JASPAR4 β¨
okay bestie, this is the manual page for TFBS::DB::JASPAR4, and it lives in the User Contributed Perl Documentation section of perldom. she's a database girlie. let's get into it π«Ά
πΈ NAME πΈ
TFBS::DB::JASPAR4 β interface to MySQL relational database of pattern matrices
π¦ SYNOPSIS π¦
- creating a database object by connecting to the existing JASPAR2-type database
my $db = TFBS::DB::JASPAR4->connect("dbi:mysql:JASPAR4:myhost",
"myusername",
"mypassword");
- retrieving a TFBS::Matrix::* object from the database
# retrieving a PFM by ID
my $pfm = $db->get_Matrix_by_ID('M0079','PFM');
#retrieving a PWM by name
my $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:
my @namelist = ('p50', 'p53', 'HNF-1'. 'GATA-1', 'GATA-2', 'GATA-3');
my $matrixset = $db->get_MatrixSet(-names => \@namelist,
-matrixtype => "ICM");
# retrieving a set of all PFMs in the database
# derived from human genes:
my $matrixset = $db->get_MatrixSet(-species => ['Homo sapiens'],
-matrixtype => "PFM");
- creating a new JASPAR4-type database named MYJASPAR4:
my $db = TFBS::DB::JASPAR4->create("dbi:mysql:MYJASPAR4: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::JASPAR4 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 JASPAR2interface, but the underlying data model is different. so like. same energy, different skeleton π
π JASPAR2 DATA MODEL π
JASPAR4 is a 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, plus some additional opseqdbtional tags. yes, that word is spelled like that in here, no we are not fixing it, it's iconic π
tags that are commonly used in the actual JASPAR database include:
'medline' # PubMed ID
'species' # Species name
'superclass' #Species supergroup, eg 'vertebrate', 'plant' etc
'total_ic' # total information content - redundant, present
# for historical
'type' #experimental nethod
'acc' #accession number for TF protein sequence
'seqdb' #corresponding database name
but any tag is storable and searchable. no gatekeeping here π
π ADVANCED π
for the developers and the curious, here is the JASPAR4 data model:
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. she reads them, fr fr π«Ά
π AUTHOR - Boris Lenhard π
Boris Lenhard <Boris.Lenhard@cgb.ki.se>
β APPENDIX β
the rest of the documentation details each of the object methods. internal methods are preceded with an underscore.
π§ new
- Title : new
- Usage : DEPRECATED β for backward compatibility only. use
connect()orcreate()instead
π§ connect
- Title : connect
- Usage :
my $db =
TFBS::DB::JASPAR4->connect("dbi:mysql:DATABASENAME:HOSTNAME",
"USERNAME",
"PASSWORD");
- Function : connects to the existing JASPAR4-type database and returns a database object that interfaces the database
- Returns : a
TFBS::DB::JASPAR4object - Args : 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 be optional, depending on the user's access permissions for the database server. iykyk π
π§ dbh
- Title : dbh
- Usage :
my $dbh = $db->dbh();
$dbh->do("UPDATE matrix_data SET name='ADD1' WHERE NAME='SREBP2'");
- Function : returns the DBI database handle of the MySQL database interfaced by
$db; THIS IS USED FOR WRITING NEW METHODS FOR DIRECT RELATIONAL DATABASE MANIPULATION β if you have write access AND do not know what you are doing, you can severely corrupt the data. bestie. severely corrupt the data. for documentation about database handle methods, seeL<DBI> - Returns : the database (DBI) handle of the MySQL JASPAR2-type relational database associated with the
TFBS::DB::JASPAR2object - Args : none
π§ store_Matrix
- Title : store_Matrix
- Usage :
$db->store_Matrix($matrixobject); - Function : stores the contents of a
TFBS::Matrix::DBobject in the database - Returns :
0on success;$@contents on failure (this is too C-like and may change in future versions) - Args : (
PFM_object) β aTFBS::Matrix::PFM,FBS::Matrix::PWMorFBS::Matrix::ICMobject. PFM objects are recommended to use, as they are eaily converted to other formats - Comment : this is an experimental method that is not 100% bulletproof; use at your own risk β οΈ
π§ get_Matrix_by_ID
- Title : get_Matrix_by_ID
- Usage :
my $pfm = $db->get_Matrix_by_ID('M00034', 'PFM'); - Function : fetches matrix data under the given ID from the database and returns a
TFBS::Matrix::*object - Returns : a
TFBS::Matrix::*object; the exact type of the object depending on what form the matrix is stored in the database (PFM is default) - Args : (
Matrix_ID) β Matrix_ID is a string;
π§ get_Matrix_by_name
- Title : get_Matrix_by_name
- Usage :
my $pfm = $db->get_Matrix_by_name('HNF-1'); - Function : fetches matrix data under the given name from the database and returns a
TFBS::Matrix::*object - Returns : a
TFBS::Matrix::*object; the exact type of the object depending on what form the matrix object was stored in the database (default PFM)) - Args : (
Matrix_name)
Warning : according to the current JASPAR4 data model, name is not necessarily a unique identifier. in the case where there are several matrices with the same name in the database, the function fetches the first one and prints a warning on STDERR. you've been warned. π
π§ get_MatrixSet
- Title : get_MatrixSet
- Usage :
my $matrixset = $db->get_MatrixSet(%args); - Function : fetches matrix data for all matrices in the database matching criteria defined by the named arguments and returns a
TFBS::MatrixSetobject - Returns : a
TFBS::MatrixSetobject - Args :
this method accepts named arguments, corresponding to arbitrary tags. note that this is different from JASPAR2. as any tag is supported for database storage, any tag can be used for information retrieval. additionally, arguments like name and class can be used (even though they are not tags).
as with the get_Matrix methods, it is important to realize that any matrix format can be stored in the database: the TFBS::MatrixSet might therefore consist of PFMs, ICMs and PWMS, depending on how matrices are stored.
examples include:
-IDβ a reference to an array of IDs (strings)-nameβ a reference to an array of transcription factor names (string)-classβ a reference to an array of structural class names (strings)-speciesβ a reference to an array of Latin species names (strings)-sysgroupβ a reference to an array of higher taxonomic categories (strings)-min_icβ float, minimum total information content of the matrix. IMPORTANT : if retrieved matrices are in PWM format there is no way to measure information content.-matrixtypeβ string describing type of matrix to retrieve. if left out, the format will revert to the database format. note that this option only works if the database format 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 class is 'TRP_CLUSTER' OR 'FORKHEAD') AND (the species they are derived from is 'Homo sapiens' OR 'Mus musculus').
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_ID
- Usage :
$db->delete_Matrix_with_ID('M00045'); - Function : deletes the matrix having the given ID from the database
- Returns :
0on success;$@contents on failure (this is too C-like and may change in future versions) - Args : (
ID) β a string - Comment : yeah, yeah,
'delete_Matrix_having_ID'is a stupid name for a method, but at least it should be obviuos what it does. π
and that's the whole page, bestie β¨ this one shipped as part of perl v5.42.3, dated 2026-08-21 β go forth and query responsibly π π¦
π¦ where this page comes from
- ubuntu stonking: libtfbs-perl 0.7.1+ds-6build1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms