rbbt-util 5.17.14 → 5.17.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/workflow/accessor.rb +10 -5
- data/share/rbbt_commands/study/maf2study +58 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2f8120450462e267978ac9286e307bd6d29479c
|
4
|
+
data.tar.gz: a69e4f7c3487a7f66c45da5d7373b3bc082247c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4674ad60cab9dd516b0f11de1487e1bbcf59b5136ffe208b238d2c05722c8a522d5048e9983e59af3083a9c7ca3d766c25dac3f13edbe55c4b00a320294b50f
|
7
|
+
data.tar.gz: 54f233ae85fbc65cecb5f541951c894ae85b8190aec13cd808696df9675e2a3041fe59d7929c1d487603fdbae7ac130259c437a711b543c752537257b889eb36
|
@@ -230,7 +230,8 @@ class Step
|
|
230
230
|
end
|
231
231
|
|
232
232
|
def progress_bar(msg, options = {})
|
233
|
-
|
233
|
+
max = options[:max]
|
234
|
+
Log::ProgressBar.new max, {:desc => msg, :file => file(:progress)}.merge(options)
|
234
235
|
end
|
235
236
|
|
236
237
|
def self.log(status, message, path, &block)
|
@@ -414,6 +415,7 @@ module Workflow
|
|
414
415
|
end
|
415
416
|
|
416
417
|
|
418
|
+
iii inputs
|
417
419
|
dependencies = task_dependencies[name].select{|dep| String === dep or Symbol === dep}
|
418
420
|
{ :id => File.join(self.to_s, name.to_s),
|
419
421
|
:description => description,
|
@@ -430,7 +432,8 @@ module Workflow
|
|
430
432
|
end
|
431
433
|
|
432
434
|
def rec_dependencies(taskname)
|
433
|
-
@rec_dependencies ||=
|
435
|
+
@rec_dependencies ||= {}
|
436
|
+
@rec_dependencies[taskname] ||= begin
|
434
437
|
if task_dependencies.include? taskname
|
435
438
|
deps = task_dependencies[taskname]
|
436
439
|
all_deps = deps.select{|dep| String === dep or Symbol === dep or Array === dep}
|
@@ -470,13 +473,15 @@ module Workflow
|
|
470
473
|
task
|
471
474
|
end
|
472
475
|
|
473
|
-
def rec_inputs(taskname)
|
474
|
-
|
475
|
-
end
|
476
|
+
#def rec_inputs(taskname)
|
477
|
+
# [taskname].concat(rec_dependencies(taskname)).inject([]){|acc, tn| acc.concat(task_from_dep(tn).inputs) }.uniq
|
478
|
+
#end
|
476
479
|
|
477
480
|
def rec_inputs(taskname)
|
478
481
|
task = task_from_dep(taskname)
|
482
|
+
iii rec_dependencies(taskname)
|
479
483
|
dep_inputs = task.dep_inputs rec_dependencies(taskname), self
|
484
|
+
iii dep_inputs
|
480
485
|
task.inputs + dep_inputs.values.flatten
|
481
486
|
end
|
482
487
|
|
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rbbt-util'
|
4
|
+
require 'rbbt/util/simpleopt'
|
5
|
+
|
6
|
+
$0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands
|
7
|
+
|
8
|
+
options = SOPT.setup <<EOF
|
9
|
+
|
10
|
+
Convert MAF file to Rbbt study
|
11
|
+
|
12
|
+
$ rbbt study maf2study [options] <filename.maf> <directory>
|
13
|
+
|
14
|
+
-h--help Print this help
|
15
|
+
-o--organism* Organism code
|
16
|
+
-w--watson Mutations reported in Watson strand
|
17
|
+
|
18
|
+
EOF
|
19
|
+
rbbt_usage and exit 0 if options[:help]
|
20
|
+
|
21
|
+
raise ParameterException, "Need MAF file and directory" unless ARGV.length == 2
|
22
|
+
|
23
|
+
file, directory = ARGV
|
24
|
+
|
25
|
+
|
26
|
+
fields = ['Chrom', 'Start_Position', 'Reference_Allele', 'Tumor_Seq_Allele2','Tumor_Sample_Barcode']
|
27
|
+
all_fields = TSV.parse_header(file, :header_hash => '').all_fields
|
28
|
+
field_pos = fields.collect{|f| all_fields.index f}
|
29
|
+
|
30
|
+
sample_mutations = {}
|
31
|
+
first = true
|
32
|
+
TSV.traverse file, :header_hash => '', :type => :array do |line|
|
33
|
+
if first
|
34
|
+
first = false
|
35
|
+
next
|
36
|
+
end
|
37
|
+
chr, pos, ref, mut, sample = line.split("\t").values_at *field_pos
|
38
|
+
pos, muts = Misc.correct_icgc_mutation(pos, ref, mut)
|
39
|
+
muts.each do |mut|
|
40
|
+
mut = [chr, pos, mut] * ":"
|
41
|
+
sample = sample.split("-").values_at(0,1,2) * "-" if sample =~ /TCGA/
|
42
|
+
sample_mutations[sample] ||= []
|
43
|
+
sample_mutations[sample] << mut
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
genotype_dir = File.join(directory, 'genotypes')
|
48
|
+
FileUtils.mkdir_p genotype_dir
|
49
|
+
|
50
|
+
sample_mutations.each do |sample, mutations|
|
51
|
+
Open.write(File.join(genotype_dir, sample), mutations * "\n")
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
metadata_yaml = File.join(directory, 'metadata.yaml')
|
56
|
+
|
57
|
+
metadata = {:organism => "Hsa/feb2014", :watson => "true"}.merge options
|
58
|
+
Open.write(metadata_yaml, metadata.to_yaml)
|
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.15
|
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-04-
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -301,6 +301,7 @@ files:
|
|
301
301
|
- share/rbbt_commands/stat/abs
|
302
302
|
- share/rbbt_commands/stat/density
|
303
303
|
- share/rbbt_commands/stat/log
|
304
|
+
- share/rbbt_commands/study/maf2study
|
304
305
|
- share/rbbt_commands/study/task
|
305
306
|
- share/rbbt_commands/system/clean
|
306
307
|
- share/rbbt_commands/system/deleted_files
|
@@ -431,7 +432,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
431
432
|
version: '0'
|
432
433
|
requirements: []
|
433
434
|
rubyforge_project:
|
434
|
-
rubygems_version: 2.
|
435
|
+
rubygems_version: 2.2.2
|
435
436
|
signing_key:
|
436
437
|
specification_version: 4
|
437
438
|
summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
|