1
+ #!/usr/bin/env cwl-runner
2
+ cwlVersion: v1.0
3
+ class: CommandLineTool
4
+
5
+ requirements :
6
+ - class: InlineJavascriptRequirement
7
+ - class: ShellCommandRequirement
8
+
9
+ hints :
10
+ - class: DockerRequirement
11
+ dockerPull: biowardrobe2/bamtools:v2.4.1
12
+ - class: SoftwareRequirement
13
+ packages :
14
+ bamtools:
15
+ specs : [ "http://identifiers. org/biotools/bamtools" ]
16
+ version : [ "2. 4. 1" ]
17
+
18
+ inputs :
19
+
20
+ bam_file:
21
+ type :
22
+ - File
23
+ inputBinding :
24
+ position : 2
25
+ prefix : -in
26
+ doc : |
27
+ the input BAM file
28
+
29
+ outputs :
30
+
31
+ log_file:
32
+ type : File
33
+ outputBinding :
34
+ glob : "stats. log"
35
+
36
+ total_reads_number:
37
+ type : int
38
+ outputBinding :
39
+ loadContents : true
40
+ glob : "stats. log"
41
+ outputEval : |
42
+ ${
43
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
44
+ var totalReads = parseInt(s.substring ( s.indexOf("Totalreads" )+11, s.indexOf("\t" , (s.indexOf("Totalreads" ))) ));
45
+ return totalReads;
46
+ }
47
+
48
+ mapped_reads_number:
49
+ type : int
50
+ outputBinding :
51
+ loadContents : true
52
+ glob : "stats. log"
53
+ outputEval : |
54
+ ${
55
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
56
+ var mappedreads = parseInt(s.substring ( s.indexOf("Mappedreads" )+12, s.indexOf("\t" , (s.indexOf("Mappedreads" ))) ));
57
+ return mappedreads;
58
+ }
59
+
60
+ forward_strand_reads_number:
61
+ type : int
62
+ outputBinding :
63
+ loadContents : true
64
+ glob : "stats. log"
65
+ outputEval : |
66
+ ${
67
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
68
+ var forwardstrand = parseInt(s.substring ( s.indexOf("Forwardstrand" )+14, s.indexOf("\t" , (s.indexOf("Forwardstrand" ))) ));
69
+ return forwardstrand;
70
+ }
71
+
72
+ reverse_strand_reads_number:
73
+ type : int
74
+ outputBinding :
75
+ loadContents : true
76
+ glob : "stats. log"
77
+ outputEval : |
78
+ ${
79
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
80
+ var reversestrand = parseInt(s.substring ( s.indexOf("Reversestrand" )+14, s.indexOf("\t" , (s.indexOf("Reversestrand" ))) ));
81
+ return reversestrand;
82
+ }
83
+
84
+ failed_QC_reads_number:
85
+ type : int
86
+ outputBinding :
87
+ loadContents : true
88
+ glob : "stats. log"
89
+ outputEval : |
90
+ ${
91
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
92
+ var failedQC = parseInt(s.substring ( s.indexOf("FailedQC" )+9, s.indexOf("\t" , (s.indexOf("FailedQC" ))) ));
93
+ return failedQC;
94
+ }
95
+
96
+ duplicate_reads_number:
97
+ type : int
98
+ outputBinding :
99
+ loadContents : true
100
+ glob : "stats. log"
101
+ outputEval : |
102
+ ${
103
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
104
+ var duplicates = parseInt(s.substring ( s.indexOf("Duplicates" )+11, s.indexOf("\t" , (s.indexOf("Duplicates" ))) ));
105
+ return duplicates;
106
+ }
107
+
108
+ pairedend_reads_number:
109
+ type : int
110
+ outputBinding :
111
+ loadContents : true
112
+ glob : "stats. log"
113
+ outputEval : |
114
+ ${
115
+ var s = self[0].contents.replace(/ /g,'' ).replace(/ *\([^)]*\) */g,'' );
116
+ var pairedendreads = parseInt(s.substring ( s.indexOf("Paired-endreads" )+16, s.indexOf("\t" , (s.indexOf("Paired-endreads" ))) ));
117
+ return pairedendreads;
118
+ }
119
+
120
+ baseCommand : [bamtools, stats]
121
+ arguments :
122
+ - valueFrom : $('> ' + 'stats. log' )
123
+ position : 1000
124
+ shellQuote : false
125
+
126
+ $namespaces:
127
+ s: http://schema.org/
128
+
129
+ $schemas:
130
+ - http://schema.org/version/9.0/schemaorg-current-http.rdf
131
+
132
+ s:name: "bamtools_stats"
133
+ s:license: http://www.apache.org/licenses/LICENSE-2.0
134
+
135
+ s:isPartOf:
136
+ class: s:CreativeWork
137
+ s:name: Common Workflow Language
138
+ s:url: http://commonwl.org/
139
+
140
+ s:creator:
141
+ - class: s:Organization
142
+ s:legalName: "Cincinnati Children's Hospital Medical Center"
143
+ s:location :
144
+ - class: s:PostalAddress
145
+ s:addressCountry: "USA"
146
+ s:addressLocality: "Cincinnati"
147
+ s:addressRegion: "OH"
148
+ s:postalCode: "45229"
149
+ s:streetAddress: "3333 Burnet Ave"
150
+ s:telephone: "+1(513)636-4200"
151
+ s:logo: "https://www. cincinnatichildrens. org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new. png"
152
+ s:department:
153
+ - class: s:Organization
154
+ s:legalName: "Allergy and Immunology"
155
+ s:department:
156
+ - class: s:Organization
157
+ s:legalName: "Barski Research Lab"
158
+ s:member:
159
+ - class: s:Person
160
+ s:name: Michael Kotliar
161
+
162
+ s:sameAs:
163
+ - id : http://orcid.org/0000-0002-6486-3898
164
+
165
+ doc : |
166
+ Tool runs `bamtools stats' to calculate general alignment statistics from the input BAM file
167
+
168
+ `-insert` parameter is not implemented
0 commit comments