Bio::G...aSource(3pm)
π NAME π
Bio::Graphics::Browser2::DataSource β a DataSource whose whole job is accessing data. That's it, that's the mission statement bestie. π
This page is from the User Contributed Perl Documentation set, and the page title you'd see at the top is the slightly chopped-off Bio::G...aSource(3pm) β yes, the man page really does abbreviate itself like that, iconic honestly.
πΈ SYNOPSIS πΈ
okay so. there is literally nothing here. The SYNOPSIS section is empty. No synopsis. Zero. Nada. She said "figure it out." π«Ά
π¦ DESCRIPTION π¦
and the DESCRIPTION is empty too!! Straight into the methods, no small talk, no warm-up, just get to work. We respect the efficiency fr fr. β¨
π METHODS π
$path = $source->userdata(@path_components)β hands you back a path to somewhere in the tmp file system for the userdata you asked for. That's the entire plot. πΈglobal_setting()β you call it like$setting = $source->global_setting('option'). It works likecode_setting()except it's only for'general'options. If the option isn't chilling in the datasource config file, it goes and checks the global file instead. Backup bestie behaviour. π«Ά$section_setting = $data_source->section_setting($section_name)β returns"open","closed"or"off"for the section you named. The named sections are:instructionssearchoverviewdetailstracksdisplayupload_tracks
add_scale_tracks()β this one gets called at initialization time to add track configs for the automatic"scale"(arrow) tracks for details, overview and regionview. Little arrows, big responsibility. β$db = $dsn->databasesβ returns all the named databases from[name:database]tracks.($adaptor,@argv) = $dsn->db2args('databasename')β give it a database named by['databasename':database]and it gives you back its adaptor and arguments. Simple trade. π€($dbid,$adaptor,@argv) = $dsn->db_settings('track_label')β returns the adaptor and arguments that suit the database identified by the track label you passed. If you don't pass a track label at all, it falls back to the"general"default database. No label? No problem. π$db = $dsn->open_database('track')β returns the database handle specified by the given track label, or'general'if you didn't give one. The databases are cached, so calling this over and over is completely fine β she will not get tired of you. π@ids = $dsn->db2id($db)$dbid = $dsn->db2id($db)β given a database handle, returns all the dbids that correspond to that database. In a scalar context it returns just the first dbid that uses it. Ngl it's less confusing to call this one in a scalar context. π@ids = $dsn->dbsβ returns the names of all the sections that define dbs in the datasource: both track sections that define dbargs and named database sections. Heads up though β it does not uniquify the case where the same adaptor and dbargs are defined twice in two different sections. So if you did that, that's on you bestie. π$dsn->clear_cacheβ empties out the cache of database settings and fetches everything anew from the config file. Fresh start energy. πgenerate_imageβ signature goes like this:
($url,$path) = generate_image($gd);
Given a GD::Image object, this method calls its png() or gif() methods (whichever one, depends on your GD version), stores the output into the temporary "images" subdirectory of the directory given by the "tmp_base" option in the configuration file, and returns a two element list: the URL to the image and the physical path of the image. Two for the price of one, we love a bundle. π
$source->add_dbid_to_feature($feature,$dbid_hashref)β this adds a brand new method calledgbrowse_dbid()to a feature. Do not call it if the method is already in the feature's class β that's the rule, respect it. π The hashref should be populated with feature memory locations (overload::StrVal($feature)) as keys, and database symbolic IDs as values.@labels = $source->data_source_to_label(@data_sources)β searches through all the stanzas for ones with a matching"data source"option. Data sources look like this:
[stanzaLabel1]
data source = FlyBase
[stanzaLabel2]
data source = FlyBase
So now if you search $source->data_source_to_label('FlyBase'), you get back "stanzaLabel1" and "stanzaLabel2" along with all the other ones that match. A track can have several data sources, separated by spaces. π¦
@labels = $source->track_source_to_label(@track_sources)β searches through all the stanzas for ones with a matching"track source"option. Track sources look like this:
[stanzaLabel]
track source = UCSC EBI NCBI
So now searching $source->track_source_to_label('UCSC','EBI') returns "stanzaLabel" along with the other ones that match. A track can have several space-delimited track sources. β¨
$boolean = $source->use_inline_imagemap($label=>$length)β give it a track label and a length (for semantic zooming) and it returns true if we should generate an inline clickable imagemap, versus one where the actions are generated by Ajax callbacks. Vibe check: clickable or callback-y. π
and that's the whole page bestie!! no cap, you now know every single method on Bio::Graphics::Browser2::DataSource. go forth and access some data. π
This one shipped with perl v5.40.0, dated 2024-10-20, and yes it's Bio::G...aSource(3pm) from the User Contributed Perl Documentation β mwah, bye, love u, see u at the next man page π«Άπ
π¦ where this page comes from
- ubuntu questing: gbrowse 2.56+dfsg-12build4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms