From 719f56e65e3fa832898dc8f6bbe08b9b1fb36c52 Mon Sep 17 00:00:00 2001 From: asp8200 Date: Mon, 14 Aug 2023 11:39:41 +0000 Subject: [PATCH 1/2] Replace local version of SENTIEON_DATAMETRICS with nf-core version --- modules.json | 5 ++ .../sentieon/datametrics/main.nf} | 29 +++++-- modules/nf-core/sentieon/datametrics/meta.yml | 84 +++++++++++++++++++ .../local/alignment/align_sentieon.nf | 2 +- 4 files changed, 114 insertions(+), 6 deletions(-) rename modules/{local/sentieon/datametrics.nf => nf-core/sentieon/datametrics/main.nf} (54%) create mode 100644 modules/nf-core/sentieon/datametrics/meta.yml diff --git a/modules.json b/modules.json index 5f9df891..2974defc 100644 --- a/modules.json +++ b/modules.json @@ -350,6 +350,11 @@ "git_sha": "b9172e8c26a3db5009f7872654c44587e254f094", "installed_by": ["modules"] }, + "sentieon/datametrics": { + "branch": "master", + "git_sha": "127edadc279e19da093fdd513926c6cdee82c306", + "installed_by": ["modules"] + }, "sentieon/readwriter": { "branch": "master", "git_sha": "b28e4dde755117e8dab5d6e85e292f145b8b53c3", diff --git a/modules/local/sentieon/datametrics.nf b/modules/nf-core/sentieon/datametrics/main.nf similarity index 54% rename from modules/local/sentieon/datametrics.nf rename to modules/nf-core/sentieon/datametrics/main.nf index 37ca6312..831a8f68 100644 --- a/modules/local/sentieon/datametrics.nf +++ b/modules/nf-core/sentieon/datametrics/main.nf @@ -1,10 +1,12 @@ process SENTIEON_DATAMETRICS { tag "$meta.id" - label 'process_high' + label 'process_medium' label 'sentieon' secret 'SENTIEON_LICENSE_BASE64' + container 'nf-core/sentieon:202112.06' + input: tuple val(meta), path(bam), path(bai) tuple val(meta2), path(fasta) @@ -23,13 +25,30 @@ process SENTIEON_DATAMETRICS { 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 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 ?: '' """ - if [ \${SENTIEON_LICENSE_BASE64:-"unset"} != "unset" ]; then - echo "Initializing SENTIEON_LICENSE env variable" - source sentieon_init.sh SENTIEON_LICENSE_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) + 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 sentieon \\ @@ -51,7 +70,7 @@ process SENTIEON_DATAMETRICS { """ stub: - def prefix = task.ext.prefix ?: "${meta.id}" + def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}_mq_metrics.txt touch ${prefix}_qd_metrics.txt diff --git a/modules/nf-core/sentieon/datametrics/meta.yml b/modules/nf-core/sentieon/datametrics/meta.yml new file mode 100644 index 00000000..bac58b9a --- /dev/null +++ b/modules/nf-core/sentieon/datametrics/meta.yml @@ -0,0 +1,84 @@ +name: "sentieon_datametrics" +description: Collects multiple quality metrics from a bam file +keywords: + - metrics + - bam + - sentieon +tools: + - sentieon: + description: | + Sentieon® provides complete solutions for secondary DNA/RNA analysis for a variety of sequencing platforms, including short and long reads. + Our software improves upon BWA, STAR, Minimap2, GATK, HaplotypeCaller, Mutect, and Mutect2 based pipelines and is deployable on any generic-CPU-based computing system. + homepage: https://www.sentieon.com/ + documentation: https://www.sentieon.com/ + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - meta3: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + - bai: + type: file + description: Index of th sorted BAM/CRAM/SAM file + pattern: "*.{bai,crai,sai}" + - fasta: + type: file + description: Genome fasta file + pattern: "*.{fa,fasta}" + - fai: + type: file + description: Index of the genome fasta file + pattern: "*.fai" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - mq_metrics: + type: file + description: File containing the information about mean base quality score for each sequencing cycle + pattern: "*.txt" + - qd_metrics: + type: file + description: File containing the information about number of bases with a specific base quality score + pattern: "*.txt" + - gc_summary: + type: file + description: File containing the information about GC bias in the reference and the sample + pattern: "*.txt" + - gc_metrics: + type: file + description: File containing the information about GC bias in the reference and the sample + pattern: "*.txt" + - aln_metrics: + type: file + description: File containing the statistics about the alignment of the reads + pattern: "*.txt" + - is_metrics: + type: file + description: File containing the information about statistical distribution of insert sizes + pattern: "*.txt" + +authors: + - "@ramprasadn" diff --git a/subworkflows/local/alignment/align_sentieon.nf b/subworkflows/local/alignment/align_sentieon.nf index 25673f2e..8cbc122b 100644 --- a/subworkflows/local/alignment/align_sentieon.nf +++ b/subworkflows/local/alignment/align_sentieon.nf @@ -3,7 +3,7 @@ // include { SENTIEON_BWAMEM } from '../../../modules/nf-core/sentieon/bwamem/main' -include { SENTIEON_DATAMETRICS } from '../../../modules/local/sentieon/datametrics' +include { SENTIEON_DATAMETRICS } from '../../../modules/nf-core/sentieon/datametrics/main' include { SENTIEON_LOCUSCOLLECTOR } from '../../../modules/local/sentieon/locuscollector' include { SENTIEON_DEDUP } from '../../../modules/local/sentieon/dedup' include { SENTIEON_BQSR } from '../../../modules/local/sentieon/bqsr' From ee1206a079de270fd76e018cc17d6e572ba73132 Mon Sep 17 00:00:00 2001 From: asp8200 Date: Mon, 14 Aug 2023 11:59:48 +0000 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 467e2e05..4975544f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Installed the nf-core version of the sentieon/bwamemindex module [#397](https://github.com/nf-core/raredisease/pull/397) - Installed the nf-core version of the sentieon/bwamem module [#398](https://github.com/nf-core/raredisease/pull/398) - Installed the nf-core version of the sentieon/readwriter module [#399](https://github.com/nf-core/raredisease/pull/399) +- Installed the nf-core version of the sentieon/datametrics module [#400](https://github.com/nf-core/raredisease/pull/400) ### `Fixed`