TFBS::...JASPAR6(3pm)
πΈ NAME πΈ
okay so, bestie, meet TFBS::DB::JASPAR6 β she's the β¨interfaceβ¨ to a MySQL relational database stuffed full of pattern matrices. Current status: experimental π§ͺ (yes she's still in her beta era, handle with care π
).
π SYNOPSIS π
Here's the whole vibe, one move at a time π«Ά
- making a database object by connecting to a JASPAR6-type database that already exists
my $db = TFBS::DB::JASPAR6->connect("dbi:mysql:JASPAR6:myhost",
"myusername",
"mypassword");
- pulling a
TFBS::Matrix::*object out of 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');
- grabbing a whole set of matrices as a
TFBS::MatrixSetobject, filtered however you want π
# 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");
- spinning up a brand new JASPAR6-type database named
MYJASPAR6β¨
my $db = TFBS::DB::JASPAR4->create("dbi:mysql:MYJASPAR6:myhost",
"myusername",
"mypassword");
- storing a matrix in the database (currently only PFMs get to move in π )
#let $pfm is a TFBS::Matrix::PFM object
$db->store_Matrix($pfm);
π¦ DESCRIPTION π¦
TFBS::DB::JASPAR6 is a read/write database interface module, periodt. She retrieves and stores TFBS::Matrix::* and TFBS::MatrixSet objects in a relational database. The interface is nearly identical to the JASPAR2 and JASPAR4 interface, but the underlying data model? Completely different, no cap. π
π JASPAR6 DATA MODEL π
JASPAR6 is the working name for a relational database model used to store transcriptional factor pattern matrices in a MySQL database. It was originally designed (back in her JASPAR2 days) 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 also stores:
- profile ID (unique π)
- name
- structural class
- basic taxonomic and bibliographic information
- plus 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 JASPAR6 data model:
MISSING TEXT HEER ON HOW IT WORKS
(and yes bestie, the typo is canon, I don't make the rules π)
It is our best intention to hide the details of this data model β the one we're using on a daily basis in our work β from most TFBS users. Most users should only need to know the methods for storing the data and which tags are supported, fr fr. π«Ά
-------------------------------------------------------------------------
π FEEDBACK π
Please send bug reports and other comments to the author. She wants to hear from you π
π AUTHOR - Boris Lenhard π
Boris Lenhard <Boris.Lenhard@cgb.ki.se>
π APPENDIX π
Okay bestie, here's the rest β every single method, explained like we're texting at 2am. Internal methods are the ones with an underscore up front, keep an eye out. π
πΈ new
- Title β
new - Usage β DEPRECATED β kept around for backward compatibility only. Use
connect()orcreate()instead, fr fr. - Args β none listed here, it's just legacy vibes.
It's deprecated, bestie.connect()orcreate()are the moment now. Do not build new things onnew. π
πΈ connect
- Title β
connect - Usage β
my $db =
TFBS::DB::JASPAR6->connect("dbi:mysql:DATABASENAME:HOSTNAME",
"USERNAME",
"PASSWORD");
- Function β hooks you up to an already-existing JASPAR6-type database and hands back a database object that interfaces it. It's giving "I already know a guy." π«Ά
- Returns β a
TFBS::DB::JASPAR6object. - Args β a standard database connection triplet, exactly like this:
("dbi:mysql:DATABASENAME:HOSTNAME", "USERNAME", "PASSWORD"). Swap in your actual values forDATABASENAME,HOSTNAME,USERNAMEandPASSWORD. Heads up:PASSWORDandUSERNAMEmight be optional depending on what access permissions your user has on that 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 that
$dbis interfacing. THIS IS USED FOR WRITING NEW METHODS FOR DIRECT RELATIONAL DATABASE MANIPULATION β so like, if you have write access AND you do not know what you are doing, you can severely corrupt the data. π For documentation about database handle methods, seeDBI. - Returns β the database (DBI) handle of the MySQL JASPAR2-type relational database associated with the
TFBS::DB::JASPAR2object. - Args β none.
Seriously tho. Raw handle, raw power, raw consequences. Know what you're doing before you do() anything. π
πΈ 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 (the docs literally say this is too C-like and may change in future versions β iconic honesty ngl). - Args β
(PFM_object): aTFBS::Matrix::PFM,FBS::Matrix::PWMorFBS::Matrix::ICMobject. PFM objects are the recommended pick since they're easily converted to the other formats. π
# might have to give version and collection here
- 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 the matrix data sitting under the given ID and hands back a
TFBS::Matrix::*object. - Returns β a
TFBS::Matrix::*object; the exact type depends on what form the matrix is stored in within the database (PFM is the default). - Args β
(Matrix_ID). TheMatrix_IDis a string referring to the stable JASPAR ID (usually something like"MA0001"), with or without version numbers."MA0001"gives you the latest version of MA0001, while"MA0001.2"gives you the second version, if it exists. You'll get warnings for matrices that don't exist. β
πΈ 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 and returns a
TFBS::Matrix::*object. - Returns β a
TFBS::Matrix::*object; the exact type depends on what form the matrix object was stored in within the database (defaultPFM). - Args β
(Matrix_name).
Warning: according to the current JASPAR6 data model,nameis not necessarily a unique identifier. Also, names change over time. π© 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 onSTDERR. You've been warned. Some matrices have multiple versions β the function returns the latest one. For specific versions, useget_Matrix_by_ID($ID.$version).
πΈ get_MatrixSet
- Title β
get_MatrixSet - Usage β
my $matrixset = $db->get_MatrixSet(%args);
- Function β fetches matrix data for all matrices in the database matching the criteria defined by the named arguments, and returns a
TFBS::MatrixSetobject. - Returns β a
TFBS::MatrixSetobject. - Args β this method takes named arguments corresponding to arbitrary tags, plus some utility functions. β¨
Notably, this is different from JASPAR2 and to some extent JASPAR4. Since any tag is supported for database storage, any tag can be used for information retrieval. On top of that, arguments like 'name', 'class', 'collection' can be used β even though they aren't tags. π¦
By default, only the last version of the matrix is given. The only ways to get older matrices out of this are to use an array of IDs with actual versions like MA0001.1, or to set the argument -all_versions=>1, in which case you get all versions for each stable ID. π
π Examples include:
πΈ Fundamental matrix features
-allβ gives absolutely all matrix entries, regardless of version 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. Typically something like"MA0001.2". Takes precedence over everything except-all.-nameβ a reference to an array of transcription factor names (string). Will only take the 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 the rest of the criteria, including obsolete ones. Is off per default. Typical usage is in combination with stable IDs without versions, to get all versions of a particular matrix.
πΈ Typical tag queries:
These can be either a string or a reference to an array of strings. If it's an array, it will be interpreted as an "or" 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 isPFM.
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'). π₯
As above, unless IDs with version numbers are used, only one matrix per stable ID will be returned: the matrix with the highest version number. π
The -min_ic filter is applied after the query, in the sense that matrix 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.1');
- Function β deletes the matrix having the given ID from the database. Poof. π
- Returns β
0on success;$@contents on failure (yep, this is too C-like and may change in future versions). - Args β
(ID). A string. Has to be a matrix ID with version suffix in JASPAR6. - Comment β yeah, yeah,
'delete_Matrix_having_ID'is a stupid name for a method, but at least it should be obvious what it does. π
Bestie, that's the whole appendix β every arg, every warning, every "this might break" disclaimer, untouched and slaying. π
Docs by Boris Lenhard, 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