Plink prefix and wdl

Hi,

I am trying to create a WDL that runs plink and takes as an input a prefix to the bed/bim/fam file

I am using Cromwell and docker to run it

for example:

plink -bfile prefix --recode --out prefix

Cromwell copies over the input files. How do I configure the wdl to use a prefix and grab the files associated with the prefix without explicitly defining the files. Also even if I can get the files copied over how do I pass a prefix to the files?

Thanks,

Ilya

Best Answer

  • edited April 26 Accepted Answer

    I came up with a workaround.

    Step 1:

    Type the bed/bim/fam files

    workflow{
    File fileName.bed
    File fileName.bim
    File fileName.fam

    cal task{
    input: fileName.bed=fileName.bed, ...
    }
    }

    Step 2:
    I will then force the prefix to be filename and the output prefix to be fileName.prefix. Notice I don't actually use the plink files in the command but since they were typed above Cromwell mounts them #on the docker image.

    task{
    File fileName.bed
    File fileName.bim
    File fileName.fam

    command{
    plink --bfile ${sub(fileName.bed,".bed",''} [options] --out ${sub(fileName.bed,".bed",''.prefix")}
    }

    }

    It's not ideal but it will work for now. It requires that the bed, bim, and fam files all have the same prefix which is fine for plink. I will also have set all three as separate parameters in the input form.

    Ideal would be 1.) an easier way to mount a whole directory or 2.) more easily get the working directory information or 3.) easily get the path to the files.

Answers

  • ilya_at_vividilya_at_vivid Member
    edited April 26 Accepted Answer

    I came up with a workaround.

    Step 1:

    Type the bed/bim/fam files

    workflow{
    File fileName.bed
    File fileName.bim
    File fileName.fam

    cal task{
    input: fileName.bed=fileName.bed, ...
    }
    }

    Step 2:
    I will then force the prefix to be filename and the output prefix to be fileName.prefix. Notice I don't actually use the plink files in the command but since they were typed above Cromwell mounts them #on the docker image.

    task{
    File fileName.bed
    File fileName.bim
    File fileName.fam

    command{
    plink --bfile ${sub(fileName.bed,".bed",''} [options] --out ${sub(fileName.bed,".bed",''.prefix")}
    }

    }

    It's not ideal but it will work for now. It requires that the bed, bim, and fam files all have the same prefix which is fine for plink. I will also have set all three as separate parameters in the input form.

    Ideal would be 1.) an easier way to mount a whole directory or 2.) more easily get the working directory information or 3.) easily get the path to the files.

Sign In or Register to comment.