/
tmb.cwl
75 lines (68 loc) · 1.98 KB
/
tmb.cwl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
doc: "
Workflow for calculating TMB tumor mutational burden on a single sample
"
requirements:
StepInputExpressionRequirement: {}
InlineJavascriptRequirement: {}
inputs:
mutations_file:
type: File
doc: "File with mutations for the sample"
assay_coverage:
type: string
doc: "genome_coverage value; amount of the genome in bp covered by the assay"
sample_id:
type: string
normal_id:
type: string
steps:
# filter the variant maf file for only the variants desired for use in TMB calculation
filter_variants:
run: tmb_variant_filter.cwl
in:
input_file: mutations_file
output_filename:
valueFrom: ${ return "filter_variants.maf"; }
out:
[ output_file ]
# calculate the TMB for the variants present + assay coverage
calc_tmb_value:
run: calc-tmb.cwl
in:
input_file: filter_variants/output_file
output_filename:
valueFrom: ${ return "tmb.txt"; }
genome_coverage: assay_coverage
normal_id: normal_id
out:
[ output_file ]
# turn the TMB value into a table format with header
fix_tmb_header:
run: add_header.cwl
in:
input_file: calc_tmb_value/output_file
header_str:
valueFrom: ${ return "CMO_TMB_SCORE"; }
out:
[ output_file ]
# add the sample ID back to the TMB table file
add_sampleID:
run: paste-col.cwl
in:
sample_id: sample_id
normal_id: normal_id
input_file: fix_tmb_header/output_file
output_filename: # NOTE: we plan to concat this file later so it needs to have a unique filename !!
valueFrom: ${ return inputs.sample_id + "." + inputs.normal_id + ".tmb.tsv"; }
header:
valueFrom: ${ return "SampleID"; }
value: sample_id
out:
[ output_file ]
outputs:
output_file:
type: File
outputSource: add_sampleID/output_file