We will walk through a quick end-to-end flow for testing and debugging a variant calling workflow to demonstrate how to use latch develop.
buggy-wf
: The workflow with bugsgood-wf
: The final, functional workflowwgs
: Test data for the workflowlatch develop
to test and debug the buggy-wf to arrive at good-wf effectively.
Let’s get started!
wgs
, to the Latch Platform.
Run the following command to upload the wgs
data from the terminal
latch ls
like so:
build_index
, align_reads
, convert_to_bam
, sort_bam
, and
variant_calling
.
We have provided some (buggy) code for the five tasks above for you in the buggy-wf
, which you will now test and debug!
buggy-wf
folder and register it to Latch:
latch develop
. The registration process builds the code’s environment, which is the key to successfully debugging your workflow. Now we can interact with the environment.
latch develop .
in the workflow directory to enter the workflow environment.
We recommend reading this overview of the latch develop environment before proceeding.
scripts
with a main.py
inside containing commented-out task test code.
main.py
to get this:
wf/__init__.py
so we can reference them in this script.build_index
.latch://
to specify that it is a file on Latch, and
pass the whole string as a parameter to LatchFile
.
bwa
. One potential reason is that we might not have
installed the binary bwa
correctly.
bwa
binary is not installed! Checking the Dockerfile, notice that the installation instruction for bwa
is commented out. Let’s uncomment it:
build_index
task inside wf/__init__.py
:
LatchDir
with the remote path latch:///wgs/ref_genome
, which indicates that the
output files are inside the /wgs/ref_genome
folder in the Latch Console.
scripts/main.py
like so:
latch:///wgs/ref_genome
, as the input to the second task.
Run the test script:
/wgs/trimmed_fastqs/SRR2584863_1.trim.sub.fastq
in the Latch
Console. Referencing the actual file paths of the trimmed FastQs, we can see that their paths are indeed wrong, with
the correct paths being /wgs/data/SRR2584863_1.trim.sub.fastq
, etc (listed under /wgs/data
instead of /wgs/ trimmed_fastqs
).
We can make this modification to our test script and re-run the task as below:
/results
on Latch!
good-wf
folder for reference.
latch develop
Dockerfile
in the latch develop environment