-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathget-vcfs.cwl
33 lines (33 loc) · 877 Bytes
/
get-vcfs.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
cwlVersion: v1.2
class: ExpressionTool
doc: "Process a directory of bgzipped and indexed vcf files into an array with indices as secondary files."
requirements:
InlineJavascriptRequirement: {}
hints:
LoadListingRequirement:
loadListing: shallow_listing
inputs:
vcfsdir: Directory
outputs:
vcfs:
type: File[]
secondaryFiles: [.tbi]
expression: |
${
var vcfs = [];
for (var i = 0; i < inputs.vcfsdir.listing.length; i++) {
var file = inputs.vcfsdir.listing[i];
if (file.nameext == '.gz') {
var main = file;
for (var j = 0; j < inputs.vcfsdir.listing.length; j++) {
var file = inputs.vcfsdir.listing[j];
if (file.basename == main.basename+".tbi") {
main.secondaryFiles = [file];
break;
}
}
vcfs.push(main);
}
}
return {"vcfs": vcfs};
}