Skip to content

Commit 466e8a5

Browse files
committed
First adaptations.
1 parent 339f717 commit 466e8a5

2 files changed

Lines changed: 25 additions & 5 deletions

File tree

resources/analysisTools/qcPipeline/environments/tbi-lsf-cluster.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,32 @@ export -f sambamba_markdup
129129
export SAMBAMBA_MARKDUP_BINARY=sambamba_markdup
130130

131131

132+
# Try to infer the module name and binary filename from the version number.
133+
bwaMajorVersion="$(echo "$BWA_VERSION" | cut -f 1 -d '.')"
134+
if [[ "$bwaMajorVersion" == "0" ]]; then
135+
export BWA_MODULE=bwa
136+
elif [[ "$bwaMajorVersion" == "2" ]]; then
137+
export BWA_MODULE=bwa-mem2
138+
else
139+
echo "Cannot infer BWA_MODULE and BWA_BINARY from BWA_VERSION: '$BWA_VERSION'" >> /dev/stderr
140+
exit 1
141+
fi
142+
132143
if [[ "$WORKFLOW_ID" == "bisulfiteCoreAnalysis" ]]; then
144+
if [[ "$bwaMajorVersion" != "1" ]]; then
145+
echo "Only bwa-0.* has a bisulfite patch module" >> /dev/stderr
146+
exit 1
147+
fi
133148
## For bisulfite alignment, we suffix the the value of BINARY_VERSION by '-bisulfite', because that's the name in LSF cluster.
134149
export BWA_VERSION="${BWA_VERSION:?BWA_VERSION is not set}-bisulfite"
135-
moduleLoad bwa
136-
export BWA_BINARY=bwa
150+
# This works with BWA_MODULE because the bwa-mem2 binary has the same interface.
151+
moduleLoad "$BWA_MODULE" BWA_VERSION
152+
export BWA_BINARY="$BWA_MODULE"
137153

138154
elif [[ "$WORKFLOW_ID" == "qcAnalysis" || "$WORKFLOW_ID" == "exomeAnalysis" ]]; then
139155
if [[ "${useAcceleratedHardware:-false}" == false ]]; then
140-
moduleLoad bwa
141-
export BWA_BINARY=bwa
156+
moduleLoad "$BWA_MODULE" BWA_VERSION
157+
export BWA_BINARY="$BWA_MODULE"
142158
elif [[ "${useAcceleratedHardware:-true}" == true ]]; then
143159
moduleLoad bwa-bb BWA_VERSION
144160
export BWA_ACCELERATED_BINARY=bwa-bb

resources/configurationFiles/analysisQC.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
<cvalue name="BIOBAMBAM_VERSION" value="0.0.148" type="string"/>
3131
<cvalue name="JAVA_VERSION" value="1.8.0_131" type="string"/>
3232
<cvalue name="BWA_VERSION" value="0.7.8" type="string"
33-
description="Use e.g. 0.7.8-r2.05 for a specific revision of bb-bwa."/>
33+
description="Use e.g. 0.7.8-r2.05 for a specific revision of bb-bwa. Node that bwa-mem2 uses much more memory."/>
34+
<cvalue name="BWA_MODULE" value="" type="string"
35+
description="Empty string will result in automatic inference of the module name. If the first number (major version) is '2' then BWA_MODULE is automatically set to 'bwa-mem2', otherwise 'bwa'. See tbi-lsf-cluster.sh. You can also explicitly set the version."/>
36+
<cvalue name="BWA_MEM_OPTIONS" value='" -T 0 "' type="string"
37+
description="The original CO configuration is ' -T 0 '. Note that the value must be quoted."/>
3438
<cvalue name="FASTQC_VERSION" value="0.11.3" type="string"/>
3539

3640
<cvalue name="workflowEnvironmentScript" value="workflowEnvironment_tbiLsf" type="string"/>

0 commit comments

Comments
 (0)