e3a70223f6cadd639e39786ec63cca8d18a1ca58
[arvados-tutorial.git] / cwl / helper / getgvcfs.cwl
1 $namespaces:
2   arv: "http://arvados.org/cwl#"
3   cwltool: "http://commonwl.org/cwltool#"
4 class: ExpressionTool
5 cwlVersion: v1.1
6 label: Create array of gvcfs to process
7 requirements:
8   InlineJavascriptRequirement: {}
9 inputs:
10   gvcfdir:
11     type: Directory
12     label: Input directory of gvcfs
13     loadListing: 'shallow_listing' 
14 outputs:
15   sampleinput: 
16     type: string
17 expression: |
18   ${
19     var samples = [];
20     for (var i = 0; i < inputs.gvcfdir.listing.length; i++) {
21       var name = inputs.gvcfdir.listing[i];
22       if (name.nameext ==='.gz' ) {
23         samples.push(name.basename);
24       }
25     }
26     samples = samples.sort();
27     var sampleinput = [];
28    
29     for (var i = 0; i < samples.length; i++) {
30      var s1 = samples[i];
31      sampleinput = sampleinput + "-I " + s1 + " "
32     }
33
34
35     return {"sampleinput": sampleinput};
36
37   }