Example 3: cnvkit
This example will build on the asset you created in the bash
version. You will:
Learn how to download the input type
array:file
Use regular expressions to classify output files
Getting Started
We'll call our new applet python_cnvkit. If you want to start from dx-app-wizard
, use the following specs for the inputs and outputs:
bam_tumor
array:file
No
NA
reference
file
No
NA
The output specs are as follows:
cns
array:file
cns_filtered
array:file
plot
array:file
You can also copy the bash
applet directory and update the runSpec
in dxapp.json to run a Python script and use the CNVKit asset from before:
Here is the input.json:
Python Code
Update src/python_cnvkit.py to the following:
Download the reference file.
Initialize a list to hold the download BAM paths.
Download each BAM file into a directory and append the path to the
bam_files
list.Create, print, and run the command to execute CNVkit.
For each of the output file categories, filter the output files and upload the output files matching the expected extension.
Compile the given regular expression.
Create a DX file ID link for each uploaded file.
Here is the output from the job:
Review
You used a
for
loop to download multiple input BAM files into a local directory.You used regular expressions to classify the output files into the three output labels.
Resources
To create a support ticket if there are technical issues:
Go to the Help header (same section where Projects and Tools are) inside the platform
Select "Contact Support"
Fill in the Subject and Message to submit a support ticket.
Last updated
Was this helpful?