40a5c9dadd98e50ea9fd1c0a67402bf342170658
[arvados-tutorial.git] / cwl / helper / gather-vcf-try2.cwl
1 cwlVersion: v1.1
2 class: CommandLineTool
3 label: Gathering vcf using Picard 
4 $namespaces:
5   arv: "http://arvados.org/cwl#"
6   cwltool: "http://commonwl.org/cwltool#"
7
8 requirements:
9   DockerRequirement:
10     dockerPull: broadinstitute/gatk:4.1.7.0
11   ShellCommandRequirement: {}
12   InlineJavascriptRequirement: {}
13
14 hints:
15   ResourceRequirement:
16     ramMin: 20000
17     coresMin: 4    
18   arv:RuntimeConstraints:
19     outputDirType: keep_output_dir
20
21 inputs:
22   gvcfdir: 
23     type: Directory
24     label: Input directory of gvcfs
25     loadListing: 'shallow_listing'
26   sample: string
27   reference:
28     type: File
29     secondaryFiles:
30       - .amb
31       - .ann
32       - .bwt
33       - .pac
34       - .sa
35       - .fai
36       - ^.dict
37 outputs:
38   gatheredgvcf:
39     type: File
40     outputBinding:
41       glob: "*.g.vcf.gz"
42
43 baseCommand: /gatk/gatk
44
45 arguments:
46   - "--java-options"
47   - "-Xmx8G" 
48   - GatherVcfs
49   - shellQuote: false
50     valueFrom: >
51     ${
52     var samples = [];
53     for (var i = 0; i < inputs.gvcfdir.listing.length; i++) {
54       var name = inputs.gvcfdir.listing[i];
55       if (name.nameext ==='.gz' ) {
56         samples.push(name.basename);
57       }
58     }
59     samples = samples.sort();
60     var sampleinput = [];
61
62     for (var i = 0; i < samples.length; i++) {
63      var s1 = samples[i];
64      sampleinput = sampleinput + "-I " + s1 + " "
65     }
66     return sampleinput;
67     }
68   - prefix: "-O"
69     valueFrom: $(inputs.sample).g.vcf.gz