Parallel by Region (sh)
This applet performs a basic SAMtools count on a series of sliced (by canonical chromosome) BAM files in parallel using wait (Ubuntu 14.04+).
Last updated
Was this helpful?
This applet performs a basic SAMtools count on a series of sliced (by canonical chromosome) BAM files in parallel using wait (Ubuntu 14.04+).
Last updated
Was this helpful?
The SAMtools dependency is resolved by declaring an package in the dxapp.json
runSpec.execDepends
.
The command set -e -x -o pipefail
will assist you in debugging this applet:
-e
causes the shell to immediately exit if a command returns a non-zero exit code.
-x
prints commands as they are executed, which is very useful for tracking the job’s status or pinpointing the exact execution failure.
-o pipefail
makes the return code the first non-zero exit code. (Typically, the return code of pipes is the exit code of the last command, which can create difficult to debug problems.)
The *.bai
file was an optional job input. You can check for a empty or unset var
using the bash built-in test [[ - z ${var}} ]]
. You can then download or create a *.bai
index as needed.
In your applet, upload all outputs by:
Bash’s system allows for easy management of multiple processes. In this example, bash commands are run in the background as the maximum job executions are controlled in the foreground. You can place processes in the background using the character &
after a command.
Once the input bam has been sliced, counted, and summed, the output counts_txt
is uploaded using the command . The following directory structure required for dx-upload-all-outputs is below: