Class: Bio::Ucsc::UcscBin

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/ucsc/ucsc_bin.rb

Constant Summary collapse

Version =

Version = "0.1.0" # 20100714 Version = "0.2.0" # 20101028 Version = "0.2.1" # 20110408

"0.2.2"
BINRANGE_MAXEND_512M =

20110418 the licence is changed embeded in BioRubyUcscApi handle the case, start==end in [start, end)

(512*1024*1024)
BIN_OFFSETS_EXTENDED =
[4096+512+64+8+1, 512+64+8+1, 64+8+1, 8+1, 1, 0]
BIN_OFFSETS =
[512+64+8+1, 64+8+1, 8+1, 1, 0]
BIN_OFFSET_OLD_TO_EXTENDED =
4681
BIN_FIRST_SHIFT =

How much to shift to get to finest bin.

17
BIN_NEXT_SHIFT =

How much to shift to get to next larger bin.

3

Class Method Summary collapse

Class Method Details

.bin_all(p_start, p_end) ⇒ Object

Return an Array of BINs which are all bins containing whole the interval/range. Thus, it always contains "0" indicating a bin containing whole of a chromosome.

extended bin index for positions >= 512M is not supported yet Do you need it? Please email me.



60
61
62
63
64
65
66
# File 'lib/bio/ucsc/ucsc_bin.rb', line 60

def self.bin_all(p_start, p_end)
  if p_end <= BINRANGE_MAXEND_512M
    bin_all_standard(p_start, p_end)
  else
    bin_all_extended(p_start, p_end)
  end
end

.bin_from_range(bin_start, bin_end) ⇒ Object Also known as: bin

Return a Integer of a BIN which is the smallest/finest bin containing whole the interval/range.

Extended bin index for positions >= 512M is not supported yet Do you need it? Please email me.



43
44
45
46
47
48
49
# File 'lib/bio/ucsc/ucsc_bin.rb', line 43

def self.bin_from_range(bin_start, bin_end)
  if bin_end <= BINRANGE_MAXEND_512M
    bin_from_range_standard(bin_start, bin_end)
  else
    bin_from_range_extended(bin_start, bin_end)
  end
end