<p>Ok, thanks to <a href="https://github.com/rhpvorderman" rel="nofollow noreferrer">Ruben Vorderman</a> on the <a href="https://github.com/openwdl/wdl/issues/427" rel="nofollow noreferrer">openwdl github page</a>, I found a solution that does not involve renaming the glob folder (which I believe is not possible?). The only way is to write out the names of the files and pass them explicitly to the Array[File] output. This is how I did it (simplified), in case it helps anyone else in the future:</p>
<pre><code>task fastqc_task {
  File forwardReads
  File reverseReads
  String fwdName = sub(basename(forwardReads),&quot;.f.*q.*<span class="math-container">$","")
  String revName = sub(basename(reverseReads),".f.*q.*$</span>&quot;,&quot;&quot;)
  command {
    mkdir -p ./qc/fastqc_zip
    fastqc <span class="math-container">${forwardReads} $</span>{reverseReads} --outdir ./qc/fastqc_zip
  }
  output {
    Array[File] fastqcArray = [&quot;./qc/fastqc_zip/<span class="math-container">${fwdName}_fastqc.zip", "./qc/fastqc_zip/$</span>{revName}_fastqc.zip&quot;]
  } 
}
</code></pre>

CC BY-SA 4.0
2020-12-03T23:40:44.707Z
2020-12-03T23:40:44.707Z
Mar
<p>I made a wdl (genomics pipeline language by the Broad Institute) task for fastqc that outputs the zip files, of which there will be as many as reads that the sample I'm working on at that moment has. We create the output using glob:</p>
<pre><code>  output {
    Array[File] fastqcArray = glob(&quot;*.zip&quot;)
  } 
</code></pre>
<p>I would like to give the folder a name that is representative of what it contains, for example <code>fastqc</code>, rather than glob-xxxxxxx, so that it's clear what it is in my task's output folder. Is this possible, and if so, how can I achieve it?</p>

CC BY-SA 4.0
2020-12-01T09:23:09.453Z
Hi @Mar please do edit your post to mention that WDL is a genomics pipeline (Broad Institute). I recognise without knowing this no-one could help but it maximises transparency
M__
<wdl>
How do I rename output folder created using WDL's glob function, with cromwell execution engine?
# How do I rename output folder created using WDL's glob function, with cromwell execution engine?

(Asked by: username_0 on 2020-12-01)

I made a wdl (genomics pipeline language by the Broad Institute) task for fastqc that outputs the zip files, of which there will be as many as reads that the sample I'm working on at that moment has. We create the output using glob:
  output {
    Array[File] fastqcArray = glob("*.zip")
  } 

I would like to give the folder a name that is representative of what it contains, for example fastqc, rather than glob-xxxxxxx, so that it's clear what it is in my task's output folder. Is this possible, and if so, how can I achieve it?

**Tags:** wdl
> **Comments:**
> **username_1**: Hi @Mar please do edit your post to mention that WDL is a genomics pipeline (Broad Institute). I recognise without knowing this no-one could help but it maximises transparency  

---

## 1 answers

### Answer by username_0 on 2020-12-03. Score: 2

Ok, thanks to Ruben Vorderman on the openwdl github page, I found a solution that does not involve renaming the glob folder (which I believe is not possible?). The only way is to write out the names of the files and pass them explicitly to the Array[File] output. This is how I did it (simplified), in case it helps anyone else in the future:
task fastqc_task {
  File forwardReads
  File reverseReads
  String fwdName = sub(basename(forwardReads),".f.*q.*$","")
  String revName = sub(basename(reverseReads),".f.*q.*$","")
  command {
    mkdir -p ./qc/fastqc_zip
    fastqc ${forwardReads} ${reverseReads} --outdir ./qc/fastqc_zip
  }
  output {
    Array[File] fastqcArray = ["./qc/fastqc_zip/${fwdName}_fastqc.zip", "./qc/fastqc_zip/${revName}_fastqc.zip"]
  } 
}


---

