rbbt-util 5.17.48 → 5.17.49
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/etc/app.d/workflows.rb +14 -1
- data/lib/rbbt/tsv/manipulate.rb +1 -1
- data/lib/rbbt/util/R/model.rb +1 -1
- data/lib/rbbt/util/misc/omics.rb +33 -0
- data/lib/rbbt/util/misc/pipes.rb +7 -7
- data/lib/rbbt/workflow/step.rb +0 -21
- data/share/rbbt_commands/workflow/server +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cfd7f56cde2409c43944909047d6345e5a7dddf4
|
|
4
|
+
data.tar.gz: 32c27e5b110dfa03aec714381aae151ce1ed04bd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0372f20697463b04b0d8b6df2a740a9eeaeb78ef856f127edbaec78cfab003350b6816336fc3f761bfd6b5473e67c034fe41fa92806fbd1920560f3c3350ac1b
|
|
7
|
+
data.tar.gz: 3bd6af1e63bc28c6e9eb7cf599857f50d527c18a8847a9554fc3f0899ba5ea6717b128187540f938053e8717a0bdb512e2b474fb289156f63751b1bd6800510b
|
data/etc/app.d/workflows.rb
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
register Sinatra::RbbtRESTWorkflow
|
|
2
2
|
|
|
3
3
|
Rbbt.etc.workflows.find.read.split("\n").each do |workflow|
|
|
4
|
+
add = true
|
|
5
|
+
|
|
6
|
+
if workflow =~ /(.*)\*$/
|
|
7
|
+
workflow = $1
|
|
8
|
+
add = :priority
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
if workflow =~ /(.*)\-$/
|
|
12
|
+
workflow = $1
|
|
13
|
+
add = false
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
|
|
4
17
|
next if workflow.empty?
|
|
5
18
|
Workflow.require_workflow workflow
|
|
6
|
-
add_workflow Kernel.const_get(workflow),
|
|
19
|
+
add_workflow Kernel.const_get(workflow), add
|
|
7
20
|
end if Rbbt.etc.workflows.find.exists?
|
data/lib/rbbt/tsv/manipulate.rb
CHANGED
data/lib/rbbt/util/R/model.rb
CHANGED
|
@@ -75,7 +75,7 @@ data = NULL
|
|
|
75
75
|
|
|
76
76
|
script = <<-EOF
|
|
77
77
|
model = rbbt.model.load('#{model_file}');
|
|
78
|
-
predict(model, data.frame(#{field} = #{R.ruby2R value}), interval=#{R.ruby2R interval});
|
|
78
|
+
predict(model, data.frame(#{field} = #{R.ruby2R value}), interval=#{R.ruby2R interval}, level=0.90);
|
|
79
79
|
EOF
|
|
80
80
|
|
|
81
81
|
res = R.eval_a script
|
data/lib/rbbt/util/misc/omics.rb
CHANGED
|
@@ -116,6 +116,9 @@ module Misc
|
|
|
116
116
|
"TGA" => "*",
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
def self.correct_mutation(pos, ref, mut_str)
|
|
120
|
+
end
|
|
121
|
+
|
|
119
122
|
def self.correct_icgc_mutation(pos, ref, mut_str)
|
|
120
123
|
mut = mut_str
|
|
121
124
|
mut = '-' * (mut_str.length - 1) if mut =~/^-[ACGT]/
|
|
@@ -123,6 +126,36 @@ module Misc
|
|
|
123
126
|
[pos, [mut]]
|
|
124
127
|
end
|
|
125
128
|
|
|
129
|
+
def self.correct_mutation(pos, ref, mut_str)
|
|
130
|
+
muts = mut_str.nil? ? [] : mut_str.split(',')
|
|
131
|
+
muts.collect!{|m| m == '<DEL>' ? '-' : m }
|
|
132
|
+
|
|
133
|
+
ref = '' if ref == '-'
|
|
134
|
+
while ref.length >= 1 and muts.reject{|m| m[0] == ref[0]}.empty?
|
|
135
|
+
ref = ref[1..-1]
|
|
136
|
+
raise "REF nil" if ref.nil?
|
|
137
|
+
pos = pos + 1
|
|
138
|
+
muts = muts.collect{|m| m[1..-1]}
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
muts = muts.collect do |m|
|
|
142
|
+
m = '' if m == '-'
|
|
143
|
+
case
|
|
144
|
+
when ref.empty?
|
|
145
|
+
"+" << m
|
|
146
|
+
when (m.length < ref.length and (m.empty? or ref.index(m)))
|
|
147
|
+
"-" * (ref.length - m.length)
|
|
148
|
+
when (ref.length == 1 and m.length == 1)
|
|
149
|
+
m
|
|
150
|
+
else
|
|
151
|
+
Log.debug{"Cannot understand: #{[ref, m]} (#{ muts })"}
|
|
152
|
+
'-' * ref.length + m
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
[pos, muts]
|
|
157
|
+
end
|
|
158
|
+
|
|
126
159
|
def self.correct_vcf_mutation(pos, ref, mut_str)
|
|
127
160
|
muts = mut_str.nil? ? [] : mut_str.split(',')
|
|
128
161
|
muts.collect!{|m| m == '<DEL>' ? '-' : m }
|
data/lib/rbbt/util/misc/pipes.rb
CHANGED
|
@@ -90,9 +90,9 @@ module Misc
|
|
|
90
90
|
stream_out1, stream_in1 = Misc.pipe
|
|
91
91
|
stream_out2, stream_in2 = Misc.pipe
|
|
92
92
|
|
|
93
|
-
if ConcurrentStream === stream
|
|
94
|
-
|
|
95
|
-
end
|
|
93
|
+
#if ConcurrentStream === stream
|
|
94
|
+
# stream.annotate stream_out1
|
|
95
|
+
#end
|
|
96
96
|
|
|
97
97
|
splitter_thread = Thread.new(Thread.current) do |parent|
|
|
98
98
|
begin
|
|
@@ -133,11 +133,11 @@ module Misc
|
|
|
133
133
|
ConcurrentStream.setup stream_out1, :threads => splitter_thread
|
|
134
134
|
ConcurrentStream.setup stream_out2, :threads => splitter_thread
|
|
135
135
|
|
|
136
|
-
stream_out1.callback = stream.callback if stream.respond_to? :callback
|
|
137
|
-
stream_out1.abort_callback = stream.abort_callback if stream.respond_to? :abort_callback
|
|
136
|
+
#stream_out1.callback = stream.callback if stream.respond_to? :callback
|
|
137
|
+
#stream_out1.abort_callback = stream.abort_callback if stream.respond_to? :abort_callback
|
|
138
138
|
|
|
139
|
-
stream_out2.callback = stream.callback if stream.respond_to? :callback
|
|
140
|
-
stream_out2.abort_callback = stream.abort_callback if stream.respond_to? :abort_callback
|
|
139
|
+
#stream_out2.callback = stream.callback if stream.respond_to? :callback
|
|
140
|
+
#stream_out2.abort_callback = stream.abort_callback if stream.respond_to? :abort_callback
|
|
141
141
|
|
|
142
142
|
[stream_out1, stream_out2]
|
|
143
143
|
end
|
data/lib/rbbt/workflow/step.rb
CHANGED
|
@@ -226,27 +226,6 @@ class Step
|
|
|
226
226
|
self
|
|
227
227
|
end
|
|
228
228
|
|
|
229
|
-
#def rec_dependencies
|
|
230
|
-
|
|
231
|
-
# # A step result with no info_file means that it was manually
|
|
232
|
-
# # placed. In that case, do not consider its dependencies
|
|
233
|
-
# return [] if Open.exists?(self.path.to_s) and not Open.exists? self.info_file
|
|
234
|
-
|
|
235
|
-
# return [] if dependencies.nil? or dependencies.empty?
|
|
236
|
-
|
|
237
|
-
# new_dependencies = []
|
|
238
|
-
# dependencies.each{|step|
|
|
239
|
-
# new_dependencies.concat step.rec_dependencies
|
|
240
|
-
# new_dependencies << step
|
|
241
|
-
# }
|
|
242
|
-
# new_dependencies.uniq!
|
|
243
|
-
|
|
244
|
-
# dependencies = self.dependencies ? self.dependencies + new_dependencies : new_dependencies
|
|
245
|
-
# dependencies.flatten!
|
|
246
|
-
# dependencies.uniq!
|
|
247
|
-
# dependencies
|
|
248
|
-
#end
|
|
249
|
-
|
|
250
229
|
def rec_dependencies
|
|
251
230
|
|
|
252
231
|
# A step result with no info_file means that it was manually
|
|
@@ -47,11 +47,11 @@ app.class_eval do
|
|
|
47
47
|
eval Rbbt.etc['app.d/finder.rb'].read
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
WorkflowRest.add_workflow wf, :
|
|
50
|
+
WorkflowRest.add_workflow wf, :priority
|
|
51
51
|
if options[:workflows]
|
|
52
52
|
options[:workflows].split(/[\s,]+/).each do |name|
|
|
53
53
|
_wf = Workflow.require_workflow name
|
|
54
|
-
WorkflowRest.add_workflow _wf,
|
|
54
|
+
WorkflowRest.add_workflow _wf, true
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
@@ -60,7 +60,6 @@ if options[:views] and not options[:views].empty?
|
|
|
60
60
|
Sinatra::RbbtRESTMain.add_resource_path(Path.setup(options[:views]), true)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
|
|
64
63
|
WorkflowRest.port = options[:port] || 4567
|
|
65
64
|
WorkflowRest.bind = options[:bind] || "0.0.0.0"
|
|
66
65
|
WorkflowRest.environment = options[:environment] || "development"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rbbt-util
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.17.
|
|
4
|
+
version: 5.17.49
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|