-
Notifications
You must be signed in to change notification settings - Fork 10
/
bedtools-bam-pbc.cwl
85 lines (73 loc) · 2.23 KB
/
bedtools-bam-pbc.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
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
requirements:
- class: InlineJavascriptRequirement
- class: StepInputExpressionRequirement
label: "Compute library complexity"
doc: "This workflow compute library complexity"
inputs:
bam_file:
type: File
doc: BAM file to be analyzed
outputs:
out:
type: File
outputSource: count_awk/output
steps:
bamtobed:
run: ../../tools/bedtools/bedtools-bamtobed.cwl
in:
stdout:
valueFrom: ${ return inputs.i.nameroot + ".bed";}
i: bam_file
out: [out_stdout]
first_awk:
run: ../../tools/basic/awk.cwl
in:
outFileName:
valueFrom: ${ return inputs.file.nameroot + ".awk";}
file: bamtobed/out_stdout
text: { default: 'BEGIN{OFS="\t"}{print $1,$2,$3,$6}' }
out: [output]
filter_chrM:
run: ../../tools/basic/grep.cwl
in:
v: { default: True }
outFileName:
valueFrom: ${ return inputs.file.nameroot + ".grep";}
pattern: { default: 'chrM' }
file: first_awk/output
out: [output]
sort:
run: ../../tools/basic/sort.cwl
in:
outFileName:
valueFrom: ${ return inputs.file.nameroot + ".sort";}
file: filter_chrM/output
out: [output]
uniq:
run: ../../tools/basic/uniq.cwl
in:
c: { default: True }
outFileName:
valueFrom: ${ return inputs.file.nameroot + ".uniq";}
file: sort/output
out: [output]
count_awk:
run: ../../tools/basic/awk.cwl
in:
outFileName:
valueFrom: ${ return inputs.file.nameroot + ".pbc.qc";}
file: uniq/output
text: { default: 'BEGIN{mt=0;m0=0;m1=0;m2=0} ($1==1){m1=m1+1} ($1==2){m2=m2+1} {m0=m0+1} {mt=mt+$1} END{printf "%d\t%d\t%d\t%d\t%f\t%f\t%f\n",mt,m0,m1,m2,m0/mt,m1/m0,m1/m2}' }
out: [output]
s:author:
- class: s:Person
s:identifier: https://orcid.org/0000-0002-4108-5982
s:email: mailto:r78v10a07@gmail.com
s:name: Roberto Vera Alvarez
$namespaces:
s: http://schema.org/
$schemas:
- https://schema.org/version/latest/schemaorg-current-http.rdf