Bio::D...::mysql(3pm)
π Bio::D...::mysql π
okay bestie, so this is the manpage for Bio::D...::mysql(3pm) β a Bio::DB::GFF::Adaptor::dbi::mysql situation, and honestly? it's giving database adaptor for a specific mysql schema. we love a niche icon. πΈ
β¨ NAME β¨
Bio::DB::GFF::Adaptor::dbi::mysql β it's a Database adaptor for a specific mysql schema. periodt. π
π SYNOPSIS π
go look at Bio::DB::GFF, babe. that's the whole vibe.
π¦ DESCRIPTION π¦
so this adaptor is out here implementing a whole specific mysql database schema that plays nice with Bio::DB::GFF. it inherits from Bio::DB::GFF::Adaptor::dbi, which itself inherits from Bio::DB::GFF β it's a whole family tree, iykyk. π
the schema uses several tables, and we're gonna meet every single one:
π fdata
this is THE feature data table. its columns are:
fidβ feature ID (integer)frefβ reference sequence name (string)fstartβ start position relative to reference (integer)fstopβ stop position relative to reference (integer)ftypeidβ feature type ID (integer)fscoreβ feature score (float); may be nullfstrandβ strand; one of"+"or"-"; may be nullfphaseβ phase; one of0,1or2; may be nullgidβ group ID (integer)ftarget_startβ for similarity features, the target start position (integer)ftarget_stopβ for similarity features, the target stop position (integer)
ngl it would be desirable to normalize the reference sequence name, since usually there are like, so many features sharing the same reference feature. BUT. in the current schema, query performance suffers dramatically when this additional join gets added. so we don't. tragic but true. π
π fgroup
this is the group table. one row per group, no exceptions. columns:
gidβ the group ID (integer)gclassβ the class of the group (string)gnameβ the name of the group (string)
the group table is doing the absolute most, serving multiple purposes. as you might expect, it clusters features that logically belong together β like the multiple exons of the same transcript, cute. it's also used to assign a name and class to a singleton feature. and finally, the group table is used to identify the target of a similarity hit. all of which is consistent with the way the group field is used in the GFF version 2 format. multi-talented fr fr. π
the fgroup.gid field joins with the fdata.gid field.
examples:
mysql> select * from fgroup where gname='sjj_2L52.1';
+-------+-------------+------------+
| gid | gclass | gname |
+-------+-------------+------------+
| 69736 | PCR_product | sjj_2L52.1 |
+-------+-------------+------------+
1 row in set (0.70 sec)
mysql> select fref,fstart,fstop from fdata,fgroup
where gclass='PCR_product' and gname = 'sjj_2L52.1'
and fdata.gid=fgroup.gid;
+---------------+--------+-------+
| fref | fstart | fstop |
+---------------+--------+-------+
| CHROMOSOME_II | 1586 | 2355 |
+---------------+--------+-------+
1 row in set (0.03 sec)
π ftype
this table holds the feature types, one per row. columns are:
ftypeidβ the feature type ID (integer)fmethodβ the feature type method name (string)fsourceβ the feature type source name (string)
the ftype.ftypeid field joins with the fdata.ftypeid field. example:
mysql> select fref,fstart,fstop,fmethod,fsource from fdata,fgroup,ftype
where gclass='PCR_product'
and gname = 'sjj_2L52.1'
and fdata.gid=fgroup.gid
and fdata.ftypeid=ftype.ftypeid;
+---------------+--------+-------+-------------+-----------+
| fref | fstart | fstop | fmethod | fsource |
+---------------+--------+-------+-------------+-----------+
| CHROMOSOME_II | 1586 | 2355 | PCR_product | GenePairs |
+---------------+--------+-------+-------------+-----------+
1 row in set (0.08 sec)
π fdna
this table holds the raw DNA of the reference sequences. three columns, that's it:
frefβ reference sequence name (string)foffsetβ offset of this sequencefdnaβ the DNA sequence (longblob)
to overcome problems loading large blobs, DNA is automatically fragmented into multiple segments when loading, and the position of each segment is stored in foffset. the fragment size is controlled by the -clump_size argument during initialization. slay, automated. β¨
π fattribute_to_feature
this table holds "attributes", which are tag/value pairs stuffed into the GFF line. the first tag/value pair is treated as the group, and anything else is treated as an attribute (weird, huh?). π
CHR_I assembly_tag Finished 2032 2036 . + . Note "Right: cTel33B"
CHR_I assembly_tag Polymorphism 668 668 . + . Note "A->C in cTel33B"
the columns of this table are:
fidβ feature ID (integer)fattribute_idβ ID of the attribute (integer)fattribute_valueβ text of the attribute (text)
the fdata.fid column joins with fattribute_to_feature.fid.
π fattribute
this table holds the normalized names of the attributes. fields are:
fattribute_idβ ID of the attribute (integer)fattribute_nameβ Name of the attribute (varchar)
π Data Loading Methods π
on top of implementing the abstract SQL-generating methods of Bio::DB::GFF::Adaptor::dbi, this module also implements the data loading functionality of Bio::DB::GFF. overachiever behavior, honestly. π
β new
- Title: new
- Usage:
$db = Bio::DB::GFF->new(@args) - Function: create a new adaptor
- Returns: a
Bio::DB::GFFobject - Args: see below
- Status: Public
the new constructor is identical to the "dbi" adaptor's new() method, EXCEPT that the prefix dbi:mysql gets added to the database DSN identifier automatically if it's not already there. it's literally doing the work for you, bestie.
Argument Description
-------- -----------
-dsn the DBI data source, e.g. 'dbi:mysql:ens0040' or "ens0040"
-user username for authentication
-pass the password for authentication
β get_dna
- Title: get_dna
- Usage:
$string = $db->get_dna($name,$start,$stop,$class) - Function: get DNA string
- Returns: a string
- Args: name, class, start and stop of desired segment
- Status: Public
this method performs the low-level fetch of a DNA substring given its name, class and the desired range. ngl this should probably be moved to the parent class, but here we are. π«Ά
β search_notes
- Title: search_notes
- Usage:
@search_results = $db->search_notes("full text search string",$limit) - Function: Search the notes for a text string, using mysql full-text search
- Returns: array of results
- Args: full text search string, and an optional row limit
- Status: public
this one is a mysql-specific method. given a search string, it performs a full-text search of the notes table and returns an array of results. every row of that returned array is an arrayref containing:
- column 1 β a
Bio::DB::GFF::Featnameobject, suitable for passing tosegment() - column 2 β the text of the note
- column 3 β a relevance score.
β schema
- Title: schema
- Usage:
$schema = $db->schema - Function: return the CREATE script for the schema
- Returns: a list of CREATE statemetns
- Args: none
- Status: protected
this method returns a list containing the various CREATE statements needed to initialize the database tables. (yes, statemetns. the original said it like that and we respect the typo era. π)
β make_classes_query
- Title: make_classes_query
- Usage:
($query,@args) = $db->make_classes_query - Function: return query fragment for generating list of reference classes
- Returns: a query and args
- Args: none
- Status: public
β make_meta_set_query
- Title: make_meta_set_query
- Usage:
$sql = $db->make_meta_set_query - Function: return SQL fragment for setting a meta parameter
- Returns: SQL fragment
- Args: none
- Status: public
by default this does absolutely nothing; meta parameters are not stored or retrieved. it's giving minimal effort and honestly, same. π
β setup_load
- Title: setup_load
- Usage:
$db->setup_load - Function: called before
load_gff_line() - Returns: void
- Args: none
- Status: protected
this method performs schema-specific initialization prior to loading a set of GFF records. it prepares a set of DBI statement handlers to be used in loading the data. prep queen. β¨
β load_gff_line
- Title: load_gff_line
- Usage:
$db->load_gff_line($fields) - Function: called to load one parsed line of GFF
- Returns: true if successfully inserted
- Args: hashref containing GFF fields
- Status: protected
this method is called once per line of the GFF and passed a series of parsed data items that get stored into the hashref $fields. the keys are:
refβ reference sequencesourceβ annotation sourcemethodβ annotation methodstartβ annotation startstopβ annotation stopscoreβ annotation score (may be undef)strandβ annotation strand (may be undef)phaseβ annotation phase (may be undef)group_classβ class of annotation's group (may be undef)group_nameβ ID of annotation's group (may be undef)target_startβ start of target of a similarity hittarget_stopβ stop of target of a similarity hitattributesβ array reference of attributes, each of which is a[tag=>value]array ref
β get_table_id
- Title: get_table_id
- Usage:
$integer = $db->get_table_id($table,@ids) - Function: get the ID of a group or type
- Returns: an integer ID or undef
- Args: none
- Status: private
this internal method is called by load_gff_line to look up the integer ID of an existing feature type or group. the arguments are the name of the table, and two string identifiers. for feature types, the identifiers are the method and source. for groups, the identifiers are group name and class.
this method requires that a statement handler named lookup_$table, have been created previously by setup_load(). it's here to overcome deficiencies in mysql's INSERT syntax. we don't make the rules, we just work around them. π
β get_feature_id
- Title: get_feature_id
- Usage:
$integer = $db->get_feature_id($ref,$start,$stop,$typeid,$groupid) - Function: get the ID of a feature
- Returns: an integer ID or undef
- Args: none
- Status: private
this internal method is called by load_gff_line to look up the integer ID of an existing feature. it is ony needed when replacing a feature with new information. (again with the typos β ony. iconic.) π
π BUGS π
none ;-)
like genuinely. none. the audacity, the confidence. we stan. π₯
πΈ SEE ALSO πΈ
Bio::DB::GFFbioperl
π AUTHOR π
okay so who even MADE this masterpiece?? it's giving legend behaviour, and the icon in question is:
- Lincoln Stein
<lstein@cshl.org>π
Copyright (c) 2002 Cold Spring Harbor Laboratory.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά
bestie that's the whole legal vibe β free software, same terms as Perl itself, no cap. redistribute it, modify it, go off. just don't come for the copyright notice. π
and that's the whole page, we ate and left no crumbs β¨
this one's from perl v5.30.0, dated 2020-01-13, and yeah the name is literally Bio::D...::mysql(3pm) β abbreviated like a text message because even manpage titles gotta be mysterious sometimes π
thanks for reading the whole thing, bestie, you're so real for that ππ§
π¦ where this page comes from
- debian bookworm: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms