vienna_rna 0.11.0 → 0.13.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.
- checksums.yaml +4 -4
- data/lib/vienna_rna/global/parser.rb +6 -1
- data/lib/vienna_rna/global/rna.rb +27 -10
- data/lib/vienna_rna/global/rna_extensions.rb +4 -0
- data/lib/vienna_rna/global/run_extensions.rb +4 -2
- data/lib/vienna_rna/graphing/r.rb +14 -9
- data/lib/vienna_rna/package/base.rb +12 -1
- data/lib/vienna_rna/package/eval.rb +1 -1
- data/lib/vienna_rna/package/fft_mfpt.rb +24 -0
- data/lib/vienna_rna/package/fftbor2d.rb +26 -1
- data/lib/vienna_rna/package/fold.rb +7 -3
- data/lib/vienna_rna/package/heat.rb +1 -1
- data/lib/vienna_rna/package/kinwalker.rb +24 -0
- data/lib/vienna_rna/package/mfpt.rb +3 -2
- data/lib/vienna_rna/package/rna2dfold.rb +2 -2
- data/lib/vienna_rna/package/spectral.rb +24 -0
- data/lib/vienna_rna/package/subopt.rb +1 -1
- data/lib/vienna_rna/package/tabu_path.rb +5 -1
- data/lib/vienna_rna/package/xbor.rb +13 -13
- data/lib/vienna_rna.rb +4 -0
- metadata +28 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 099ebe746d12378a62249b9a704ad6774f81e517
|
4
|
+
data.tar.gz: bb38709cf960d5502eaecc608dc848acfdd10abf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae8e3aa5cc99791d32f736a3bc20ef38a0e8a71aa79c96748bd1ceab68a8921e0d3df2519c65c3fd8028e4a3f4866aa001ee7f3a24de3046ac77440e8e8d4945
|
7
|
+
data.tar.gz: 5c35acf8d8ab2d1563c61c7ded6b1dfc155dce50d3e63818a01cebd4abe05eb8b7d3d10432f0ae3edf13d2bce04ebbe097ef2e57f862b2b2970b8ea4780628cd
|
@@ -2,7 +2,8 @@ module ViennaRna
|
|
2
2
|
module Global
|
3
3
|
module Parser
|
4
4
|
REGEXP = {
|
5
|
-
|
5
|
+
number: /-?\d*\.\d*/,
|
6
|
+
mfe: / \(\s*(-?\d*\.\d*)\)$/
|
6
7
|
}
|
7
8
|
|
8
9
|
class << self
|
@@ -13,6 +14,10 @@ module ViennaRna
|
|
13
14
|
def rnafold_mfe(response)
|
14
15
|
response.split(/\n/)[1].match(REGEXP[:mfe])[1].to_f
|
15
16
|
end
|
17
|
+
|
18
|
+
def rnafold_ensemble_energy(response)
|
19
|
+
response.split(/\n/)[2].split(/\s/).last.match(REGEXP[:number])[0].to_f
|
20
|
+
end
|
16
21
|
end
|
17
22
|
end
|
18
23
|
end
|
@@ -4,14 +4,15 @@ module ViennaRna
|
|
4
4
|
include RnaExtensions
|
5
5
|
|
6
6
|
attr_accessor :comment
|
7
|
-
attr_reader :sequence, :structure, :second_structure
|
7
|
+
attr_reader :sequence, :structure, :second_structure
|
8
8
|
|
9
9
|
class << self
|
10
|
-
def init_from_string(sequence, structure = nil, second_structure = nil)
|
10
|
+
def init_from_string(sequence, structure = nil, second_structure = nil, comment = nil)
|
11
11
|
new(
|
12
12
|
sequence: sequence,
|
13
13
|
structure: structure,
|
14
|
-
second_structure: second_structure
|
14
|
+
second_structure: second_structure,
|
15
|
+
comment: comment
|
15
16
|
)
|
16
17
|
end
|
17
18
|
|
@@ -20,8 +21,7 @@ module ViennaRna
|
|
20
21
|
sequence: hash[:sequence] || hash[:seq],
|
21
22
|
structure: hash[:structure] || hash[:str_1] || hash[:str],
|
22
23
|
second_structure: hash[:second_structure] || hash[:str_2],
|
23
|
-
comment: hash[:comment] || hash[:name]
|
24
|
-
raw_data: hash
|
24
|
+
comment: hash[:comment] || hash[:name]
|
25
25
|
)
|
26
26
|
end
|
27
27
|
|
@@ -50,16 +50,15 @@ module ViennaRna
|
|
50
50
|
sequence: rna.sequence,
|
51
51
|
strucutre: rna.structure,
|
52
52
|
second_strucutre: rna.second_structure,
|
53
|
-
comment: rna.comment
|
54
|
-
raw_data: rna.raw_data
|
53
|
+
comment: rna.comment
|
55
54
|
)
|
56
55
|
end
|
57
56
|
|
58
57
|
alias_method :placeholder, :new
|
59
58
|
end
|
60
59
|
|
61
|
-
def initialize(sequence: "", structure: "", second_structure: "", comment: ""
|
62
|
-
@sequence, @comment
|
60
|
+
def initialize(sequence: "", structure: "", second_structure: "", comment: "")
|
61
|
+
@sequence, @comment = sequence.kind_of?(Rna) ? sequence.seq : sequence, comment
|
63
62
|
|
64
63
|
[:structure, :second_structure].each do |structure_symbol|
|
65
64
|
instance_variable_set(
|
@@ -96,8 +95,20 @@ module ViennaRna
|
|
96
95
|
def empty_structure
|
97
96
|
"." * seq.length
|
98
97
|
end
|
99
|
-
|
98
|
+
|
100
99
|
alias :empty_str :empty_structure
|
100
|
+
|
101
|
+
def one_structure(structure_1)
|
102
|
+
self.class.init_from_string(seq, structure_1.is_a?(Symbol) ? send(structure_1) : structure_1, nil, name)
|
103
|
+
end
|
104
|
+
|
105
|
+
def two_structures(structure_1, structure_2)
|
106
|
+
self.class.init_from_string(
|
107
|
+
seq,
|
108
|
+
*[structure_1, structure_2].map { |argument| argument.is_a?(Symbol) ? send(argument) : argument },
|
109
|
+
name
|
110
|
+
)
|
111
|
+
end
|
101
112
|
|
102
113
|
def write_fa!(filename)
|
103
114
|
filename.tap do |filename|
|
@@ -117,6 +128,12 @@ module ViennaRna
|
|
117
128
|
def run(package_name, options = {})
|
118
129
|
ViennaRna::Package.lookup(package_name).run(self, options)
|
119
130
|
end
|
131
|
+
|
132
|
+
def method_missing(name, *args, &block)
|
133
|
+
if (name_str = "#{name}") =~ /^run_\w+$/
|
134
|
+
run(name_str.gsub(/^run_/, ""), *args)
|
135
|
+
else super end
|
136
|
+
end
|
120
137
|
|
121
138
|
def inspect
|
122
139
|
"#<RNA: %s>" % [
|
@@ -43,6 +43,10 @@ module ViennaRna
|
|
43
43
|
def gc_content
|
44
44
|
seq.split(//).select { |i| i =~ /[GC]/i }.size.to_f / seq.size
|
45
45
|
end
|
46
|
+
|
47
|
+
def boltzmann_probability(dangle: 2)
|
48
|
+
Math.exp(-run(:eval, d: dangle).mfe / ViennaRna::RT) / Math.exp(-run(:fold, d: dangle, p: 0).ensemble_energy / ViennaRna::RT)
|
49
|
+
end
|
46
50
|
end
|
47
51
|
|
48
52
|
module OneStructureBasedMethods
|
@@ -19,7 +19,7 @@ module ViennaRna
|
|
19
19
|
|
20
20
|
module InstanceMethods
|
21
21
|
def run(flags = {})
|
22
|
-
unless
|
22
|
+
unless response
|
23
23
|
tap do
|
24
24
|
@runtime = Benchmark.measure do
|
25
25
|
pre_run_check
|
@@ -77,7 +77,9 @@ module ViennaRna
|
|
77
77
|
|
78
78
|
def stringify_flags(flags)
|
79
79
|
flags.inject("") do |string, (flag, value)|
|
80
|
-
(string + (value == :empty ? " -%s" % flag : " -%s %s" % [flag, value])).strip
|
80
|
+
(string + (value == :empty || value.class == TrueClass ? " -%s" % flag : " -%s %s" % [flag, value])).strip
|
81
|
+
end.tap do
|
82
|
+
@flags = flags
|
81
83
|
end
|
82
84
|
end
|
83
85
|
end
|
@@ -47,9 +47,9 @@ module ViennaRna
|
|
47
47
|
|
48
48
|
r.eval <<-STR
|
49
49
|
title(
|
50
|
-
xlab =
|
51
|
-
ylab =
|
52
|
-
main =
|
50
|
+
xlab = #{expressionify(x_label)},
|
51
|
+
ylab = #{expressionify(y_label)},
|
52
|
+
main = #{expressionify(title || "Line Graph")},
|
53
53
|
cex.main = .9,
|
54
54
|
cex.lab = .9
|
55
55
|
)
|
@@ -60,11 +60,12 @@ module ViennaRna
|
|
60
60
|
legend(
|
61
61
|
"#{legend}",
|
62
62
|
legend.titles,
|
63
|
-
bty = "
|
63
|
+
bty = "o",
|
64
|
+
bg = rgb(1, 1, 1, .5, 1),
|
64
65
|
col = line.colors,
|
65
66
|
lty = rep(1, #{data.size}),
|
66
67
|
pch = 0:#{data.size},
|
67
|
-
cex = .
|
68
|
+
cex = .6
|
68
69
|
)
|
69
70
|
STR
|
70
71
|
end
|
@@ -78,7 +79,7 @@ module ViennaRna
|
|
78
79
|
end
|
79
80
|
|
80
81
|
def scatterplot(data, title: nil, x_label: "Independent", y_label: "Dependent", filename: false)
|
81
|
-
line_graph(data, title: title, type: ?p, x_label: x_label, y_label: y_label, filename: filename)
|
82
|
+
line_graph(data, title: title || "Scatterplot", type: ?p, x_label: x_label, y_label: y_label, filename: filename)
|
82
83
|
end
|
83
84
|
|
84
85
|
def roc(data, title: nil, baseline: true, filename: false)
|
@@ -139,8 +140,8 @@ module ViennaRna
|
|
139
140
|
hist(
|
140
141
|
histogram.data,
|
141
142
|
breaks = histogram.breaks,
|
142
|
-
xlab =
|
143
|
-
main =
|
143
|
+
xlab = #{expressionify(x_label)},
|
144
|
+
main = #{expressionify(title || "Histogram")},
|
144
145
|
freq = #{relative ? 'F' : 'T'},
|
145
146
|
cex.main = 0.9,
|
146
147
|
cex.lab = 0.9,
|
@@ -191,7 +192,7 @@ module ViennaRna
|
|
191
192
|
xlab = "#{x_label} (1-indexed)",
|
192
193
|
ylab = "#{y_label} (1-indexed)"
|
193
194
|
)
|
194
|
-
title(
|
195
|
+
title(#{expressionify(title || "Matrix Heatmap")})
|
195
196
|
STR
|
196
197
|
end
|
197
198
|
else
|
@@ -218,6 +219,10 @@ module ViennaRna
|
|
218
219
|
def writing_file?(filename)
|
219
220
|
filename && (filename = filename.end_with?(".pdf") ? filename : filename + ".pdf")
|
220
221
|
end
|
222
|
+
|
223
|
+
def expressionify(string)
|
224
|
+
%w|expression paste|.any?(&string.method(:start_with?)) ? string : string.inspect
|
225
|
+
end
|
221
226
|
end
|
222
227
|
end
|
223
228
|
end
|
@@ -24,11 +24,12 @@ module ViennaRna
|
|
24
24
|
def bootstrap(data: nil, output: "")
|
25
25
|
new(data).tap do |object|
|
26
26
|
object.instance_variable_set(:@response, File.exist?(output) ? File.read(output).chomp : output)
|
27
|
+
object.post_process if object.respond_to?(:post_process)
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
attr_reader :data, :response, :runtime
|
32
|
+
attr_reader :data, :flags, :response, :runtime
|
32
33
|
|
33
34
|
def initialize(data, chaining: false)
|
34
35
|
unless chaining
|
@@ -54,6 +55,16 @@ module ViennaRna
|
|
54
55
|
def debugger(&block)
|
55
56
|
self.class.debugger(&block)
|
56
57
|
end
|
58
|
+
|
59
|
+
def inspect
|
60
|
+
"#<%s (%.2f sec): data: %s, flags: %s, vars: %s>" % [
|
61
|
+
self.class.name,
|
62
|
+
runtime.real,
|
63
|
+
data,
|
64
|
+
flags,
|
65
|
+
(instance_variables - %i|@data @flags @response @runtime|).map(&:to_s).sort.join(", ")
|
66
|
+
]
|
67
|
+
end
|
57
68
|
end
|
58
69
|
end
|
59
70
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Maybe add something like flagsets so that common option groups can be combined together.
|
2
|
+
# Also, add a rerun feature.
|
3
|
+
|
4
|
+
module ViennaRna
|
5
|
+
module Package
|
6
|
+
class FftMfpt < Base
|
7
|
+
self.executable_name = "FFTmfpt"
|
8
|
+
|
9
|
+
attr_reader :mfpt
|
10
|
+
|
11
|
+
def run_command(flags)
|
12
|
+
"%s %s %s" % [
|
13
|
+
exec_name,
|
14
|
+
stringify_flags(flags),
|
15
|
+
data.temp_fa_file!
|
16
|
+
]
|
17
|
+
end
|
18
|
+
|
19
|
+
def post_process
|
20
|
+
@mfpt = response.to_f
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -2,7 +2,24 @@ module ViennaRna
|
|
2
2
|
module Package
|
3
3
|
class Fftbor2d < EnergyGrid2d
|
4
4
|
self.executable_name = "FFTbor2D"
|
5
|
-
self.default_flags = ->(_, flags) { (flags.keys & %i|X M S|).empty? ? { S: :empty } : {} }
|
5
|
+
self.default_flags = ->(_, flags) { (flags.keys & %i|X Y M S|).empty? ? { S: :empty } : {} }
|
6
|
+
|
7
|
+
attr_reader :population_proportion_str_2_from_str_1, :population_proportion_for_str_1
|
8
|
+
|
9
|
+
class Population
|
10
|
+
attr_reader :proportion_over_time
|
11
|
+
|
12
|
+
def initialize(time, proportion)
|
13
|
+
@proportion_over_time = time.zip(proportion)
|
14
|
+
end
|
15
|
+
|
16
|
+
def time_range(from, to)
|
17
|
+
proportion_over_time.select { |time, _| ((from.to_f)..(to.to_f)) === time }
|
18
|
+
end
|
19
|
+
|
20
|
+
def time_points; proportion_over_time.map(&:first); end
|
21
|
+
def proportion_points; proportion_over_time.map(&:last); end
|
22
|
+
end
|
6
23
|
|
7
24
|
def run_command(flags)
|
8
25
|
ViennaRna.debugger { "Running #{exec_name} on #{data.inspect}" }
|
@@ -13,6 +30,14 @@ module ViennaRna
|
|
13
30
|
data.temp_fa_file!
|
14
31
|
]
|
15
32
|
end
|
33
|
+
|
34
|
+
def post_process
|
35
|
+
if flags.keys.include?(:Y)
|
36
|
+
time_points, proportion_str_2_from_str_1, proportion_for_str_1 = response.split(/\n/).map { |line| line.split(/\t/).map(&:to_f) }.transpose
|
37
|
+
@population_proportion_str_2_from_str_1 = Population.new(time_points, proportion_str_2_from_str_1)
|
38
|
+
@population_proportion_for_str_1 = Population.new(time_points, proportion_for_str_1)
|
39
|
+
end
|
40
|
+
end
|
16
41
|
|
17
42
|
def distribution
|
18
43
|
response.split(/\n/).map { |line| line.split(/\t/) }
|
@@ -5,15 +5,19 @@ module ViennaRna
|
|
5
5
|
"-noPS" => :empty
|
6
6
|
}
|
7
7
|
|
8
|
-
attr_reader :mfe_rna, :structure, :mfe
|
8
|
+
attr_reader :mfe_rna, :structure, :mfe, :ensemble_energy
|
9
9
|
|
10
10
|
def post_process
|
11
|
-
structure = ViennaRna::Global::Parser.rnafold_mfe_structure(
|
11
|
+
structure = ViennaRna::Global::Parser.rnafold_mfe_structure(response)
|
12
12
|
|
13
13
|
unless data.seq.length == structure.length
|
14
14
|
raise "Sequence: '#{data.seq}'\nStructure: '#{structure}'"
|
15
15
|
else
|
16
|
-
@mfe_rna, @structure, @mfe = RNA.from_string(data.seq, structure), structure, ViennaRna::Global::Parser.rnafold_mfe(
|
16
|
+
@mfe_rna, @structure, @mfe = RNA.from_string(data.seq, structure), structure, ViennaRna::Global::Parser.rnafold_mfe(response)
|
17
|
+
end
|
18
|
+
|
19
|
+
if flags[:p] == 0
|
20
|
+
@ensemble_energy = ViennaRna::Global::Parser.rnafold_ensemble_energy(response)
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -4,7 +4,7 @@ module ViennaRna
|
|
4
4
|
attr_reader :specific_heats
|
5
5
|
|
6
6
|
def post_process
|
7
|
-
@specific_heats =
|
7
|
+
@specific_heats = response.split(/\n/).map { |line| line.split(/\s+/).map(&:to_f) }.inject({}) do |hash, (temp, specific_heat)|
|
8
8
|
hash.tap do
|
9
9
|
hash[temp] = specific_heat
|
10
10
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ViennaRna
|
2
|
+
module Package
|
3
|
+
class Kinwalker < Base
|
4
|
+
self.executable_name = "kinwalker"
|
5
|
+
attr_reader :nodes
|
6
|
+
|
7
|
+
def post_process
|
8
|
+
@nodes = response.split("TRAJECTORY").last.split(?\n).reject(&:empty?)[0..-2].map { |line| Node.new(*line.split(/\s+/)) }
|
9
|
+
end
|
10
|
+
|
11
|
+
def mfpt
|
12
|
+
nodes.last.time
|
13
|
+
end
|
14
|
+
|
15
|
+
class Node
|
16
|
+
attr_reader :structure, :energy, :time, :barrier, :energy_barrier, :transcribed
|
17
|
+
|
18
|
+
def initialize(structure, energy, time, barrier, energy_barrier, transcribed)
|
19
|
+
@structure, @energy, @time, @barrier, @energy_barrier, @transcribed = structure, energy.to_f, time.to_f, barrier.to_f, energy_barrier.to_f, transcribed.to_i
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# Maybe add something like flagsets so that common option groups can be combined together.
|
2
|
+
# Also, add a rerun feature.
|
2
3
|
|
3
4
|
module ViennaRna
|
4
5
|
module Package
|
@@ -32,8 +33,8 @@ module ViennaRna
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def post_process
|
35
|
-
@mfpt =
|
36
|
+
@mfpt = response.to_f
|
36
37
|
end
|
37
38
|
end
|
38
39
|
end
|
39
|
-
end
|
40
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ViennaRna
|
2
|
+
module Package
|
3
|
+
class Spectral < Base
|
4
|
+
self.default_flags = ->(context, flags) { { seq: context.data.seq, step_size: "1e-2" } }
|
5
|
+
|
6
|
+
attr_reader :eigenvalues, :time_kinetics
|
7
|
+
|
8
|
+
def run_command(flags)
|
9
|
+
"%s %s" % [
|
10
|
+
exec_name,
|
11
|
+
stringify_flags(flags)
|
12
|
+
]
|
13
|
+
end
|
14
|
+
|
15
|
+
def post_process
|
16
|
+
if flags.keys.include?(:eigen_only)
|
17
|
+
@eigenvalues = response.split(?\n).map(&:to_f).sort_by(&:abs)
|
18
|
+
else
|
19
|
+
@time_kinetics = response.split(?\n).map { |line| line.split(?\t).map(&:to_f) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -4,7 +4,7 @@ module ViennaRna
|
|
4
4
|
attr_reader :structures
|
5
5
|
|
6
6
|
def post_process
|
7
|
-
@structures =
|
7
|
+
@structures = response.split(/\n/)[1..-1].map { |output| RNA.from_string(data.seq, output.split(/\s+/).first) }
|
8
8
|
end
|
9
9
|
|
10
10
|
def bin(count = 1)
|
@@ -21,7 +21,7 @@ module ViennaRna
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def post_process
|
24
|
-
@paths =
|
24
|
+
@paths = response.split(data.str_1 + ?\n).reject(&:empty?).map { |path_string| Path.new(data, path_string) }
|
25
25
|
end
|
26
26
|
|
27
27
|
class Path
|
@@ -40,6 +40,10 @@ module ViennaRna
|
|
40
40
|
def full_path?
|
41
41
|
rna.str_1 == path.first && rna.str_2 == path.last
|
42
42
|
end
|
43
|
+
|
44
|
+
def inspect
|
45
|
+
"#<#{self.class.name} with barrier %.2f and length %d on #{rna.inspect}>" % [barrier, best_weight]
|
46
|
+
end
|
43
47
|
end
|
44
48
|
end
|
45
49
|
end
|
@@ -2,7 +2,7 @@ module ViennaRna
|
|
2
2
|
module Package
|
3
3
|
class Xbor < Base
|
4
4
|
self.default_flags = {
|
5
|
-
E: "/usr/local/bin/
|
5
|
+
E: "/usr/local/bin/rna_turner2004.par"
|
6
6
|
}
|
7
7
|
|
8
8
|
self.executable_name = ->(context) { context.class.name.demodulize.gsub(/^([A-Z].*)bor$/) { |match| $1.upcase + "bor" } }
|
@@ -22,14 +22,6 @@ module ViennaRna
|
|
22
22
|
]
|
23
23
|
end
|
24
24
|
|
25
|
-
def self.bootstrap_from_file(path, klass = self)
|
26
|
-
log = File.read(path)
|
27
|
-
sequence = log.split(/\n/).first.split(/\s+/)[1]
|
28
|
-
structure = log.split(/\n/).first.split(/\s+/)[2]
|
29
|
-
|
30
|
-
klass.bootstrap(data: RNA.from_string(sequence, structure), output: log)
|
31
|
-
end
|
32
|
-
|
33
25
|
def self.parse(response)
|
34
26
|
response.split(/\n/).select { |line| line =~ /^\d+\t-?\d+/ }.map { |line| line.split(/\t/) }
|
35
27
|
end
|
@@ -46,12 +38,20 @@ module ViennaRna
|
|
46
38
|
def expected_k
|
47
39
|
k_p_points.map { |array| array.inject(&:*) }.inject(&:+)
|
48
40
|
end
|
41
|
+
|
42
|
+
def to_csv
|
43
|
+
k_p_points.map { |k, p| "%d,%.8f" % [k, p] }.join(?\n) + ?\n
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_csv!(filename)
|
47
|
+
File.open(filename, ?w) { |file| file.write(to_csv) }
|
48
|
+
end
|
49
49
|
|
50
|
-
def quick_plot(
|
51
|
-
ViennaRna::Graphing::
|
50
|
+
def quick_plot(filename: false)
|
51
|
+
ViennaRna::Graphing::R.line_graph(
|
52
52
|
k_p_points,
|
53
|
-
options[:title] || "%s\\n%s\\n%s" % [self.class.name, data.seq, data.safe_structure],
|
54
|
-
|
53
|
+
title: options[:title] || "%s\\n%s\\n%s" % [self.class.name, data.seq, data.safe_structure],
|
54
|
+
filename: false
|
55
55
|
)
|
56
56
|
end
|
57
57
|
|
data/lib/vienna_rna.rb
CHANGED
@@ -63,6 +63,10 @@ unless defined? RNA
|
|
63
63
|
end
|
64
64
|
|
65
65
|
module RNA
|
66
|
+
def self.load_all(pattern: "*.fa")
|
67
|
+
Dir[pattern].map { |file| RNA.from_fasta(file) }
|
68
|
+
end
|
69
|
+
|
66
70
|
def self.random(size, *args)
|
67
71
|
RNA.from_array(args.unshift(ViennaRna::Global::Rna.generate_sequence(size).seq))
|
68
72
|
end
|
metadata
CHANGED
@@ -1,33 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vienna_rna
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
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: 2014-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: shuffle
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.1'
|
31
34
|
- - ">="
|
32
35
|
- !ruby/object:Gem::Version
|
33
36
|
version: 0.1.0
|
@@ -35,6 +38,9 @@ dependencies:
|
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.1'
|
38
44
|
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
46
|
version: 0.1.0
|
@@ -42,6 +48,9 @@ dependencies:
|
|
42
48
|
name: rinruby
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.0'
|
45
54
|
- - ">="
|
46
55
|
- !ruby/object:Gem::Version
|
47
56
|
version: 2.0.3
|
@@ -49,6 +58,9 @@ dependencies:
|
|
49
58
|
prerelease: false
|
50
59
|
version_requirements: !ruby/object:Gem::Requirement
|
51
60
|
requirements:
|
61
|
+
- - "~>"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '2.0'
|
52
64
|
- - ">="
|
53
65
|
- !ruby/object:Gem::Version
|
54
66
|
version: 2.0.3
|
@@ -56,6 +68,9 @@ dependencies:
|
|
56
68
|
name: rroc
|
57
69
|
requirement: !ruby/object:Gem::Requirement
|
58
70
|
requirements:
|
71
|
+
- - "~>"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0.1'
|
59
74
|
- - ">="
|
60
75
|
- !ruby/object:Gem::Version
|
61
76
|
version: 0.1.1
|
@@ -63,6 +78,9 @@ dependencies:
|
|
63
78
|
prerelease: false
|
64
79
|
version_requirements: !ruby/object:Gem::Requirement
|
65
80
|
requirements:
|
81
|
+
- - "~>"
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0.1'
|
66
84
|
- - ">="
|
67
85
|
- !ruby/object:Gem::Version
|
68
86
|
version: 0.1.1
|
@@ -73,6 +91,8 @@ executables: []
|
|
73
91
|
extensions: []
|
74
92
|
extra_rdoc_files: []
|
75
93
|
files:
|
94
|
+
- README.md
|
95
|
+
- lib/vienna_rna.rb
|
76
96
|
- lib/vienna_rna/global/chain_extensions.rb
|
77
97
|
- lib/vienna_rna/global/parser.rb
|
78
98
|
- lib/vienna_rna/global/rna.rb
|
@@ -82,20 +102,21 @@ files:
|
|
82
102
|
- lib/vienna_rna/package/base.rb
|
83
103
|
- lib/vienna_rna/package/energy_grid_2d.rb
|
84
104
|
- lib/vienna_rna/package/eval.rb
|
105
|
+
- lib/vienna_rna/package/fft_mfpt.rb
|
85
106
|
- lib/vienna_rna/package/fftbor.rb
|
86
107
|
- lib/vienna_rna/package/fftbor2d.rb
|
87
108
|
- lib/vienna_rna/package/ffthairpin.rb
|
88
109
|
- lib/vienna_rna/package/fftmultiloop.rb
|
89
110
|
- lib/vienna_rna/package/fold.rb
|
90
111
|
- lib/vienna_rna/package/heat.rb
|
112
|
+
- lib/vienna_rna/package/kinwalker.rb
|
91
113
|
- lib/vienna_rna/package/mfpt.rb
|
92
114
|
- lib/vienna_rna/package/rna2dfold.rb
|
93
115
|
- lib/vienna_rna/package/rnabor.rb
|
116
|
+
- lib/vienna_rna/package/spectral.rb
|
94
117
|
- lib/vienna_rna/package/subopt.rb
|
95
118
|
- lib/vienna_rna/package/tabu_path.rb
|
96
119
|
- lib/vienna_rna/package/xbor.rb
|
97
|
-
- lib/vienna_rna.rb
|
98
|
-
- README.md
|
99
120
|
homepage: http://rubygems.org/gems/vienna_rna
|
100
121
|
licenses: []
|
101
122
|
metadata: {}
|
@@ -115,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
136
|
version: '0'
|
116
137
|
requirements: []
|
117
138
|
rubyforge_project:
|
118
|
-
rubygems_version: 2.1
|
139
|
+
rubygems_version: 2.2.1
|
119
140
|
signing_key:
|
120
141
|
specification_version: 4
|
121
142
|
summary: Bindings to the Vienna RNA package, and other major command line utilities
|