DOKK / manpages / debian 12 / gbrowse / Bio::Graphics::Browser2::DataSource.3pm.en
Bio::Graphics::Browser2::DataSource(3pm) User Contributed Perl Documentation Bio::Graphics::Browser2::DataSource(3pm)

Bio::Graphics::Browser2::DataSource -- DataSource to access data


  $path = $source->userdata(@path_components)
  Returns a path to somewhere in the tmp file system for the 
  indicated userdata.


  $setting = $source->global_setting('option')

Like code_setting() except that it is only for 'general' options. If the option is not found in the datasource config file, then looks in the global file.

Returns "open" "closed" or "off" for the named section. Named sections are:



This is called at initialization time to add track configs for the automatic "scale" (arrow) tracks for details, overview and regionview

$db = $dsn->databases
Return all named databases from [name:database] tracks.
($adaptor,@argv) = $dsn->db2args('databasename')
Given a database named by ['databasename':database], return its adaptor and arguments.
($dbid,$adaptor,@argv) = $dsn->db_settings('track_label')
Return the adaptor and arguments suitable for the database identified by the given track label. If no track label is given then the "general" default database is used.
$db = $dsn->open_database('track')
Return the database handle specified by the given track label or 'general' if not given. The databases are cached and so it is ok to call repeatedly.
@ids = $dsn->db2id($db)
$dbid = $dsn->db2id($db)
Given a database handle, return all dbids that correspond to that database. In a scalar context, returns just the first dbid that uses it. It is less confusing to call in a scalar context.
@ids = $dsn->dbs
Return the names of all the sections that define dbs in the datasource: both track sections that define dbargs and named database sections. Note that we do not uniquify the case in which the same adaptor and dbargs are defined twice in two different sections.
Empty out our cache of database settings and fetch anew from config file

  ($url,$path) = generate_image($gd);

Given a GD::Image object, this method calls its png() or gif() methods (depending on GD version), stores the output into the temporary "images" subdirectory of the directory given by the "tmp_base" option in the configuration file. It returns a two element list consisting of the URL to the image and the physical path of the image.

This adds a new method called gbrowse_dbid() to a feature. Do not call it if the method is already in the feature's class. The hashref should be populated by feature memory locations (overload::StrVal($feature)) as keys and database symbolic IDs as values.

@labels = $source->data_source_to_label(@data_sources)

Search through all stanzas for those with a matching "data source" option. Data sources look like this:

 data source = FlyBase
 data source = FlyBase

Now searching for $source->data_source_to_label('FlyBase') will return "stanzaLabel1" and "stanzaLabel2" along with others that match. A track may have several data sources, separated by spaces.

@labels = $source->track_source_to_label(@track_sources)

Search through all stanzas for those with a matching "track source" option. Track sources look like this:

 track source = UCSC EBI NCBI

Now searching for $source->track_source_to_label('UCSC','EBI') will return "stanzaLabel" along with others that match. A track may have several space-delimited track sources.

Given a track label and length (for semantic zooming) return true if we should generate an inline clickable imagemap vs one in which the actions are generated by Ajax callbacks

2022-09-30 perl v5.34.0