Merge branch 'main' into 19868-pca-in-ml
[lightning.git] / cwl / lightning / make-fastadirs.cwl
1 # Copyright (C) The Lightning Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 cwlVersion: v1.2
6 class: ExpressionTool
7 requirements:
8   InlineJavascriptRequirement: {}
9 hints:
10   LoadListingRequirement:
11     loadListing: shallow_listing
12 inputs:
13   fas:
14     type:
15       type: array
16       items:
17         type: array
18         items: File
19 outputs:
20   fastadirs: Directory[]
21 expression: |
22   ${
23     var fastadirs = [];
24     for (var i = 0; i < inputs.fas.length; i+=100) {
25       var fastadir = {"class": "Directory",
26                       "basename": "dir"+String(i/100),
27                       "listing": []};
28       for (var j = i; j < Math.min(i+100, inputs.fas.length); j+=1) {
29         fastadir.listing.push(inputs.fas[j][0]);
30         fastadir.listing.push(inputs.fas[j][1]);
31       }
32       fastadirs.push(fastadir);
33     }
34     return {"fastadirs": fastadirs};
35   }