rbbt-util 5.25.46 → 5.25.47
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/rbbt/util/config.rb +1 -1
- data/lib/rbbt/util/misc/inspect.rb +13 -0
- data/lib/rbbt/util/misc/omics.rb +18 -0
- data/lib/rbbt/workflow/accessor.rb +4 -0
- data/lib/rbbt/workflow/provenance.rb +9 -8
- data/lib/rbbt/workflow/step.rb +5 -4
- data/share/rbbt_commands/system/status +1 -1
- data/share/rbbt_commands/workflow/trace +64 -12
- data/test/rbbt/util/test_misc.rb +6 -0
- 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: 07dd5ab637d8ab626487a17775efe56830ba49d3
|
|
4
|
+
data.tar.gz: 83b9ca45962531d0a320c31fe6624b2dceb939fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e92de8699285124584a83188e1475dd957e5bf6e20b568aebb2c7c06104e763ec2063275e09c8273778e2d5f111c8793f0fc242a0a64ff14797714a0b106a23e
|
|
7
|
+
data.tar.gz: c0dd02ec8593f146a2b06a9bfd66360e2e30769e45f5dd8445865fc981672d97243699076b74abbece10197a1eaf2923a1c3a741392945278a81d0a9f4be5141
|
data/lib/rbbt/util/config.rb
CHANGED
|
@@ -110,7 +110,7 @@ module Rbbt::Config
|
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
-
value = priorities.empty? ? default : priorities.sort_by{|p,v| p}.first.last.first
|
|
113
|
+
value = priorities.empty? ? default : priorities.collect{|p| p }.reverse.sort_by{|p,v| p}.first.last.first
|
|
114
114
|
value = false if value == 'false'
|
|
115
115
|
|
|
116
116
|
Log.debug "Value #{value.inspect} for config key '#{ key }': #{tokens * ", "}"
|
|
@@ -374,6 +374,19 @@ module Misc
|
|
|
374
374
|
obj2digest(obj)
|
|
375
375
|
end
|
|
376
376
|
|
|
377
|
+
def self.file2md5(file)
|
|
378
|
+
if File.exists?(file + '.md5')
|
|
379
|
+
Open.read(file + '.md5')
|
|
380
|
+
else
|
|
381
|
+
md5 = CMD.cmd("md5sum '#{file}'").read.strip.split(" ").first
|
|
382
|
+
begin
|
|
383
|
+
Open.write(file + '.md5', md5)
|
|
384
|
+
rescue
|
|
385
|
+
end
|
|
386
|
+
md5
|
|
387
|
+
end
|
|
388
|
+
end
|
|
389
|
+
|
|
377
390
|
def self.get_filename(obj)
|
|
378
391
|
if obj.respond_to? :filename
|
|
379
392
|
obj.filename
|
data/lib/rbbt/util/misc/omics.rb
CHANGED
|
@@ -328,6 +328,8 @@ module Misc
|
|
|
328
328
|
end
|
|
329
329
|
|
|
330
330
|
def self.chr_cmp_strict(chr1, chr2)
|
|
331
|
+
chr1 = chr1.sub(/^chr/)
|
|
332
|
+
chr2 = chr2.sub(/^chr/)
|
|
331
333
|
if (m1 = chr1.match(/(\d+)$/)) && (m2 = chr2.match(/(\d+)$/))
|
|
332
334
|
m1[1].to_i <=> m2[1].to_i
|
|
333
335
|
elsif chr1 =~ /\d+$/
|
|
@@ -339,6 +341,10 @@ module Misc
|
|
|
339
341
|
end
|
|
340
342
|
end
|
|
341
343
|
|
|
344
|
+
def self.chr_cmp_contigs(chr1, chr2, contigs)
|
|
345
|
+
contigs.index(chr1) <=> contigs.index(chr2)
|
|
346
|
+
end
|
|
347
|
+
|
|
342
348
|
def self.genomic_location_cmp(gpos1, gpos2, sep = ":")
|
|
343
349
|
chr1, _sep, pos1 = gpos1.partition(sep)
|
|
344
350
|
chr2, _sep, pos2 = gpos2.partition(sep)
|
|
@@ -363,6 +369,18 @@ module Misc
|
|
|
363
369
|
end
|
|
364
370
|
end
|
|
365
371
|
|
|
372
|
+
def self.genomic_location_cmp_contigs(gpos1, gpos2, contigs, sep = ":")
|
|
373
|
+
chr1, _sep, pos1 = gpos1.partition(sep)
|
|
374
|
+
chr2, _sep, pos2 = gpos2.partition(sep)
|
|
375
|
+
iii [gpos1, gpos2, chr1, chr2]
|
|
376
|
+
cmp = chr_cmp_contigs(chr1, chr2, contigs)
|
|
377
|
+
case cmp
|
|
378
|
+
when 0
|
|
379
|
+
pos1.to_i <=> pos2.to_i
|
|
380
|
+
else
|
|
381
|
+
cmp
|
|
382
|
+
end
|
|
383
|
+
end
|
|
366
384
|
def self.intersect_streams_cmp_chr(chr1, chr2)
|
|
367
385
|
chr1 <=> chr2
|
|
368
386
|
end
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
class Step
|
|
2
2
|
def self.prov_status_msg(status)
|
|
3
3
|
color = case status.to_sym
|
|
4
|
-
when :error, :aborted, :missing, :dead
|
|
4
|
+
when :error, :aborted, :missing, :dead, :unsync
|
|
5
5
|
:red
|
|
6
6
|
when :streaming, :started
|
|
7
7
|
:cyan
|
|
8
|
-
when :done
|
|
8
|
+
when :done, :noinfo
|
|
9
9
|
:green
|
|
10
|
-
when :
|
|
11
|
-
:blue
|
|
12
|
-
when :dependencies, :waiting, :setyp
|
|
10
|
+
when :dependencies, :waiting, :setup
|
|
13
11
|
:yellow
|
|
12
|
+
when :notfound
|
|
13
|
+
:blue
|
|
14
14
|
else
|
|
15
15
|
if status.to_s.index ">"
|
|
16
16
|
:cyan
|
|
@@ -27,7 +27,7 @@ class Step
|
|
|
27
27
|
task = Log.color(:yellow, parts.pop)
|
|
28
28
|
workflow = Log.color(:magenta, parts.pop)
|
|
29
29
|
if status.to_s == 'noinfo' and parts.last != 'jobs'
|
|
30
|
-
task, status, workflow = Log.color(:yellow, info[:task_name]), Log.color(:
|
|
30
|
+
task, status, workflow = Log.color(:yellow, info[:task_name]), Log.color(:green, "file"), Log.color(:magenta, "-")
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
path_mtime = begin
|
|
@@ -73,7 +73,8 @@ class Step
|
|
|
73
73
|
status = info[:status] || :missing
|
|
74
74
|
status = "remote" if Open.remote?(path)
|
|
75
75
|
name = info[:name] || File.basename(path)
|
|
76
|
-
status = :unsync if status == :done and not Open.exist?
|
|
76
|
+
status = :unsync if status == :done and not Open.exist?(path)
|
|
77
|
+
status = :notfound if status == :noinfo and not Open.exist?(path)
|
|
77
78
|
str = " " * offset
|
|
78
79
|
str << prov_report_msg(status, name, path, info)
|
|
79
80
|
step.dependencies.each do |dep|
|
|
@@ -83,7 +84,7 @@ class Step
|
|
|
83
84
|
seen << path
|
|
84
85
|
str << prov_report(dep, offset + 1, task, seen)
|
|
85
86
|
else
|
|
86
|
-
str << Log.color(:
|
|
87
|
+
str << Log.color(:green, Log.uncolor(prov_report(dep, offset+1, task)))
|
|
87
88
|
end
|
|
88
89
|
end if step.dependencies
|
|
89
90
|
str
|
data/lib/rbbt/workflow/step.rb
CHANGED
|
@@ -296,6 +296,7 @@ class Step
|
|
|
296
296
|
def self.clean(path)
|
|
297
297
|
info_file = Step.info_file path
|
|
298
298
|
pid_file = Step.pid_file path
|
|
299
|
+
md5_file = Step.md5_file path
|
|
299
300
|
files_dir = Step.files_dir path
|
|
300
301
|
|
|
301
302
|
if ! (Open.writable?(path) && Open.writable?(info_file))
|
|
@@ -309,11 +310,11 @@ class Step
|
|
|
309
310
|
@pid = nil
|
|
310
311
|
|
|
311
312
|
Misc.insist do
|
|
312
|
-
Open.rm info_file if Open.exists?
|
|
313
|
+
Open.rm info_file if Open.exists?(info_file)
|
|
314
|
+
Open.rm md5_file if Open.exists?(md5_file)
|
|
313
315
|
Open.rm path if (Open.exists?(path) or Open.broken_link?(path))
|
|
314
|
-
Open.
|
|
315
|
-
Open.
|
|
316
|
-
Open.rm pid_file if Open.exists? pid_file
|
|
316
|
+
Open.rm_rf files_dir if Open.exists?(files_dir)
|
|
317
|
+
Open.rm pid_file if Open.exists?(pid_file)
|
|
317
318
|
end
|
|
318
319
|
end
|
|
319
320
|
end
|
|
@@ -171,7 +171,7 @@ workflows.sort.each do |workflow,tasks|
|
|
|
171
171
|
str = file.dup
|
|
172
172
|
if options[:quick] and i[:done]
|
|
173
173
|
status = 'done'
|
|
174
|
-
str << " #{
|
|
174
|
+
str << " #{ Step.prov_status_msg status }"
|
|
175
175
|
if inputs and inputs.any?
|
|
176
176
|
str << input_msg(file, inputs)
|
|
177
177
|
end
|
|
@@ -56,7 +56,7 @@ jobs.each do |job|
|
|
|
56
56
|
next unless job.done?
|
|
57
57
|
started = job.info[:started]
|
|
58
58
|
ddone = job.info[:done]
|
|
59
|
-
data[job.
|
|
59
|
+
data[[job.task_name.to_s, job.clean_name] * "."] = [job.workflow.to_s, job.task_name,started,ddone]
|
|
60
60
|
if min_start.nil?
|
|
61
61
|
min_start = started
|
|
62
62
|
else
|
|
@@ -70,21 +70,73 @@ jobs.each do |job|
|
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
data.add_field "Start.second" do |k,value|
|
|
74
|
+
value["Start"] - min_start
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
data.add_field "End.second" do |k,value|
|
|
78
|
+
value["End"] - min_start
|
|
79
|
+
end
|
|
80
80
|
|
|
81
81
|
Log.severity = 0
|
|
82
|
-
data.R_interactive <<-EOF
|
|
83
|
-
rbbt.require('timevis')
|
|
82
|
+
#data.R_interactive <<-EOF
|
|
83
|
+
# rbbt.require('timevis')
|
|
84
|
+
# data$id = rownames(data)
|
|
85
|
+
# data$content = data$Task
|
|
86
|
+
# data$start = data$Start
|
|
87
|
+
# data$end = data$End
|
|
88
|
+
#
|
|
89
|
+
# timevis(data)
|
|
90
|
+
#EOF
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
data.R <<-EOF, [:svg]
|
|
94
|
+
rbbt.require('tidyverse')
|
|
95
|
+
rbbt.require('ggplot2')
|
|
96
|
+
|
|
97
|
+
names(data) <- make.names(names(data))
|
|
84
98
|
data$id = rownames(data)
|
|
85
99
|
data$content = data$Task
|
|
86
100
|
data$start = data$Start
|
|
87
101
|
data$end = data$End
|
|
88
|
-
|
|
89
|
-
|
|
102
|
+
data$Project = data$Workflow
|
|
103
|
+
|
|
104
|
+
tasks = data
|
|
105
|
+
|
|
106
|
+
#theme_gantt <- function(base_size=11, base_family="Source Sans Pro Light") {
|
|
107
|
+
theme_gantt <- function(base_size=11, base_family="Sans Serif") {
|
|
108
|
+
ret <- theme_bw(base_size, base_family) %+replace%
|
|
109
|
+
theme(panel.background = element_rect(fill="#ffffff", colour=NA),
|
|
110
|
+
axis.title.x=element_text(vjust=-0.2), axis.title.y=element_text(vjust=1.5),
|
|
111
|
+
title=element_text(vjust=1.2, family="Source Sans Pro Semibold"),
|
|
112
|
+
panel.border = element_blank(), axis.line=element_blank(),
|
|
113
|
+
panel.grid.minor=element_blank(),
|
|
114
|
+
panel.grid.major.y = element_blank(),
|
|
115
|
+
panel.grid.major.x = element_line(size=0.5, colour="grey80"),
|
|
116
|
+
axis.ticks=element_blank(),
|
|
117
|
+
legend.position="bottom",
|
|
118
|
+
axis.title=element_text(size=rel(0.8), family="Source Sans Pro Semibold"),
|
|
119
|
+
strip.text=element_text(size=rel(1), family="Source Sans Pro Semibold"),
|
|
120
|
+
strip.background=element_rect(fill="#ffffff", colour=NA),
|
|
121
|
+
panel.spacing.y=unit(1.5, "lines"),
|
|
122
|
+
legend.key = element_blank())
|
|
123
|
+
|
|
124
|
+
ret
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
tasks.long <- tasks %>%
|
|
128
|
+
gather(date.type, task.date, -c(Project, Task, id, Start.second, End.second)) %>%
|
|
129
|
+
arrange(date.type, task.date) %>%
|
|
130
|
+
mutate(id = factor(id, levels=rev(unique(id)), ordered=TRUE))
|
|
131
|
+
|
|
132
|
+
x.breaks <- seq(length(tasks$Task) + 0.5 - 3, 0, by=-3)
|
|
133
|
+
|
|
134
|
+
timeline <- ggplot(tasks.long, aes(y=id, yend=id, x=Start.second, xend=End.second, colour=Task)) +
|
|
135
|
+
geom_segment() +
|
|
136
|
+
geom_vline(xintercept=x.breaks, colour="grey80", linetype="dotted") +
|
|
137
|
+
guides(colour=guide_legend(title=NULL)) +
|
|
138
|
+
labs(x=NULL, y=NULL) +
|
|
139
|
+
theme_gantt() + theme(axis.text.x=element_text(angle=45, hjust=1))
|
|
140
|
+
|
|
141
|
+
rbbt.png_plot('#{plot}', 'timeline', width=2000)
|
|
90
142
|
EOF
|
data/test/rbbt/util/test_misc.rb
CHANGED
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.25.
|
|
4
|
+
version: 5.25.47
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miguel Vazquez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-04-
|
|
11
|
+
date: 2019-04-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|