c5d5f66fd8789e2a5e76fa5cd54c70ca69649b22
[arvados-workbench2.git] / cypress / fixtures / workflow_with_array_fields.yaml
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 ---
6 "$graph":
7 - "$namespaces":
8     arv: http://arvados.org/cwl#
9   class: ExpressionTool
10   doc: get the gct and vcf files, add other files
11   expression: |
12     $\{
13       var fileArray = [];
14
15       // get files from collection
16       for (var j = 0; j < inputs.collectionArray.length; j++) {
17         for (var i = 0; i < inputs.collectionArray[j].listing.length; i++) {
18           var matchedName = inputs.collectionArray[j].listing[i].basename.match(/^(.+)(.gct|.vcf|.vcf.gz|.gct.tsv|.vcf.tsv)$/);
19           if (matchedName) {
20             var nameString = inputs.collectionArray[j].listing[i].basename.split(".")[0]
21             fileArray.push(inputs.collectionArray[j].listing[i])
22           }
23         }
24       }
25
26       // get any other files from the input file array
27       for (var i = 0; i < inputs.additionalFileArray.length; i++) {
28         fileArray.push(inputs.additionalFileArray[i])
29       }
30
31
32       return {
33         "collectedArray": fileArray,
34         "nameString": nameString
35       }
36
37     }
38   id: "#collectFiles.cwl"
39   inputs:
40   - id: "#collectFiles.cwl/additionalFileArray"
41     type:
42       items: File
43       type: array
44   - id: "#collectFiles.cwl/collectionArray"
45     type:
46       items: Directory
47       type: array
48   outputs:
49   - id: "#collectFiles.cwl/collectedArray"
50     type:
51       items: File
52       type: array
53   - id: "#collectFiles.cwl/nameString"
54     type: string
55   requirements:
56   - class: InlineJavascriptRequirement
57 - class: Workflow
58   doc: A workflow to collect .gct and .vcf files files and store them together with
59     specified metainformation files. Mostly used to create a collection for genestack
60     upload. Can only be run on the WB2.
61   hints:
62   - class: ResourceRequirement
63     coresMin: 1
64     ramMin: 85000
65   id: "#main"
66   inputs:
67   - default:
68     - basename: metainfo.txt
69       class: File
70       location: keep:1cd1dbc27dc10fa8aaaf8fa19efd3bb8+237/metainfo.txt
71       nameext: ".txt"
72       nameroot: metainfo
73       size: 0
74     - basename: test11.txt
75       class: File
76       location: keep:1cd1dbc27dc10fa8aaaf8fa19efd3bb8+237/test11.txt
77       nameext: ".txt"
78       nameroot: test11
79       size: 0
80     doc: This input allows you to add any number of additional files to be integrated
81       in the output collection.
82     id: "#main/additionalFileArray"
83     label: Files
84     type:
85       items: File
86       type: array
87   - default:
88     - basename: collection1
89       class: Directory
90       location: keep:1cd1dbc27dc10fa8aaaf8fa19efd3bb8+237/collection1
91     - basename: collection2
92       class: Directory
93       location: keep:1cd1dbc27dc10fa8aaaf8fa19efd3bb8+237/collection2
94     doc: This input allows you to specify collections to integrate. From these collections,
95       all files that end with .gct or .vcf will be extracted.
96     id: "#main/collectionArray"
97     label: Collections
98     type:
99       items: Directory
100       type: array
101   outputs:
102   - id: "#main/genestackArray"
103     outputSource: "#main/collectFiles/collectedArray"
104     type:
105       items: File
106       type: array
107   requirements:
108   - class: SubworkflowFeatureRequirement
109   - class: ScatterFeatureRequirement
110   - class: StepInputExpressionRequirement
111   - class: InlineJavascriptRequirement
112   steps:
113   - id: "#main/collectFiles"
114     in:
115     - id: "#main/collectFiles/additionalFileArray"
116       source: "#main/additionalFileArray"
117     - id: "#main/collectFiles/collectionArray"
118       source: "#main/collectionArray"
119     out:
120     - "#main/collectFiles/collectedArray"
121     run: "#collectFiles.cwl"
122 cwlVersion: v1.0