bio-genomic-interval 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +12 -1
- data/VERSION +1 -1
- data/bio-genomic-interval.gemspec +2 -2
- data/lib/bio-genomic-interval.rb +2 -2
- data/spec/bio-genomic-interval_spec.rb +7 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
= bio-genomic-interval
|
2
2
|
|
3
3
|
Author:: MISHIMA, Hiroyuki (hmishima AT nagasaki-u.ac.jp, missy AT be.to)
|
4
|
-
Version:: 0.1.
|
4
|
+
Version:: 0.1.2
|
5
5
|
Copyright:: Copyright (c) MISHIMA, Hiroyuki, 2011
|
6
6
|
License:: the MIT/X11 license
|
7
7
|
|
8
8
|
A BioRuby plugin: handling genomic intervals,such as "chr1:123-456",
|
9
9
|
and overlaps between two intervals.
|
10
|
+
= Install
|
11
|
+
|
12
|
+
$ gem install bio-genomic-interval
|
13
|
+
(sudo or switching to root may be required)
|
10
14
|
|
11
15
|
= Usage
|
12
16
|
== Generation of interval objects
|
@@ -15,6 +19,8 @@ a interval object be generated by like the following:
|
|
15
19
|
a.to_s # => "chr1:123-456"
|
16
20
|
b = Bio::GenomicInterval.parse("chr1:123-456")
|
17
21
|
b.to_s # => "chr1:123-456"
|
22
|
+
b2 = Bio::GenomicInterval.parse("chr1:1,234,567-2,345,678")
|
23
|
+
b2.to_s # => "chr1:1234567-2345678" # ignoring ","
|
18
24
|
c = Bio::GenomicInetrval.zero_based("chr1", 122, 456)
|
19
25
|
c.to_s # => "chr1:123-456"
|
20
26
|
c.zero_start # => 122
|
@@ -43,6 +49,11 @@ Note that size is changed to 1.
|
|
43
49
|
ref.adjacent = 1
|
44
50
|
ref.compare(cmp) # => :right_off
|
45
51
|
|
52
|
+
Bio::GenomicInterval.compare returns one of the followings:
|
53
|
+
:different_chrom, :left_adjacent, :right_adjacent
|
54
|
+
:left_off, :right_off, :equal
|
55
|
+
:contained_by, :contains, :left_overlapped, :right_overlapped
|
56
|
+
|
46
57
|
== Overlap metrics
|
47
58
|
* When a overlap exist, return a positive integers (>1) for the overlap length.
|
48
59
|
* When a overlap does not exist, return a zero or a negative (<= 0) for the space size between the intervals.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bio-genomic-interval}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Hiroyuki Mishima"]
|
12
|
-
s.date = %q{2011-04-
|
12
|
+
s.date = %q{2011-04-20}
|
13
13
|
s.description = %q{a BioRuby plugin: handling genomic intervals,such as "chr1:123-456", and overlap state between two intervals }
|
14
14
|
s.email = %q{missy@be.to}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/bio-genomic-interval.rb
CHANGED
@@ -25,8 +25,8 @@ module Bio
|
|
25
25
|
chrom, start_end = interval.split(":")
|
26
26
|
str_start, str_end = start_end.split("-")[0..1]
|
27
27
|
str_end = str_start if str_end.nil?
|
28
|
-
chr_start = Integer(str_start)
|
29
|
-
chr_end = Integer(str_end)
|
28
|
+
chr_start = Integer(str_start.gsub(",",""))
|
29
|
+
chr_end = Integer(str_end.gsub(",",""))
|
30
30
|
if chr_start > chr_end
|
31
31
|
chr_end, chr_start = chr_start, chr_end
|
32
32
|
end
|
@@ -50,6 +50,13 @@ describe "Bio::GenomicInterval" do
|
|
50
50
|
Bio::GenomicInterval.parse("chr1:123").to_s.should == "chr1:123-123"
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
context 'given "chr1:1,234,567-2,345,678"' do
|
55
|
+
it 'ignores commas and represents "chr1:1234567-2345678"' do
|
56
|
+
istr = "chr1:1,234,567-2,345,678"
|
57
|
+
Bio::GenomicInterval.parse(istr).to_s.should == "chr1:1234567-2345678"
|
58
|
+
end
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
describe ".zero_based" do
|
@@ -360,7 +367,6 @@ describe "Bio::GenomicInterval" do
|
|
360
367
|
receiver.overlap(subject).should == 0
|
361
368
|
end
|
362
369
|
end
|
363
|
-
|
364
370
|
end
|
365
371
|
|
366
372
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Hiroyuki Mishima
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-04-
|
17
|
+
date: 2011-04-20 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
hash:
|
129
|
+
hash: -73016163408757686
|
130
130
|
segments:
|
131
131
|
- 0
|
132
132
|
version: "0"
|