Lincoln D. Stein > GBrowse-2.55 > Bio::Graphics::Browser2::DataSource

Download:
GBrowse-2.55.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  5
Open  1
View/Report Bugs
Source  

SYNOPSIS ^

DESCRIPTION ^

METHODS

userdata()

  $path = $source->userdata(@path_components)

  Returns a path to somewhere in the tmp file system for the 
  indicated userdata.

global_setting()

  $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.

$section_setting = $data_source->section_setting($section_name)

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

 instructions
 search
 overview
 details
 tracks
 display
 upload_tracks

add_scale_tracks()

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.

$dsn->clear_cache

Empty out our cache of database settings and fetch anew from config file

generate_image

  ($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.

$source->add_dbid_to_feature($feature,$dbid_hashref)

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:

 [stanzaLabel1]
 data source = FlyBase

 [stanzaLabel2]
 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:

 [stanzaLabel]
 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.

$boolean = $source->use_inline_imagemap($label=>$length)

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

syntax highlighting: