Bio::DB::GFF::Util
Binning
Toolbar
Summary
Bio::DB::GFF::Util::Binning - binning utility for Bio::DB::GFF index
Package variables
No package variables defined.
Inherit
Exporter
Synopsis
use Bio::DB::GFF::Util::Binning qw(bin bin_bot bin_top);
my $tier = bin($start,$stop,$min);
Description
This is a utility module that exports the functions bin(), bin_bot()
and bin_top(). These functions translate a range on the genome into a
named bin that is used as an index in the Bio::DB::GFF schema. The
index makes certain range retrieval queries much faster.
Methods
bin | No description | Code |
bin_bot | No description | Code |
bin_name | No description | Code |
log10 | No description | Code |
Methods description
None available.
Methods code
sub bin
{ my ($start,$stop,$min) = @_;
my $tier = $min;
my ($bin_start,$bin_end);
while (1) {
$bin_start = int $start/$tier; $bin_end = int $stop/$tier; last if $bin_start == $bin_end;
$tier *= 10;
}
return wantarray ? ($tier,$bin_start) : bin_name($tier,$bin_start); } |
sub bin_bot
{ my $tier = shift;
my $pos = shift;
bin_name($tier,int($pos/$tier));
} |
sub bin_name
{ sprintf("%d.%06d",@_) } |
sub log10
{ my $i = shift;
log($i)/log(10); }
1; } |
General documentation
The remainder of the document describes the function calls. No calls
are exported by default, but must be imported explicitly.
None known yet.
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2001 Cold Spring Harbor Laboratory.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.