I would like to access phenotype data from within a WDL task using a python script. How do I localize the database file as an input to the task? I'm getting a wrong type error.

I'd like to do something similar to this jupyter notebook https://github.com/dnanexus/OpenBio/blob/master/UKB_notebooks/ukb-rap-pheno-basic.ipynb , but in a python script that is executed in a WDL task instead of as a jupyter notebook. In order to access the appNNN_YYY.dataset file using dxpy from that python script, I presume I need to localize that dataset file to the WDL task. So in my WDL I have

 

task ... {

 input {

  File dataset = "dx://ProjectName:/appNNN_YYY.dataset"

 }

 ...

}

 

However, I'm getting the following error:

 

failure executing Task action 'run'

java.lang.Exception: Found dx:object of the wrong type DxRecord(record-NNN,Some(DxProject(project-NNN)))

 

It seems that DNANexus considers this dataset file to have the type DxRecord instead of the type File, and so is failing to map it to the File type that the WDL requires. But WDL doesn't have a corresponding record type.

 

What's the solution here? I fundamentally just want to access phenotype data programmatically from my script in a WDL task. 

Comments

3 comments

Please sign in to leave a comment.