1
$\begingroup$

I have a cromwell task that, among other variables, takes these three variables:

   File Ref             # Reference genome fasta
   File RefFai          # Reference Genome index
   File RefDict         # Reference Dictionary

While all three files make it into the task's "inputs" directory, they end up in different sub-directories of inputs:

ME $ find inputs
inputs

inputs/-181926642
inputs/-181926642/Sample.vcf.bgz.tbi
inputs/-181926642/Sample.vcf.bgz
inputs/-1548908437
inputs/-1548908437/GCA_000001405.15_GRCh38_no_alt_short_headers_nonACTG_to_N.dict
inputs/44588251
inputs/44588251/GCA_000001405.15_GRCh38_no_alt_short_headers_nonACTG_to_N.fa
inputs/44588251/GCA_000001405.15_GRCh38_no_alt_short_headers_nonACTG_to_N.fa.fai

Which means that when I call GATK and pass it the path to the .fa file, it gets rather cranky that the .dict file isn't in the same directory.

How do I force cromwell to put all three files in the same directory?

$\endgroup$
3
  • $\begingroup$ We did have a similar problem and there is a solution to it... however, I have hard time recalling it, sinc eit was a while ago (and we abandoned WDL). Perhaps you could paste the code for the task, which would make it easier to see, if anything is missing. $\endgroup$
    – Roger V.
    Commented Jan 14, 2021 at 8:29
  • $\begingroup$ @Vadim the code does not reference RefFai or RefDict, only Ref. $\endgroup$ Commented Jan 21, 2021 at 22:31
  • $\begingroup$ I am talking about the wdl code: one must pass all the files explicitly to the task, even if they do not appear in the command line. Every task is run from a separate folder. $\endgroup$
    – Roger V.
    Commented Jan 22, 2021 at 6:28

2 Answers 2

1
$\begingroup$

as for wdl version 1.0 (other versions untested)

you can pack your reference and related files into a struct:

struct Reference {
    File fasta
    File dict
    File fai
}

You will pass the Reference to your tasks instead of File. Inside your workflow/config define:

Ref example = {
    "fasta" : "reference.fasta",
    "fai" : "reference.fasta.fai",
    "dict" : "reference.dict"
}

Inside the task you just use the file want use by example.fasta.

$\endgroup$
0
$\begingroup$

My hacktastic fix for this is to use basename to get the name of each file, then do

refName=`basename "${Ref}"`
ln -s "${Ref}" "$refName"

for each file. This puts aliases to each file in the executions dir, and then I pass "refName" to GATK rather than "${Ref}".

Not a good solution, but a solution

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.