wrnap 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wrnap/rna.rb +0 -21
- data/lib/wrnap/rna/box.rb +4 -3
- data/lib/wrnap/rna/tree.rb +35 -0
- data/lib/wrnap/version.rb +1 -1
- data/wrnap.gemspec +4 -4
- metadata +6 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7152b75ccf68c5de1ca50f9f0d45e226315b19e
|
4
|
+
data.tar.gz: f10da874182ca44bd751447d7982123554a98506
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8f4c460003509e340cc47681f6b6a3cd71ec90edf2a612bfe7fd2fb4248dfcce4c73cd274eec3b8350904380410542bcaa2cf82cf7e361019e77829bfc7bf73
|
7
|
+
data.tar.gz: 80ca9ab389a258371c9ec97c90a7b1ce64c3976155eae2a9d0fac31eeceece4b0e341ba45c5ed447ddb5a55ef9d8c5f5fae52e3d8c7a41dd9d27e45631b3498b
|
data/lib/wrnap/rna.rb
CHANGED
@@ -68,27 +68,6 @@ module Wrnap
|
|
68
68
|
Context.init_from_entrez(*context, coords: coords, rna: rna, &block)
|
69
69
|
end
|
70
70
|
|
71
|
-
def init_from_self(rna, &block)
|
72
|
-
# This happens when you call a Wrnap library function with the output of something like Wrnap::Fold.run(...).mfe
|
73
|
-
new(
|
74
|
-
sequence: rna.sequence,
|
75
|
-
structures: rna.structures,
|
76
|
-
comment: rna.comment,
|
77
|
-
&block
|
78
|
-
).tap do |new_rna|
|
79
|
-
new_rna.instance_variable_set(:@metadata, rna.metadata.clone)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def init_from_old_rna_object(rna)
|
84
|
-
init_from_self(rna).tap do |new_rna|
|
85
|
-
new_rna.instance_variable_set(:@structures, [
|
86
|
-
rna.instance_variable_get(:@structure),
|
87
|
-
rna.instance_variable_get(:@second_structure)
|
88
|
-
].compact)
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
71
|
alias_method :placeholder, :new
|
93
72
|
end
|
94
73
|
|
data/lib/wrnap/rna/box.rb
CHANGED
@@ -7,6 +7,7 @@ module Wrnap
|
|
7
7
|
include Wrnap::Global::Yaml
|
8
8
|
|
9
9
|
attr_reader :rnas
|
10
|
+
attr_accessor :name
|
10
11
|
|
11
12
|
class << self
|
12
13
|
def load_all(pattern = "*.fa", &block)
|
@@ -17,8 +18,8 @@ module Wrnap
|
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
20
|
-
def initialize(rnas)
|
21
|
-
@rnas = rnas.kind_of?(Array) ? rnas : [rnas]
|
21
|
+
def initialize(rnas, name = "")
|
22
|
+
@rnas, @name = rnas.kind_of?(Array) ? rnas : [rnas], name
|
22
23
|
end
|
23
24
|
|
24
25
|
def write_fa!(filename)
|
@@ -56,7 +57,7 @@ module Wrnap
|
|
56
57
|
end
|
57
58
|
|
58
59
|
def inspect
|
59
|
-
"#<Wrnap::Rna::Box with %d RNAs>" % rnas.size
|
60
|
+
("#<Wrnap::Rna::Box %s with %d RNAs>" % [name, rnas.size]).gsub(/\s\s+/, " ")
|
60
61
|
end
|
61
62
|
end
|
62
63
|
end
|
data/lib/wrnap/rna/tree.rb
CHANGED
@@ -69,6 +69,8 @@ module Wrnap
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def detached_copy
|
72
|
+
# The implementation of this in RubyTree explicitly returns a new Tree::TreeNode instance rather than self.class.new, so we
|
73
|
+
# maintain ducktyping by intercepting the method.
|
72
74
|
self.class.new(@name, @content ? @content.clone : nil)
|
73
75
|
end
|
74
76
|
|
@@ -148,6 +150,23 @@ module Wrnap
|
|
148
150
|
subtree << node
|
149
151
|
end
|
150
152
|
end
|
153
|
+
|
154
|
+
# RNA.from_fa("xpt.fa").trunk.pp
|
155
|
+
# * root
|
156
|
+
# |---+ (5..12, 66..73 [8])
|
157
|
+
# | |---> (18..22, 30..34 [5])
|
158
|
+
# | +---> (45..50, 58..63 [6])
|
159
|
+
# |---+ (75..78, 102..105 [4]) <-
|
160
|
+
# | +---> (80..86, 95..101 [7]) <-
|
161
|
+
# +---> (112..125, 133..146 [14])
|
162
|
+
#
|
163
|
+
# RNA.from_fa("xpt.fa").trunk.coalesce.pp
|
164
|
+
# * root
|
165
|
+
# |---+ (5..12, 66..73 [8])
|
166
|
+
# | |---> (18..22, 30..34 [5])
|
167
|
+
# | +---> (45..50, 58..63 [6])
|
168
|
+
# |---> (80..86, 95..101 [7]) <-
|
169
|
+
# +---> (112..125, 133..146 [14])
|
151
170
|
|
152
171
|
def coalesce
|
153
172
|
self.class.new(rna, root.clone).tap { |tree| tree.merge_interior_loops! }
|
@@ -157,6 +176,22 @@ module Wrnap
|
|
157
176
|
tap { merge_interior_loops! }
|
158
177
|
end
|
159
178
|
|
179
|
+
# RNA.from_fa("xpt.fa").trunk.pp
|
180
|
+
# * root
|
181
|
+
# |---+ (5..12, 66..73 [8])
|
182
|
+
# | |---> (18..22, 30..34 [5])
|
183
|
+
# | +---> (45..50, 58..63 [6])
|
184
|
+
# |---+ (75..78, 102..105 [4]) <-
|
185
|
+
# | +---> (80..86, 95..101 [7]) <-
|
186
|
+
# +---> (112..125, 133..146 [14])
|
187
|
+
#
|
188
|
+
# RNA.from_fa("xpt.fa").trunk.fuse.pp
|
189
|
+
# * root
|
190
|
+
# |---+ (5..12, 66..73 [8])
|
191
|
+
# | |---> (18..22, 30..34 [5])
|
192
|
+
# | +---> (45..50, 58..63 [6])
|
193
|
+
# |---> (75..86, 94..105 [12]) <-
|
194
|
+
# +---> (112..125, 133..146 [14])
|
160
195
|
def fuse
|
161
196
|
self.class.new(rna, root.clone).tap { |tree| tree.extend_interior_loops! }
|
162
197
|
end
|
data/lib/wrnap/version.rb
CHANGED
data/wrnap.gemspec
CHANGED
@@ -20,11 +20,11 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.required_ruby_version = ">= 2.0"
|
22
22
|
|
23
|
-
spec.add_development_dependency "awesome_print", "~> 1.2
|
23
|
+
spec.add_development_dependency "awesome_print", "~> 1.2"
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
|
-
spec.add_development_dependency "gem-release", "~> 0.7"
|
26
|
-
spec.add_development_dependency "rake", "~> 10.
|
27
|
-
|
25
|
+
spec.add_development_dependency "gem-release", "~> 0.7"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.4"
|
27
|
+
|
28
28
|
spec.add_runtime_dependency "activesupport", "~> 4.0"
|
29
29
|
spec.add_runtime_dependency "bio", "~> 1.4"
|
30
30
|
spec.add_runtime_dependency "bio-stockholm", "~> 0.0.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wrnap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Senter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2
|
19
|
+
version: '1.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2
|
26
|
+
version: '1.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,9 +45,6 @@ dependencies:
|
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0.7'
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 0.7.3
|
51
48
|
type: :development
|
52
49
|
prerelease: false
|
53
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,23 +52,20 @@ dependencies:
|
|
55
52
|
- - "~>"
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: '0.7'
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.7.3
|
61
55
|
- !ruby/object:Gem::Dependency
|
62
56
|
name: rake
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
59
|
- - "~>"
|
66
60
|
- !ruby/object:Gem::Version
|
67
|
-
version: '10.
|
61
|
+
version: '10.4'
|
68
62
|
type: :development
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
66
|
- - "~>"
|
73
67
|
- !ruby/object:Gem::Version
|
74
|
-
version: '10.
|
68
|
+
version: '10.4'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
70
|
name: activesupport
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|