-- "$namespaces":
- arv: http://arvados.org/cwl#
- class: ExpressionTool
- doc: get the gct and vcf files, add other files
- expression: |
- $\{
- var fileArray = [];
-
- // get files from collection
- for (var j = 0; j < inputs.collectionArray.length; j++) {
- for (var i = 0; i < inputs.collectionArray[j].listing.length; i++) {
- var matchedName = inputs.collectionArray[j].listing[i].basename.match(/^(.+)(.gct|.vcf|.vcf.gz|.gct.tsv|.vcf.tsv)$/);
- if (matchedName) {
- var nameString = inputs.collectionArray[j].listing[i].basename.split(".")[0]
- fileArray.push(inputs.collectionArray[j].listing[i])
- }
- }
- }
-
- // get any other files from the input file array
- for (var i = 0; i < inputs.additionalFileArray.length; i++) {
- fileArray.push(inputs.additionalFileArray[i])
- }
-
-
- return {
- "collectedArray": fileArray,
- "nameString": nameString
- }
-
- }
- id: "#collectFiles.cwl"
- inputs:
- - id: "#collectFiles.cwl/additionalFileArray"
- type:
- items: File
- type: array
- - id: "#collectFiles.cwl/collectionArray"
- type:
- items: Directory
- type: array
- outputs:
- - id: "#collectFiles.cwl/collectedArray"
- type:
- items: File
- type: array
- - id: "#collectFiles.cwl/nameString"
- type: string
- requirements:
- - class: InlineJavascriptRequirement