From a2cd33f2cda502c5809b4367170b4dd63c8ca65a Mon Sep 17 00:00:00 2001 From: maxulysse Date: Tue, 16 Jul 2024 15:15:16 +0200 Subject: [PATCH] extend logic to all main.nf --- modules/nf-core/sentieon/applyvarcal/main.nf | 23 +++-------------- modules/nf-core/sentieon/bwamem/main.nf | 1 - modules/nf-core/sentieon/datametrics/main.nf | 23 +++-------------- modules/nf-core/sentieon/dedup/main.nf | 23 +++-------------- .../nf-core/sentieon/dnamodelapply/main.nf | 23 +++-------------- modules/nf-core/sentieon/dnascope/main.nf | 23 +++-------------- modules/nf-core/sentieon/gvcftyper/main.nf | 21 +++------------- modules/nf-core/sentieon/haplotyper/main.nf | 23 +++-------------- modules/nf-core/sentieon/readwriter/main.nf | 24 +++--------------- modules/nf-core/sentieon/tnfilter/main.nf | 23 +++-------------- .../nf-core/sentieon/tnhaplotyper2/main.nf | 23 +++-------------- modules/nf-core/sentieon/tnscope/main.nf | 23 +++-------------- modules/nf-core/sentieon/varcal/main.nf | 25 +++---------------- modules/nf-core/sentieon/wgsmetrics/main.nf | 23 +++-------------- 14 files changed, 52 insertions(+), 249 deletions(-) diff --git a/modules/nf-core/sentieon/applyvarcal/main.nf b/modules/nf-core/sentieon/applyvarcal/main.nf index d0493e4768b8..9f64f5a2f32e 100644 --- a/modules/nf-core/sentieon/applyvarcal/main.nf +++ b/modules/nf-core/sentieon/applyvarcal/main.nf @@ -3,8 +3,6 @@ process SENTIEON_APPLYVARCAL { label 'process_low' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -26,24 +24,11 @@ process SENTIEON_APPLYVARCAL { script: 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 ?: '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver -r ${fasta} --algo ApplyVarCal \\ -v $vcf \\ diff --git a/modules/nf-core/sentieon/bwamem/main.nf b/modules/nf-core/sentieon/bwamem/main.nf index cf9c2dff17b5..f38fcae9211d 100644 --- a/modules/nf-core/sentieon/bwamem/main.nf +++ b/modules/nf-core/sentieon/bwamem/main.nf @@ -24,7 +24,6 @@ process SENTIEON_BWAMEM { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - // nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : "" diff --git a/modules/nf-core/sentieon/datametrics/main.nf b/modules/nf-core/sentieon/datametrics/main.nf index 1a68c9db96bf..e430f1e53ecf 100644 --- a/modules/nf-core/sentieon/datametrics/main.nf +++ b/modules/nf-core/sentieon/datametrics/main.nf @@ -3,8 +3,6 @@ process SENTIEON_DATAMETRICS { label 'process_medium' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -31,24 +29,11 @@ process SENTIEON_DATAMETRICS { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def input = bam.sort().collect{"-i $it"}.join(' ') - def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' - def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon \\ driver \\ diff --git a/modules/nf-core/sentieon/dedup/main.nf b/modules/nf-core/sentieon/dedup/main.nf index c76aa839176c..625875895feb 100644 --- a/modules/nf-core/sentieon/dedup/main.nf +++ b/modules/nf-core/sentieon/dedup/main.nf @@ -3,8 +3,6 @@ process SENTIEON_DEDUP { label 'process_medium' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -36,25 +34,12 @@ process SENTIEON_DEDUP { 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" - 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(' ') + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense 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} diff --git a/modules/nf-core/sentieon/dnamodelapply/main.nf b/modules/nf-core/sentieon/dnamodelapply/main.nf index 97c2986d2997..b4b10ce4d09d 100644 --- a/modules/nf-core/sentieon/dnamodelapply/main.nf +++ b/modules/nf-core/sentieon/dnamodelapply/main.nf @@ -3,8 +3,6 @@ process SENTIEON_DNAMODELAPPLY { label 'process_high' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -27,24 +25,11 @@ process SENTIEON_DNAMODELAPPLY { script: 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 ?: '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver \\ -t $task.cpus \\ diff --git a/modules/nf-core/sentieon/dnascope/main.nf b/modules/nf-core/sentieon/dnascope/main.nf index a69f40cdb378..63d7d23b8a27 100644 --- a/modules/nf-core/sentieon/dnascope/main.nf +++ b/modules/nf-core/sentieon/dnascope/main.nf @@ -3,8 +3,6 @@ process SENTIEON_DNASCOPE { label 'process_high' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -40,8 +38,6 @@ process SENTIEON_DNASCOPE { def model_cmd = ml_model ? " --model ${ml_model}" : '' def pcr_indel_model_cmd = pcr_indel_model ? " --pcr_indel_model ${pcr_indel_model}" : '' 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 ?: '' def vcf_cmd = "" def gvcf_cmd = "" def base_cmd = '--algo DNAscope ' + dbsnp_cmd + ' ' @@ -54,22 +50,11 @@ process SENTIEON_DNASCOPE { gvcf_cmd = base_cmd + args3 + ' ' + model_cmd + pcr_indel_model_cmd + ' --emit_mode gvcf ' + prefix + '.g.vcf.gz' } + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver $args -r $fasta -t $task.cpus -i $bam $interval $vcf_cmd $gvcf_cmd diff --git a/modules/nf-core/sentieon/gvcftyper/main.nf b/modules/nf-core/sentieon/gvcftyper/main.nf index 09265ad66a70..3711614ecae6 100644 --- a/modules/nf-core/sentieon/gvcftyper/main.nf +++ b/modules/nf-core/sentieon/gvcftyper/main.nf @@ -27,26 +27,13 @@ process SENTIEON_GVCFTYPER { script: 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 ?: '' def gvcfs_input = '-v ' + gvcfs.join(' -v ') def dbsnp_cmd = dbsnp ? "--dbsnp $dbsnp" : "" + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver -r ${fasta} --algo GVCFtyper ${gvcfs_input} ${dbsnp_cmd} ${prefix}.vcf.gz diff --git a/modules/nf-core/sentieon/haplotyper/main.nf b/modules/nf-core/sentieon/haplotyper/main.nf index 8001fa664580..d6ff0d843f93 100644 --- a/modules/nf-core/sentieon/haplotyper/main.nf +++ b/modules/nf-core/sentieon/haplotyper/main.nf @@ -3,8 +3,6 @@ process SENTIEON_HAPLOTYPER { label 'process_medium' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -36,8 +34,6 @@ process SENTIEON_HAPLOTYPER { def prefix = task.ext.prefix ?: "${meta.id}" def dbsnp_command = dbsnp ? "-d $dbsnp " : "" def interval_command = intervals ? "--interval $intervals" : "" - def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' - def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' def vcf_cmd = "" def gvcf_cmd = "" def base_cmd = '--algo Haplotyper ' + dbsnp_command @@ -50,22 +46,11 @@ process SENTIEON_HAPLOTYPER { gvcf_cmd = base_cmd + args3 + ' --emit_mode gvcf ' + prefix + '.g.vcf.gz' } + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver $args -r $fasta -t $task.cpus -i $input $interval_command $vcf_cmd $gvcf_cmd diff --git a/modules/nf-core/sentieon/readwriter/main.nf b/modules/nf-core/sentieon/readwriter/main.nf index 178d9a03e70d..9c7f48632145 100644 --- a/modules/nf-core/sentieon/readwriter/main.nf +++ b/modules/nf-core/sentieon/readwriter/main.nf @@ -3,8 +3,6 @@ process SENTIEON_READWRITER { label 'process_medium' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -34,25 +32,11 @@ process SENTIEON_READWRITER { def prefix = task.ext.prefix ?: "${meta.id}" format = input.extension == "bam" ? "bam" : "cram" index = format == "bam" ? "bam.bai" : "cram.crai" - def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' - def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi - + $sentieonLicense sentieon \\ driver \\ diff --git a/modules/nf-core/sentieon/tnfilter/main.nf b/modules/nf-core/sentieon/tnfilter/main.nf index 9d31f5c0dae0..57f8f20f57a2 100644 --- a/modules/nf-core/sentieon/tnfilter/main.nf +++ b/modules/nf-core/sentieon/tnfilter/main.nf @@ -3,8 +3,6 @@ process SENTIEON_TNFILTER { label 'process_medium' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -28,27 +26,14 @@ process SENTIEON_TNFILTER { def args = task.ext.args ?: '' // options for the driver def args2 = task.ext.args2 ?: '' // options for --algo TNfilter 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 ?: '' def contamination_command = contamination ? " --contamination ${contamination} " : '' def segments_command = segments ? segments.collect{"--tumor_segments $it"}.join(' ') : '' def orientation_priors_command = orientation_priors ? orientation_priors.collect{"--orientation_priors $it"}.join(' ') : '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver -r $fasta \\ $args \\ diff --git a/modules/nf-core/sentieon/tnhaplotyper2/main.nf b/modules/nf-core/sentieon/tnhaplotyper2/main.nf index 10f4106d10ab..dfa9796754a5 100644 --- a/modules/nf-core/sentieon/tnhaplotyper2/main.nf +++ b/modules/nf-core/sentieon/tnhaplotyper2/main.nf @@ -3,8 +3,6 @@ process SENTIEON_TNHAPLOTYPER2 { label 'process_high' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -35,8 +33,6 @@ process SENTIEON_TNHAPLOTYPER2 { task.ext.when == null || task.ext.when script: - def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' - def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' def args = task.ext.args ?: '' // options for "sentieon driver" def args2 = task.ext.args2 ?: '' // options for the TNhaplotyper2 algorithm. It could be something like "--tumor_sample --normal_sample " def args3 = task.ext.args3 ?: '' // options for the OrientationBias algorithm. It could be something like "--tumor_sample " @@ -57,22 +53,11 @@ process SENTIEON_TNHAPLOTYPER2 { contamination_cmd = "--algo ContaminationModel $args4 --vcf $germline_resource --tumor_segments ${prefix}.segments ${prefix}.contamination_data.tsv" } + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver \\ -t $task.cpus \\ diff --git a/modules/nf-core/sentieon/tnscope/main.nf b/modules/nf-core/sentieon/tnscope/main.nf index 0f8c2759d7ad..ac13542f978d 100644 --- a/modules/nf-core/sentieon/tnscope/main.nf +++ b/modules/nf-core/sentieon/tnscope/main.nf @@ -3,8 +3,6 @@ process SENTIEON_TNSCOPE { label 'process_high' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -35,24 +33,11 @@ process SENTIEON_TNSCOPE { def dbsnp_str = dbsnp ? "--dbsnp ${dbsnp}" : '' def pon_str = pon ? "--pon ${pon}" : '' 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 ?: '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver \\ -t $task.cpus \\ diff --git a/modules/nf-core/sentieon/varcal/main.nf b/modules/nf-core/sentieon/varcal/main.nf index ea62c53accfb..7c85c1210203 100644 --- a/modules/nf-core/sentieon/varcal/main.nf +++ b/modules/nf-core/sentieon/varcal/main.nf @@ -3,8 +3,6 @@ process SENTIEON_VARCAL { label 'process_low' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -47,26 +45,11 @@ process SENTIEON_VARCAL { labels_command += "--resource ${items[1]} --resource_param ${items[0]} " } } - - def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' - def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' - + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon driver -r ${fasta} --algo VarCal \\ -v $vcf \\ diff --git a/modules/nf-core/sentieon/wgsmetrics/main.nf b/modules/nf-core/sentieon/wgsmetrics/main.nf index bba6188d82ba..fad8d071700e 100644 --- a/modules/nf-core/sentieon/wgsmetrics/main.nf +++ b/modules/nf-core/sentieon/wgsmetrics/main.nf @@ -3,8 +3,6 @@ process SENTIEON_WGSMETRICS { label 'process_medium' label 'sentieon' - secret 'SENTIEON_LICENSE_BASE64' - conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'oras://community.wave.seqera.io/library/sentieon:202308.02--ffce1b7074ce9924' : @@ -28,24 +26,11 @@ process SENTIEON_WGSMETRICS { def input = bam.sort().collect{"-i $it"}.join(' ') def prefix = task.ext.prefix ?: "${meta.id}" def interval = intervals_list ? "--interval ${intervals_list}" : "" - def sentieon_auth_mech_base64 = task.ext.sentieon_auth_mech_base64 ?: '' - def sentieon_auth_data_base64 = task.ext.sentieon_auth_data_base64 ?: '' + def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ? + "export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " : + "" """ - 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) - else # Localhost license file - # The license file is stored as a nextflow variable like, for instance, this: - # nextflow secrets set SENTIEON_LICENSE_BASE64 \$(cat | base64 -w 0) - export SENTIEON_LICENSE=\$(mktemp) - echo -e "\$SENTIEON_LICENSE_BASE64" | base64 -d > \$SENTIEON_LICENSE - fi - - if [ ${sentieon_auth_mech_base64} ] && [ ${sentieon_auth_data_base64} ]; then - # If sentieon_auth_mech_base64 and sentieon_auth_data_base64 are non-empty strings, then Sentieon is mostly likely being run with some test-license. - export SENTIEON_AUTH_MECH=\$(echo -n "${sentieon_auth_mech_base64}" | base64 -d) - export SENTIEON_AUTH_DATA=\$(echo -n "${sentieon_auth_data_base64}" | base64 -d) - echo "Decoded and exported Sentieon test-license system environment variables" - fi + $sentieonLicense sentieon \\ driver \\