Bio::ToolBox::db_helper::bigbed
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'.
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.
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:
The BioPerl strand values must be used, i.e. -1, 0, or 1.
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.
Acceptable values include score, count, pcount, and length.
score returns the score of each bed element within the region. Make sure the BigBed elements contain a score column. count returns the number of elements that overlap the search region. pcount, or precise count, returns the count of elements that only fall within the region and do not extend beyond the search region. length returns the lengths of all overlapping elements.
Always provide the BigBed path. Opened BigBed file objects are cached. Both local and remote files are supported.
The subroutine returns an array of the defined dataset values found within the region of interest.
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.
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.
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.
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.
To install Bio::ToolBox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::ToolBox
CPAN shell
perl -MCPAN -e shell install Bio::ToolBox
For more information on module installation, please visit the detailed CPAN module installation guide.