NAME

Bio::ToolBox::db_helper::bigbed

DESCRIPTION

This module supports the use of bigBed file in the biotoolbox scripts. It is used to collect the dataset scores from a binary bigBed file (.bb). The file may be local or remote.

Scores may be restricted to strand by specifying the desired strandedness. For example, to collect transcription data over a gene, pass the strandedness value 'sense'. If the strand of the region database object (representing the gene) matches the strand of the bed feature, then the data for that bed feature is collected.

For loading bigbed files into a Bio::DB database, see the biotoolbox perl script 'big_filegff3.pl'.

USAGE

The module requires Lincoln Stein's Bio::DB::BigBed to be installed.

Load the module at the beginning of your program.

use Bio::ToolBox::db_helper::bigbed;

It will automatically export the name of the subroutines.

collect_bigbed_scores

This subroutine will collect only the data values from a binary bigbed file for the specified database region. The positional information of the scores is not retained, and the values are best further processed through some statistical method (mean, median, etc.).

The subroutine is passed seven or more arguments in the following order:

1) The chromosome or seq_id
2) The start position of the segment to collect 
3) The stop or end position of the segment to collect 
4) The strand of the original feature (or region), -1, 0, or 1.
5) 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) The method or type of data collected. 
   Acceptable values include 'score' (returns the bed feature 
   score), 'count' (returns the number of bed features found), or 
   'length' (returns the length of the bed features found).  
7) The paths, either local or remote, to one or more BigBed files.

The subroutine returns an array of the defined dataset values found within the region of interest.

collect_bigbed_position_scores

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

The subroutine is passed the same arguments as collect_bigbed_scores().

The subroutine returns a hash of the defined dataset values found within the region of interest keyed by position. The feature midpoint is used as the key position. When multiple features are found at the same position, a simple mean (for score or length data methods) or sum (for count methods) is returned.

open_bigbed_db()

This subroutine will open a BigBed database connection. Pass either the local path to a bigBed file (.bb extension) or the URL of a remote bigBed file. It will return the opened database object.

The opened BigBed object is cached for later use. If you do not want this (for example, when forking), pass a second true argument.

sum_total_bigbed_features()

This subroutine will sum the total number of bed features present in a BigBed file. This may be useful, for example, in calculating fragments (reads) per million mapped values when the bigbed file represents sequence alignments.

Pass either the name of a bigBed file (.bb), either local or remote, or an opened BigBed database object. A scalar value of the total number of features is returned.

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 GPL (either version 1, or at your option, any later version) or the Artistic License 2.0.