NAME

Bio::ToolBox::db_helper::wiggle

DESCRIPTION

This module provides support for legacy binary wiggle (.wib) files. These are not BigWig files, which are supported through the Bio::ToolBox::Data::db_helper::bigwig module. Rather, these are condensed binary representations of text wiggle files developed for use with the GBrowse browser. Use the modern BigWig adapter for improved and more efficient access.

USAGE

The module requires Bio::Perl and Bio::Graphics to be installed.

In general, this module should not be used directly. Use the methods available in Bio::ToolBox::db_helper or <Bio::ToolBox::Data>.

All subroutines are exported by default.

collect_wig_scores

This subroutine will collect dataset scores from a binary wig file (.wib).

The subroutine is passed a parameter array reference. See below for details.

The subroutine returns an array or array reference of the requested dataset values found within the region of interest.

collect_wig_position_scores

This subroutine will collect the score values from a binary wig file for the specified database region keyed by position.

The subroutine is passed a parameter array reference. See "Data Collection Parameters Reference" below for details.

The subroutine returns a hash or hash reference of the requested dataset values found within the region of interest keyed by position. Note that only one value is returned per position, regardless of the number of dataset features passed.

Binary wiggle files

Binary wiggle files (.wib) files are referenced via a SeqFeature object. These features are typically stored from a Bio::DB::SeqFeature::Store database. A single feature representing the dataset is present across each chromosome. The feature should contain an attribute wigfile that references the location of the binary file representing the dataset scores. The file is opened and the values extracted from the region of interest.

For loading wig files into a Bio::DB::SeqFeature::Store database, see the perl script 'wiggle2gff3.pl' included with the Bio::Graphics distribution, as well as Bio::Graphics::Wiggle::Loader.

To speed up the program and avoid repetitive opening and closing of the files, the opened wig file object is stored in a global hash in case it is needed again.

Data Collection Parameters Reference

The data collection subroutines are passed an array reference of parameters. The recommended method for data collection is to use the "get_segment_score" in Bio::ToolBox::db_helper method.

The parameters array reference includes these items:

1. chromosome
2. start coordinate
3. stop coordinate

Coordinates are in BioPerl-style 1-base system.

4. strand

Should be standard BioPerl representation: -1, 0, or 1.

5. strandedness

A scalar value representing the desired strandedness of the data to be collected. Acceptable values include "sense", "antisense", or "all". Only those scores which match the indicated strandedness are collected.

6. score method

Acceptable values include score and count.

   * score returns the basepair coverage of alignments over the 
   region of interest
   
   * count returns the number of alignments that overlap the 
   search region. 
7. A database object.

Not used here.

8. Database features.

These are the SeqFeature objects that contain the file path to the binary wig files. Provide the type or primary_tag.

SEE ALSO

Bio::ToolBox::Data::Feature, Bio::ToolBox::db_helper, Bio::Graphics, Bio::DB::SeqFeature::Store

AUTHOR

 Timothy J. Parnell, PhD
 Howard Hughes Medical Institute
 Dept of Oncological Sciences
 Huntsman Cancer Institute
 University of Utah
 Salt Lake City, UT, 84112

This package is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.