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

Using Seqera containers for Sentieon to avoid LD_LIBRARY errors #5823

Merged
merged 5 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions modules/nf-core/sentieon/applyvarcal/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ process SENTIEON_APPLYVARCAL {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' :
'biocontainers/sentieon:202308.02--h43eeafb_0' }"
'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' :
'nf-core/sentieon:202308.02--c641bc397cbf79d5' }"

input:
tuple val(meta), path(vcf), path(vcf_tbi), path(recal), path(recal_index), path(tranches)
Expand All @@ -24,20 +24,10 @@ process SENTIEON_APPLYVARCAL {
task.ext.when == null || task.ext.when

script:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

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 [ "\${#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 @@ -55,8 +45,6 @@ process SENTIEON_APPLYVARCAL {
echo "Decoded and exported Sentieon test-license system environment variables"
fi

$fix_ld_library_path

sentieon driver -r ${fasta} --algo ApplyVarCal \\
-v $vcf \\
--recal $recal \\
Expand All @@ -71,19 +59,8 @@ process SENTIEON_APPLYVARCAL {
"""

stub:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def prefix = task.ext.prefix ?: "${meta.id}"
"""
$fix_ld_library_path

touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

Expand Down
26 changes: 2 additions & 24 deletions modules/nf-core/sentieon/bwaindex/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ process SENTIEON_BWAINDEX {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' :
'biocontainers/sentieon:202308.02--h43eeafb_0' }"
'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' :
'nf-core/sentieon:202308.02--c641bc397cbf79d5' }"

input:
tuple val(meta), path(fasta)
Expand All @@ -19,20 +19,9 @@ process SENTIEON_BWAINDEX {
task.ext.when == null || task.ext.when

script:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def args = task.ext.args ?: ''
def prefix = task.ext.prefix ? "bwa/${task.ext.prefix}" : "bwa/${fasta.baseName}"
"""
$fix_ld_library_path

mkdir bwa

sentieon \\
Expand All @@ -49,18 +38,7 @@ process SENTIEON_BWAINDEX {
"""

stub:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

"""
$fix_ld_library_path

mkdir bwa

touch bwa/genome.amb
Expand Down
27 changes: 2 additions & 25 deletions modules/nf-core/sentieon/bwamem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ process SENTIEON_BWAMEM {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' :
'biocontainers/sentieon:202308.02--h43eeafb_0' }"
'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' :
'nf-core/sentieon:202308.02--c641bc397cbf79d5' }"

input:
tuple val(meta), path(reads)
Expand All @@ -26,20 +26,10 @@ process SENTIEON_BWAMEM {
task.ext.when == null || task.ext.when

script:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

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 [ "\${SENTIEON_LICSRVR_IP}" ]; then
# NOTE: This is how pipeline users will use Sentieon in real world
Expand All @@ -59,8 +49,6 @@ process SENTIEON_BWAMEM {
echo "If sentieon_auth_mech and sentieon_auth_data are non-empty strings, then Sentieon is mostly likely being run with some test-license."
fi

$fix_ld_library_path

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

sentieon bwa mem \\
Expand All @@ -78,19 +66,8 @@ process SENTIEON_BWAMEM {
"""

stub:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def prefix = task.ext.prefix ?: "${meta.id}"
"""
$fix_ld_library_path

touch ${prefix}.bam
touch ${prefix}.bam.bai

Expand Down
26 changes: 2 additions & 24 deletions modules/nf-core/sentieon/datametrics/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ process SENTIEON_DATAMETRICS {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' :
'biocontainers/sentieon:202308.02--h43eeafb_0' }"
'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' :
'nf-core/sentieon:202308.02--c641bc397cbf79d5' }"

input:
tuple val(meta), path(bam), path(bai)
Expand All @@ -28,15 +28,6 @@ process SENTIEON_DATAMETRICS {
task.ext.when == null || task.ext.when

script:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def input = bam.sort().collect{"-i $it"}.join(' ')
Expand All @@ -59,8 +50,6 @@ process SENTIEON_DATAMETRICS {
echo "Decoded and exported Sentieon test-license system environment variables"
fi

$fix_ld_library_path

sentieon \\
driver \\
-t $task.cpus \\
Expand All @@ -80,19 +69,8 @@ process SENTIEON_DATAMETRICS {
"""

stub:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def prefix = task.ext.prefix ?: "${meta.id}"
"""
$fix_ld_library_path

touch ${prefix}_mq_metrics.txt
touch ${prefix}_qd_metrics.txt
touch ${prefix}_gc_summary.txt
Expand Down
26 changes: 2 additions & 24 deletions modules/nf-core/sentieon/dedup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ process SENTIEON_DEDUP {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' :
'biocontainers/sentieon:202308.02--h43eeafb_0' }"
'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' :
'nf-core/sentieon:202308.02--c641bc397cbf79d5' }"

input:
tuple val(meta), path(bam), path(bai)
Expand All @@ -29,15 +29,6 @@ process SENTIEON_DEDUP {
task.ext.when == null || task.ext.when

script:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
Expand All @@ -48,7 +39,6 @@ process SENTIEON_DEDUP {
def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: ''
def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: ''
def input_list = bam.collect{"-i $it"}.join(' ')

"""
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 @@ -66,8 +56,6 @@ process SENTIEON_DEDUP {
echo "Decoded and exported Sentieon test-license system environment variables"
fi

$fix_ld_library_path

sentieon driver $args $input_list -r ${fasta} --algo LocusCollector $args2 --fun score_info ${prefix}.score
sentieon driver $args3 -t $task.cpus $input_list -r ${fasta} --algo Dedup $args4 --score_info ${prefix}.score --metrics ${metrics} ${prefix}${suffix}
# This following tsv-file is produced in order to get a proper tsv-file with Dedup-metrics for importing in MultiQC as "custom content".
Expand All @@ -81,20 +69,10 @@ process SENTIEON_DEDUP {
"""

stub:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: ".cram" // The suffix should be either ".cram" or ".bam".
def metrics = task.ext.metrics ?: "${prefix}${suffix}.metrics"
"""
$fix_ld_library_path

touch "${prefix}${suffix}"
touch "${prefix}${suffix}\$(echo ${suffix} | sed 's/m\$/i/')"
touch "${metrics}"
Expand Down
28 changes: 2 additions & 26 deletions modules/nf-core/sentieon/dnamodelapply/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ process SENTIEON_DNAMODELAPPLY {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/sentieon:202308.02--h43eeafb_0' :
'biocontainers/sentieon:202308.02--h43eeafb_0' }"
'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' :
'nf-core/sentieon:202308.02--c641bc397cbf79d5' }"

input:
tuple val(meta), path(vcf), path(idx)
Expand All @@ -25,20 +25,10 @@ process SENTIEON_DNAMODELAPPLY {
task.ext.when == null || task.ext.when

script:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

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 [ "\${#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 @@ -56,8 +46,6 @@ process SENTIEON_DNAMODELAPPLY {
echo "Decoded and exported Sentieon test-license system environment variables"
fi

$fix_ld_library_path

sentieon driver \\
-t $task.cpus \\
-r $fasta \\
Expand All @@ -74,20 +62,8 @@ process SENTIEON_DNAMODELAPPLY {
"""

stub:
// The following code sets LD_LIBRARY_PATH in the script-section when the module is run by Singularity.
// That turned out to be one way of overcoming the following issue with the Singularity-Sentieon-containers from galaxy, Sentieon (LD_LIBRARY_PATH) and the way Nextflow runs Singularity-containers.
// The galaxy container uses a runscript which is responsible for setting LD_PRELOAD properly. Nextflow executes singularity containers using `singularity exec`, which avoids the run script, leading to the LD_LIBRARY_PATH/libstdc++.so.6 error.
if (workflow.containerEngine in ['singularity','apptainer']) {
fix_ld_library_path = 'LD_LIBRARY_PATH=/usr/local/lib/:\$LD_LIBRARY_PATH;export LD_LIBRARY_PATH'
} else {
fix_ld_library_path = ''
}

def prefix = task.ext.prefix ?: "${meta.id}"

"""
$fix_ld_library_path

touch ${prefix}.vcf.gz
touch ${prefix}.vcf.gz.tbi

Expand Down
Loading
Loading