X-Git-Url: https://git.arvados.org/arvados-tutorial.git/blobdiff_plain/92172b0bceb7af669a8dd09cea04c93e041dfe2e..64f689fcbaadb8fc17274f42d424c3ed72a4af37:/WGS-processing/cwl/helper/getfastq.cwl diff --git a/WGS-processing/cwl/helper/getfastq.cwl b/WGS-processing/cwl/helper/getfastq.cwl index a38bc91..c651771 100644 --- a/WGS-processing/cwl/helper/getfastq.cwl +++ b/WGS-processing/cwl/helper/getfastq.cwl @@ -7,15 +7,17 @@ label: Create array of gvcfs to process requirements: InlineJavascriptRequirement: {} inputs: - fastjdir: + fastqdir: type: Directory - label: Input directory of fastj + label: Input directory of fastqs loadListing: 'shallow_listing' outputs: fastq1: type: File[] fastq2: type: File[] + sample: + type: string[] expression: | ${function compare(a, b) { var baseA = a.basename; @@ -32,8 +34,8 @@ expression: | var fastq1 = []; var fastq2 = []; - for (var i = 0; i < inputs.fastjdir.listing.length; i++) { - var name = inputs.fastjdir.listing[i]; + for (var i = 0; i < inputs.fastqdir.listing.length; i++) { + var name = inputs.fastqdir.listing[i]; if (name.basename.indexOf('_1.fastq.gz') != -1 ) { fastq1.push(name); } @@ -44,6 +46,15 @@ expression: | fastq1 = fastq1.sort(compare) fastq2 = fastq2.sort(compare) + + var sample = []; + + for (var i = 0; i < fastq1.length; i++) { + var name = fastq1[i].basename; + var samplename = name.replace(/_1.fastq.gz/,''); + sample.push(samplename); + } + - return {"fastq1": fastq1, "fastq2": fastq2}; + return {"fastq1": fastq1, "fastq2": fastq2, "sample": sample}; }