Skip to content

Commit

Permalink
extend logic to all main.nf
Browse files Browse the repository at this point in the history
  • Loading branch information
maxulysse authored and edmundmiller committed Jul 16, 2024
1 parent 76a7915 commit a2cd33f
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 249 deletions.
23 changes: 4 additions & 19 deletions modules/nf-core/sentieon/applyvarcal/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand All @@ -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 <sentieon_license_file.lic> | 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 \\
Expand Down
1 change: 0 additions & 1 deletion modules/nf-core/sentieon/bwamem/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sentieon_license_file.lic> | base64 -w 0)
def sentieonLicense = secrets.SENTIEON_LICENSE_BASE64 ?
"export SENTIEON_LICENSE=\$(mktemp);echo -e \"${secrets.SENTIEON_LICENSE_BASE64}\" | base64 -d > \$SENTIEON_LICENSE; " :
""
Expand Down
23 changes: 4 additions & 19 deletions modules/nf-core/sentieon/datametrics/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand All @@ -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 <sentieon_license_file.lic> | 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 \\
Expand Down
23 changes: 4 additions & 19 deletions modules/nf-core/sentieon/dedup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand Down Expand Up @@ -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 <sentieon_license_file.lic> | 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}
Expand Down
23 changes: 4 additions & 19 deletions modules/nf-core/sentieon/dnamodelapply/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand All @@ -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 <sentieon_license_file.lic> | 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 \\
Expand Down
23 changes: 4 additions & 19 deletions modules/nf-core/sentieon/dnascope/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand Down Expand Up @@ -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 + ' '
Expand All @@ -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 <sentieon_license_file.lic> | 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
Expand Down
21 changes: 4 additions & 17 deletions modules/nf-core/sentieon/gvcftyper/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sentieon_license_file.lic> | 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
Expand Down
23 changes: 4 additions & 19 deletions modules/nf-core/sentieon/haplotyper/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand Down Expand Up @@ -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
Expand All @@ -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 <sentieon_license_file.lic> | 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
Expand Down
24 changes: 4 additions & 20 deletions modules/nf-core/sentieon/readwriter/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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' :
Expand Down Expand Up @@ -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 <sentieon_license_file.lic> | 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 \\
Expand Down
Loading

0 comments on commit a2cd33f

Please sign in to comment.