aboutsummaryrefslogtreecommitdiff
path: root/workflows/pangenome-generate/relabel-seqs.cwl
blob: 367b9bfa56be47e57ff401977327e1badfadcfd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cwlVersion: v1.1
class: CommandLineTool
inputs:
  readsFA: File[]
  subjects: string[]
  exclude:
    type: File?
    inputBinding: {position: 2}
  script:
    type: File
    default: {class: File, location: relabel-seqs.py}
    inputBinding: {position: 1}
outputs:
  relabeledSeqs:
    type: File
    outputBinding:
      glob: relabeledSeqs.fasta
  originalLabels:
    type: File
    outputBinding:
      glob: originalLabels.ttl
requirements:
  InlineJavascriptRequirement: {}
  InitialWorkDirRequirement:
    listing: |
          ${
          var i = 0;
          var b = 1;
          var out = [];
          for (; i < inputs.readsFA.length; i++) {
            var block = [];
            var sub = [];
            for (; i < (b*150) && i < inputs.readsFA.length; i++) {
              block.push(inputs.readsFA[i]);
              sub.push(inputs.subjects[i]);
            }
            out.push({
              entryname: "block"+b,
              entry: JSON.stringify(block)
            });
            out.push({
              entryname: "subs"+b,
              entry: JSON.stringify(sub)
            });
            b++;
          }
          return out;
          }
hints:
  DockerRequirement:
    dockerPull: commonworkflowlanguage/cwltool_module
stdout:
baseCommand: [python]