Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding fix for LD_LIBRARY_PATH in singularity mode #4347

Merged
merged 10 commits into from
Nov 16, 2023
18 changes: 13 additions & 5 deletions modules/nf-core/sentieon/bwamem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ process SENTIEON_BWAMEM {

secret 'SENTIEON_LICENSE_BASE64'

container 'nf-core/sentieon:202308'
conda "bioconda::sentieon=202308"
asp8200 marked this conversation as resolved.
Show resolved Hide resolved
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308--h43eeafb_0' :
'biocontainers/sentieon:202308--h43eeafb_0' }"


input:
tuple val(meta), path(reads)
Expand All @@ -21,15 +25,17 @@ process SENTIEON_BWAMEM {
task.ext.when == null || task.ext.when

script:
// Exit if running this module with -profile conda / -profile mamba
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "Sentieon modules do not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: ''
def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: ''

if (workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container) {
asp8200 marked this conversation as resolved.
Show resolved Hide resolved
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

"""
if [ "\${#SENTIEON_LICENSE_BASE64}" -lt "1500" ]; then # If the string SENTIEON_LICENSE_BASE64 is short, then it is an encrypted url.
export SENTIEON_LICENSE=\$(echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d)
Expand All @@ -47,6 +53,8 @@ process SENTIEON_BWAMEM {
echo "Decoded and exported Sentieon test-license system environment variables"
fi

$fix_ld_library_path

INDEX=`find -L ./ -name "*.amb" | sed 's/.amb//'`

sentieon bwa mem \\
Expand Down
Loading