Bio::DB::GFF::Util Binning
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::DB::GFF::Util::Binning - binning utility for Bio::DB::GFF index
Package variables
No package variables defined.
Included modules
Bio::Root::Version
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_top
No description
Code
bin_name
No description
Code
log10
No description
Code
Methods description
None available.
Methods code
bindescriptionprevnextTop
sub bin {
  my ($start,$stop,$min) = @_;
  $start = abs($start);  # to allow negative coordinates
$stop = abs($stop); 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);
}
bin_botdescriptionprevnextTop
sub bin_bot {
  my $tier = shift;
  my $pos  = shift;
  bin_name($tier,int(abs($pos)/$tier));
}
bin_topdescriptionprevnextTop
sub bin_top {
  my $tier = shift;
  my $pos  = shift;
  bin_name($tier,int(abs($pos)/$tier));  #  bin_name($tier,int($pos/$tier),+1);
}
bin_namedescriptionprevnextTop
sub bin_name {
  my ($tier, $int, $fudge) = @_;
  my $pos = abs($int) + ($fudge || 0);
  $pos    = 0 if $pos < 0;
  sprintf("%d.%06d",$tier, $pos);
}
log10descriptionprevnextTop
sub log10 {
  my $i = shift;
  log($i)/log(10);
} 1;
}
General documentation
APITop
The remainder of the document describes the function calls. No calls
are exported by default, but must be imported explicitly.
BUGSTop
None known yet.
SEE ALSOTop
Bio::DB::GFF,
AUTHORTop
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.