UCSCBin 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +21 -0
- data/README.rdoc +46 -0
- data/Rakefile +51 -0
- data/UCSCBin.gemspec +92 -0
- data/VERSION +1 -0
- data/lib/UCSCBin.rb +144 -0
- data/rdoc/README_rdoc.html +170 -0
- data/rdoc/UCSCBin.html +185 -0
- data/rdoc/UCSCBin/BinRange.html +454 -0
- data/rdoc/UCSCBin/Utils.html +242 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +79 -0
- data/rdoc/js/darkfish.js +116 -0
- data/rdoc/js/jquery.js +32 -0
- data/rdoc/js/quicksearch.js +114 -0
- data/rdoc/js/thickbox-compressed.js +10 -0
- data/rdoc/lib/UCSCBin_rb.html +82 -0
- data/rdoc/rdoc.css +696 -0
- data/sample/refseqgene.rb +35 -0
- data/spec/UCSCBin_BinRange_spec.rb +47 -0
- data/spec/UCSCBin_Utils_spec.rb +49 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +132 -0
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2010 Hiroyuki MISHIMA
|
2
|
+
(missy at be.to / hmishima at nagasaki-u.ac.jp)
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
a copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
= UCSCBin
|
2
|
+
Author:: Hiroyuki Mishima (missy at be.to / hmishima at nagasaki-u.ac.jp)
|
3
|
+
Copyright:: Hiroyuki Mishima, 2010
|
4
|
+
License:: the MIT/X11 license. See the LICENSE file.
|
5
|
+
|
6
|
+
A library for handling BIN index and 0/1-based coordination of
|
7
|
+
UCSC Bioinformatics Genome Browser ( http://genome.ucsc.edu/ )
|
8
|
+
|
9
|
+
Original program in C by Jim Kent, 2002
|
10
|
+
|
11
|
+
See also related materials:
|
12
|
+
* http://genomewiki.ucsc.edu/index.php/Bin_indexing_system,
|
13
|
+
* Kent, et. al. Genome Research 2002.12:996-1006, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC186604/
|
14
|
+
* src/lib/binRange.c in the kent source tree. http://hgdownload.cse.ucsc.edu/admin/jksrc.zip
|
15
|
+
|
16
|
+
== UCSCBin::Util
|
17
|
+
convert between 0-based half-open interval and
|
18
|
+
1-based full-close intervals.
|
19
|
+
|
20
|
+
== UCSCBin::BinRange
|
21
|
+
Calculate Bin number from genomic physical position
|
22
|
+
according to UCSC's Bin Indexing System.
|
23
|
+
note: Extended bin index for positions >= 512M is not supported yet.
|
24
|
+
Do you need it? Please email the author.
|
25
|
+
|
26
|
+
== sample/refseqgene.rb
|
27
|
+
to run the sample (input interval is regular 1-based full-closed cordination)
|
28
|
+
sudo gem install sequel
|
29
|
+
sample/refseqgene.rb chr1:234567-456789
|
30
|
+
|
31
|
+
output:
|
32
|
+
chr1:234567-345678 LOC100133331; LOC100132287; LOC100132062
|
33
|
+
|
34
|
+
== Note on Patches/Pull Requests
|
35
|
+
* github repository is git://github.com/misshie/UCSCBin.git
|
36
|
+
* Fork the project.
|
37
|
+
* Make your feature addition or bug fix.
|
38
|
+
* Add tests for it. This is important so I don't break it in a
|
39
|
+
future version unintentionally.
|
40
|
+
* Commit, do not mess with rakefile, version, or history.
|
41
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
42
|
+
* Send me a pull request. Bonus points for topic branches.
|
43
|
+
|
44
|
+
== Copyright
|
45
|
+
|
46
|
+
Copyright (c) 2010 Hiroyuki MISHIMA. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "UCSCBin"
|
8
|
+
gem.summary =
|
9
|
+
%Q{Calculate BIN indexes on UCSC Bioinformatics's Genome Browser}
|
10
|
+
gem.description =
|
11
|
+
%Q{Utilities for UCSC Bioinfomatics's Genome Browser
|
12
|
+
( http://g enome.ucsc.edu ) including calculation of a BIN index
|
13
|
+
from a genomic interval to speed-up SQL queries, and conversion
|
14
|
+
between 1-based full-closed (for humans) and 0-based half-open
|
15
|
+
(for machienes) intervals}
|
16
|
+
gem.email = "missy@be.to"
|
17
|
+
gem.homepage = "http://github.com/misshie/UCSCBin"
|
18
|
+
gem.authors = ["Hiroyuki MISHIMA"]
|
19
|
+
gem.add_development_dependency "rspec", ">= 1.2.9"
|
20
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
21
|
+
end
|
22
|
+
Jeweler::GemcutterTasks.new
|
23
|
+
rescue LoadError
|
24
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
25
|
+
end
|
26
|
+
|
27
|
+
require 'spec/rake/spectask'
|
28
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
29
|
+
spec.libs << 'lib' << 'spec'
|
30
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
31
|
+
end
|
32
|
+
|
33
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
34
|
+
spec.libs << 'lib' << 'spec'
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.rcov = true
|
37
|
+
end
|
38
|
+
|
39
|
+
task :spec => :check_dependencies
|
40
|
+
|
41
|
+
task :default => :spec
|
42
|
+
|
43
|
+
require 'rake/rdoctask'
|
44
|
+
Rake::RDocTask.new do |rdoc|
|
45
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
46
|
+
|
47
|
+
rdoc.rdoc_dir = 'rdoc'
|
48
|
+
rdoc.title = "UCSCBin #{version}"
|
49
|
+
rdoc.rdoc_files.include('README*')
|
50
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
51
|
+
end
|
data/UCSCBin.gemspec
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{UCSCBin}
|
8
|
+
s.version = "0.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Hiroyuki MISHIMA"]
|
12
|
+
s.date = %q{2010-10-28}
|
13
|
+
s.description = %q{Utilities for UCSC Bioinfomatics's Genome Browser
|
14
|
+
( http://g enome.ucsc.edu ) including calculation of a BIN index
|
15
|
+
from a genomic interval to speed-up SQL queries, and conversion
|
16
|
+
between 1-based full-closed (for humans) and 0-based half-open
|
17
|
+
(for machienes) intervals}
|
18
|
+
s.email = %q{missy@be.to}
|
19
|
+
s.extra_rdoc_files = [
|
20
|
+
"LICENSE",
|
21
|
+
"README.rdoc"
|
22
|
+
]
|
23
|
+
s.files = [
|
24
|
+
"LICENSE",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"UCSCBin.gemspec",
|
28
|
+
"VERSION",
|
29
|
+
"lib/UCSCBin.rb",
|
30
|
+
"rdoc/README_rdoc.html",
|
31
|
+
"rdoc/UCSCBin.html",
|
32
|
+
"rdoc/UCSCBin/BinRange.html",
|
33
|
+
"rdoc/UCSCBin/Utils.html",
|
34
|
+
"rdoc/created.rid",
|
35
|
+
"rdoc/images/brick.png",
|
36
|
+
"rdoc/images/brick_link.png",
|
37
|
+
"rdoc/images/bug.png",
|
38
|
+
"rdoc/images/bullet_black.png",
|
39
|
+
"rdoc/images/bullet_toggle_minus.png",
|
40
|
+
"rdoc/images/bullet_toggle_plus.png",
|
41
|
+
"rdoc/images/date.png",
|
42
|
+
"rdoc/images/find.png",
|
43
|
+
"rdoc/images/loadingAnimation.gif",
|
44
|
+
"rdoc/images/macFFBgHack.png",
|
45
|
+
"rdoc/images/package.png",
|
46
|
+
"rdoc/images/page_green.png",
|
47
|
+
"rdoc/images/page_white_text.png",
|
48
|
+
"rdoc/images/page_white_width.png",
|
49
|
+
"rdoc/images/plugin.png",
|
50
|
+
"rdoc/images/ruby.png",
|
51
|
+
"rdoc/images/tag_green.png",
|
52
|
+
"rdoc/images/wrench.png",
|
53
|
+
"rdoc/images/wrench_orange.png",
|
54
|
+
"rdoc/images/zoom.png",
|
55
|
+
"rdoc/index.html",
|
56
|
+
"rdoc/js/darkfish.js",
|
57
|
+
"rdoc/js/jquery.js",
|
58
|
+
"rdoc/js/quicksearch.js",
|
59
|
+
"rdoc/js/thickbox-compressed.js",
|
60
|
+
"rdoc/lib/UCSCBin_rb.html",
|
61
|
+
"rdoc/rdoc.css",
|
62
|
+
"sample/refseqgene.rb",
|
63
|
+
"spec/UCSCBin_BinRange_spec.rb",
|
64
|
+
"spec/UCSCBin_Utils_spec.rb",
|
65
|
+
"spec/spec.opts",
|
66
|
+
"spec/spec_helper.rb"
|
67
|
+
]
|
68
|
+
s.homepage = %q{http://github.com/misshie/UCSCBin}
|
69
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
70
|
+
s.require_paths = ["lib"]
|
71
|
+
s.rubygems_version = %q{1.3.7}
|
72
|
+
s.summary = %q{Calculate BIN indexes on UCSC Bioinformatics's Genome Browser}
|
73
|
+
s.test_files = [
|
74
|
+
"spec/UCSCBin_Utils_spec.rb",
|
75
|
+
"spec/spec_helper.rb",
|
76
|
+
"spec/UCSCBin_BinRange_spec.rb"
|
77
|
+
]
|
78
|
+
|
79
|
+
if s.respond_to? :specification_version then
|
80
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
81
|
+
s.specification_version = 3
|
82
|
+
|
83
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
84
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
85
|
+
else
|
86
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
87
|
+
end
|
88
|
+
else
|
89
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.0
|
data/lib/UCSCBin.rb
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
# = UCSCBin
|
2
|
+
# Author:: Hiroyuki Mishima
|
3
|
+
# Copyright:: Hiroyuki Mishima, 2010
|
4
|
+
# Licence:: the MIT/X11 licence. See the LICENCE file.
|
5
|
+
#
|
6
|
+
# Original program in C by Jim Kent, 2002
|
7
|
+
#
|
8
|
+
# Util:
|
9
|
+
# convert between 0-based half-open interval and
|
10
|
+
# 1-based full-close intervals.
|
11
|
+
#
|
12
|
+
# BinRange:
|
13
|
+
# Calculate Bin number from genomic physical position
|
14
|
+
# according to UCSC's Bin Indexing System.
|
15
|
+
#
|
16
|
+
# See also http://genomewiki.ucsc.edu/index.php/Bin_indexing_system,
|
17
|
+
# a paper Kent, et. al. Genome Research 2002.12:996-1006,
|
18
|
+
# and src/lib/binRange.c in the kent source tree.
|
19
|
+
#
|
20
|
+
|
21
|
+
module UCSCBin
|
22
|
+
# Version = "0.1.0" # 20100714
|
23
|
+
Version = "0.2.0" # 20101028
|
24
|
+
|
25
|
+
class Utils
|
26
|
+
# 'zero_start' and 'zero_end' are 0-based half-open
|
27
|
+
# used in UCSC MySQL database and the BED format.
|
28
|
+
# the first one base in a chromosome is [0, 1)
|
29
|
+
# Positions must be start<end
|
30
|
+
def self.zero_to_one(zero_start, zero_end)
|
31
|
+
case
|
32
|
+
when (zero_start < 0 || zero_end < 0)
|
33
|
+
raise ArgumentError, "positions must be >=0"
|
34
|
+
when zero_start >= zero_end
|
35
|
+
raise ArgumentError, "positions must be start<end"
|
36
|
+
end
|
37
|
+
|
38
|
+
[zero_start + 1, zero_end]
|
39
|
+
end
|
40
|
+
|
41
|
+
# 'one_start' and 'one_end' are 1-based full-close
|
42
|
+
# used in UCSC genome browser's human interface and most of other formats
|
43
|
+
# the first one base in a chromosome is [1, 1]
|
44
|
+
# Positions must be start<=end
|
45
|
+
def self.one_to_zero(one_start, one_end)
|
46
|
+
case
|
47
|
+
when (one_start < 1 || one_end < 1)
|
48
|
+
raise ArgumentError, "positions must be >=1"
|
49
|
+
when one_start > one_end
|
50
|
+
raise ArgumentError, "positions must be start<=end"
|
51
|
+
end
|
52
|
+
|
53
|
+
[one_start - 1 , one_end]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class BinRange
|
58
|
+
BINRANGE_MAXEND_512M = (512*1024*1024)
|
59
|
+
BIN_OFFSETS_EXTENDED = [4096+512+64+8+1, 512+64+8+1, 64+8+1, 8+1, 1, 0]
|
60
|
+
BIN_OFFSETS = [512+64+8+1, 64+8+1, 8+1, 1, 0]
|
61
|
+
BIN_OFFSET_OLD_TO_EXTENDED = 4681
|
62
|
+
# How much to shift to get to finest bin.
|
63
|
+
BIN_FIRST_SHIFT = 17
|
64
|
+
# How much to shift to get to next larger bin.
|
65
|
+
BIN_NEXT_SHIFT = 3
|
66
|
+
|
67
|
+
# Return a Integer of a BIN which is the smallest/finest bin
|
68
|
+
# containing whole the interval/range.
|
69
|
+
#
|
70
|
+
# Extended bin index for positions >= 512M is not supported yet
|
71
|
+
# Do you need it? Please email me.
|
72
|
+
def self.bin_from_range(bin_start, bin_end)
|
73
|
+
if bin_end <= BINRANGE_MAXEND_512M
|
74
|
+
bin_from_range_standard(bin_start, bin_end)
|
75
|
+
else
|
76
|
+
bin_from_range_extended(bin_start, bin_end)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
class << self; alias bin bin_from_range; end
|
81
|
+
|
82
|
+
# Return an Array of BINs which are all bins containing whole the
|
83
|
+
# interval/range. Thus, it always contains "0" indicating a bin
|
84
|
+
# containing whole of a chromosome.
|
85
|
+
#
|
86
|
+
# extended bin index for positions >= 512M is not supported yet
|
87
|
+
# Do you need it? Please email me.
|
88
|
+
#
|
89
|
+
def self.bin_all(p_start, p_end)
|
90
|
+
if p_end <= BINRANGE_MAXEND_512M
|
91
|
+
bin_all_standard(p_start, p_end)
|
92
|
+
else
|
93
|
+
bin_all_extended(p_start, p_end)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
private
|
98
|
+
|
99
|
+
def self.bin_from_range_standard(bin_start, bin_end)
|
100
|
+
# Given start,end in chromosome coordinates assign it
|
101
|
+
# a bin. There's a bin for each 128k segment, for each
|
102
|
+
# 1M segment, for each 8M segment, for each 64M segment,
|
103
|
+
# and for each chromosome (which is assumed to be less than
|
104
|
+
# 512M.) A range goes into the smallest bin it will fit in.
|
105
|
+
|
106
|
+
bin_start >>= BIN_FIRST_SHIFT
|
107
|
+
bin_end -= 1
|
108
|
+
bin_end >>= BIN_FIRST_SHIFT
|
109
|
+
|
110
|
+
BIN_OFFSETS.each do |offset|
|
111
|
+
return offset + bin_start if bin_start == bin_end
|
112
|
+
bin_start >>= BIN_NEXT_SHIFT
|
113
|
+
bin_end >>= BIN_NEXT_SHIFT
|
114
|
+
end
|
115
|
+
raise RangeError, \
|
116
|
+
"start #{bin_start}, end #{bin_end} out of range in findBin (max is 512M)"
|
117
|
+
end
|
118
|
+
|
119
|
+
def self.bin_from_range_extended(bin_start, bin_end)
|
120
|
+
raise NotImplementedError, "Extended bins are not supported yet"
|
121
|
+
end
|
122
|
+
|
123
|
+
def self.bin_all_standard(bin_start, bin_end)
|
124
|
+
bin_start_orig = bin_start
|
125
|
+
bin_end_orig = bin_end
|
126
|
+
results = Array.new
|
127
|
+
|
128
|
+
bin_start >>= BIN_FIRST_SHIFT
|
129
|
+
bin_end -= 1
|
130
|
+
bin_end >>= BIN_FIRST_SHIFT
|
131
|
+
|
132
|
+
BIN_OFFSETS.each do |offset|
|
133
|
+
results.concat(((offset + bin_start)..(offset + bin_end)).to_a)
|
134
|
+
bin_start >>= BIN_NEXT_SHIFT
|
135
|
+
bin_end >>= BIN_NEXT_SHIFT
|
136
|
+
end
|
137
|
+
return results
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.bin_all_extended(bin_start, bin_end)
|
141
|
+
raise NotImplementedError, "Extended bins are not supported yet"
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
@@ -0,0 +1,170 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
8
|
+
|
9
|
+
<title>File: README.rdoc [UCSCBin 0.2.0
|
10
|
+
]</title>
|
11
|
+
|
12
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
|
13
|
+
|
14
|
+
<script src="./js/jquery.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
21
|
+
charset="utf-8"></script>
|
22
|
+
</head>
|
23
|
+
|
24
|
+
<body class="file">
|
25
|
+
<div id="metadata">
|
26
|
+
<div id="project-metadata">
|
27
|
+
|
28
|
+
|
29
|
+
<div id="fileindex-section" class="section project-section">
|
30
|
+
<h3 class="section-header">Files</h3>
|
31
|
+
<ul>
|
32
|
+
|
33
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
34
|
+
|
35
|
+
</ul>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
|
39
|
+
<div id="classindex-section" class="section project-section">
|
40
|
+
<h3 class="section-header">Class Index
|
41
|
+
<span class="search-toggle"><img src="./images/find.png"
|
42
|
+
height="16" width="16" alt="[+]"
|
43
|
+
title="show/hide quicksearch" /></span></h3>
|
44
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
45
|
+
<fieldset>
|
46
|
+
<legend>Quicksearch</legend>
|
47
|
+
<input type="text" name="quicksearch" value=""
|
48
|
+
class="quicksearch-field" />
|
49
|
+
</fieldset>
|
50
|
+
</form>
|
51
|
+
|
52
|
+
<ul class="link-list">
|
53
|
+
|
54
|
+
<li><a href="./UCSCBin.html">UCSCBin</a></li>
|
55
|
+
|
56
|
+
<li><a href="./UCSCBin/BinRange.html">UCSCBin::BinRange</a></li>
|
57
|
+
|
58
|
+
<li><a href="./UCSCBin/Utils.html">UCSCBin::Utils</a></li>
|
59
|
+
|
60
|
+
</ul>
|
61
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
|
65
|
+
</div>
|
66
|
+
</div>
|
67
|
+
|
68
|
+
<div id="documentation">
|
69
|
+
<h1><a href="UCSCBin.html">UCSCBin</a></h1>
|
70
|
+
<table>
|
71
|
+
<tr><td valign="top">Author:</td><td>Hiroyuki Mishima (missy at be.to / hmishima at nagasaki-u.ac.jp)
|
72
|
+
|
73
|
+
</td></tr>
|
74
|
+
<tr><td valign="top">Copyright:</td><td>Hiroyuki Mishima, 2010
|
75
|
+
|
76
|
+
</td></tr>
|
77
|
+
<tr><td valign="top">License:</td><td>the MIT/X11 license. See the LICENSE file.
|
78
|
+
|
79
|
+
</td></tr>
|
80
|
+
</table>
|
81
|
+
<p>
|
82
|
+
A library for handling BIN index and 0/1-based coordination of UCSC
|
83
|
+
Bioinformatics Genome Browser ( <a
|
84
|
+
href="http://genome.ucsc.edu/">genome.ucsc.edu/</a> )
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
Original program in C by Jim Kent, 2002
|
88
|
+
</p>
|
89
|
+
<p>
|
90
|
+
See also related materials:
|
91
|
+
</p>
|
92
|
+
<ul>
|
93
|
+
<li><a
|
94
|
+
href="http://genomewiki.ucsc.edu/index.php/Bin_indexing_system">genomewiki.ucsc.edu/index.php/Bin_indexing_system</a>,
|
95
|
+
|
96
|
+
</li>
|
97
|
+
<li>Kent, et. al. Genome Research 2002.12:996-1006, <a
|
98
|
+
href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC186604/">www.ncbi.nlm.nih.gov/pmc/articles/PMC186604/</a>
|
99
|
+
|
100
|
+
</li>
|
101
|
+
<li>src/lib/binRange.c in the kent source tree. <a
|
102
|
+
href="http://hgdownload.cse.ucsc.edu/admin/jksrc.zip">hgdownload.cse.ucsc.edu/admin/jksrc.zip</a>
|
103
|
+
|
104
|
+
</li>
|
105
|
+
</ul>
|
106
|
+
<h2>UCSCBin::Util</h2>
|
107
|
+
<p>
|
108
|
+
convert between 0-based half-open interval and 1-based full-close
|
109
|
+
intervals.
|
110
|
+
</p>
|
111
|
+
<h2><a href="UCSCBin/BinRange.html">UCSCBin::BinRange</a></h2>
|
112
|
+
<p>
|
113
|
+
Calculate Bin number from genomic physical position according to
|
114
|
+
UCSC’s Bin Indexing System. note: Extended bin index for positions >=
|
115
|
+
512M is not supported yet. Do you need it? Please email the author.
|
116
|
+
</p>
|
117
|
+
<h2>sample/refseqgene.rb</h2>
|
118
|
+
<p>
|
119
|
+
to run the sample (input interval is regular 1-based full-closed
|
120
|
+
cordination)
|
121
|
+
</p>
|
122
|
+
<pre>
|
123
|
+
sudo gem install sequel
|
124
|
+
sample/refseqgene.rb chr1:234567-456789
|
125
|
+
</pre>
|
126
|
+
<p>
|
127
|
+
output:
|
128
|
+
</p>
|
129
|
+
<pre>
|
130
|
+
chr1:234567-345678 LOC100133331; LOC100132287; LOC100132062
|
131
|
+
</pre>
|
132
|
+
<h2>Note on Patches/Pull Requests</h2>
|
133
|
+
<ul>
|
134
|
+
<li>github repository is git://github.com/misshie/UCSCBin.git
|
135
|
+
|
136
|
+
</li>
|
137
|
+
<li>Fork the project.
|
138
|
+
|
139
|
+
</li>
|
140
|
+
<li>Make your feature addition or bug fix.
|
141
|
+
|
142
|
+
</li>
|
143
|
+
<li>Add tests for it. This is important so I don’t break it in a future
|
144
|
+
version unintentionally.
|
145
|
+
|
146
|
+
</li>
|
147
|
+
<li>Commit, do not mess with rakefile, version, or history. (if you want to
|
148
|
+
have your own version, that is fine but bump version in a commit by itself
|
149
|
+
I can ignore when I pull)
|
150
|
+
|
151
|
+
</li>
|
152
|
+
<li>Send me a pull request. Bonus points for topic branches.
|
153
|
+
|
154
|
+
</li>
|
155
|
+
</ul>
|
156
|
+
<h2>Copyright</h2>
|
157
|
+
<p>
|
158
|
+
Copyright © 2010 Hiroyuki MISHIMA. See LICENSE for details.
|
159
|
+
</p>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div id="validator-badges">
|
164
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
165
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
166
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
167
|
+
</div>
|
168
|
+
</body>
|
169
|
+
</html>
|
170
|
+
|