diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 04cb8d53..7586f904 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -20,6 +20,7 @@ modules/msk/neosv/** @johnoooh @nikhil @mskcc-omics-workflows/reviewers modules/msk/netmhc3/** @johnoooh @nikhil @mskcc-omics-workflows/reviewers modules/msk/netmhcpan4/** @johnoooh @nikhil @mskcc-omics-workflows/reviewers modules/msk/netmhcstabpan/** @johnoooh @nikhil @mskcc-omics-workflows/reviewers +modules/msk/oncokb/mafannotate/** @johnoooh @mskcc-omics-workflows/reviewers modules/msk/phylowgs/createinput/** @pintoa1-mskcc @mskcc-omics-workflows/reviewers modules/msk/phylowgs/multievolve/** @nikhil @mskcc-omics-workflows/reviewers modules/msk/phylowgs/parsecnvs/** @pintoa1-mskcc @mskcc-omics-workflows/reviewers diff --git a/.github/actions/nf-test-action/action.yml b/.github/actions/nf-test-action/action.yml index 8a570c42..799e5db0 100644 --- a/.github/actions/nf-test-action/action.yml +++ b/.github/actions/nf-test-action/action.yml @@ -65,6 +65,13 @@ runs: python -m pip install cryptography nextflow secrets set SENTIEON_AUTH_DATA $(python3 tests/modules/nf-core/sentieon/license_message.py encrypt --key "$SENTIEON_ENCRYPTION_KEY" --message "$SENTIEON_LICENSE_MESSAGE") + - name: Set up nextflow ONCOKB secrets + if: env.ONCOKB_TOKEN != '' + shell: bash + run: | + nextflow secrets set ONCOKB_TOKEN $ONCOKB_TOKEN + + # TODO Skip failing conda tests and document their failures # https://github.com/nf-core/modules/issues/7017 - name: Run nf-test diff --git a/.github/conda_skip.yml b/.github/conda_skip.yml index 5c75294a..e607702a 100644 --- a/.github/conda_skip.yml +++ b/.github/conda_skip.yml @@ -74,3 +74,5 @@ exclude: path: modules/msk/neosv - profile: conda path: modules/msk/netmhc3 + - profile: conda + path: modules/msk/oncokb/mafannotate \ No newline at end of file diff --git a/.github/skip_nf_test.json b/.github/skip_nf_test.json index 4ea16616..d7443725 100644 --- a/.github/skip_nf_test.json +++ b/.github/skip_nf_test.json @@ -28,7 +28,8 @@ "modules/msk/phylowgs/parsecnvs", "modules/msk/pvmaf/concat", "modules/msk/pvmaf/tagtraceback", - "subworkflows/msk/genome_nexus" + "subworkflows/msk/genome_nexus", + "modules/msk/oncokb/mafannotate" ], "docker": [ ], diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index 6bbb73ca..30223b81 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -79,7 +79,6 @@ jobs: env: NXF_ANSI_LOG: false TOTAL_SHARDS: 5 - steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: @@ -130,6 +129,7 @@ jobs: SENTIEON_LICENSE_MESSAGE: ${{ secrets.SENTIEON_LICENSE_MESSAGE }} SENTIEON_LICSRVR_IP: ${{ secrets.SENTIEON_LICSRVR_IP }} SENTIEON_AUTH_MECH: "GitHub Actions - token" + ONCOKB_TOKEN: ${{ secrets.ONCOKB_TOKEN }} with: profile: ${{ matrix.profile }} shard: ${{ matrix.shard }} diff --git a/modules/msk/oncokb/mafannotate/environment.yml b/modules/msk/oncokb/mafannotate/environment.yml new file mode 100644 index 00000000..4e65f665 --- /dev/null +++ b/modules/msk/oncokb/mafannotate/environment.yml @@ -0,0 +1,6 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "oncokb=version" diff --git a/modules/msk/oncokb/mafannotate/main.nf b/modules/msk/oncokb/mafannotate/main.nf new file mode 100644 index 00000000..87b7dd8b --- /dev/null +++ b/modules/msk/oncokb/mafannotate/main.nf @@ -0,0 +1,51 @@ +process ONCOKB_MAFANNOTATE { + tag "$meta.id" + label 'process_single' + + secret 'ONCOKB_TOKEN' + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'ghcr.io/mskcc-omics-workflows/oncokb:3.4.1': + 'ghcr.io/mskcc-omics-workflows/oncokb:3.4.1' }" + + input: + tuple val(meta), path(inputMaf) + + output: + tuple val(meta), path("*.oncokb.maf"), emit: oncokb_maf + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + python3 /usr/bin/oncokb/MafAnnotator.py \ + -i ${inputMaf} \ + -o ${prefix}.oncokb.maf \ + -b ${ONCOKB_TOKEN} + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + MafAnnotator: \$(echo \$(MafAnnotator.py -v)) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + mkdir ${prefix}_out + touch ${prefix}.oncokb.maf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + MafAnnotator: \$(echo \$(MafAnnotator.py -v)) + END_VERSIONS + """ +} diff --git a/modules/msk/oncokb/mafannotate/meta.yml b/modules/msk/oncokb/mafannotate/meta.yml new file mode 100644 index 00000000..889b85cd --- /dev/null +++ b/modules/msk/oncokb/mafannotate/meta.yml @@ -0,0 +1,46 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "oncokb_mafannotate" +description: + Takes a Maf and annotates it using OncoKB. +keywords: + - oncokb + - maf + - annotation +tools: + - oncokb: + description: "OncoKB is a precision oncology knowledge base that annotates the biological consequences and clinical implications (therapeutic, diagnostic, and prognostic) of genetic variants in cancer. In order to use this you must provide a config file containing your own oncoKB api key in the args." + documentation: "https://github.com/oncokb/oncokb-annotator" + licence: ["GNU"] + identifier: "" + +input: + - - meta: + type: map + description: | + Groovy Map containing sample information. + e.g. `[ id:'sample1']` + - inputMaf: + type: file + description: MAF, perferrably annotated by vcf2maf. Required cols are listed in the docs. + pattern: "*.maf" +output: + - oncokb_maf: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1']` + - "*.oncokb.maf": + type: file + description: A maf file annotated by oncokb + pattern: "*.{maf}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" +authors: + - "@johnoooh" +maintainers: + - "@johnoooh" + diff --git a/modules/msk/oncokb/mafannotate/tests/main.nf.test b/modules/msk/oncokb/mafannotate/tests/main.nf.test new file mode 100644 index 00000000..da174ae4 --- /dev/null +++ b/modules/msk/oncokb/mafannotate/tests/main.nf.test @@ -0,0 +1,66 @@ +nextflow_process { + + name "Test Process ONCOKB_MAFANNOTATE" + script "../main.nf" + process "ONCOKB_MAFANNOTATE" + + tag "modules" + tag "modules_nfcore" + tag "modules_msk" + tag "oncokb" + tag "oncokb/mafannotate" + + + test("test") { + + + when { + process { + """ + + input[0] = [ + [ id:'test',case_id:'sample1',control_id:'sample2'], // meta map + file(params.test_data_mskcc['genome_nexus']['sample2_sample1_annotated_maf'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + + ) + } + + } + + + test("test normal - stub") { + + options "-stub" + + when { + process { + """ + + + input[0] = [ + [ id:'test',case_id:'sample1',control_id:'sample2'], // meta map + file(params.test_data_mskcc['genome_nexus']['sample2_sample1_annotated_maf'], checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success } + + ) + } + + } + +} diff --git a/modules/msk/oncokb/mafannotate/tests/main.nf.test.snap b/modules/msk/oncokb/mafannotate/tests/main.nf.test.snap new file mode 100644 index 00000000..4c05b143 --- /dev/null +++ b/modules/msk/oncokb/mafannotate/tests/main.nf.test.snap @@ -0,0 +1,39 @@ +{ + "test": { + "content": [ + { + "0": [ + [ + { + "id": "test", + "case_id": "sample1", + "control_id": "sample2" + }, + "test.oncokb.maf:md5,dd58c4431ec26cb47fb97236d063c6a5" + ] + ], + "1": [ + "versions.yml:md5,030d3dd4facf29936752666113de5897" + ], + "oncokb_maf": [ + [ + { + "id": "test", + "case_id": "sample1", + "control_id": "sample2" + }, + "test.oncokb.maf:md5,dd58c4431ec26cb47fb97236d063c6a5" + ] + ], + "versions": [ + "versions.yml:md5,030d3dd4facf29936752666113de5897" + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.04.4" + }, + "timestamp": "2025-03-03T13:18:05.707580942" + } +} \ No newline at end of file diff --git a/modules/msk/oncokb/mafannotate/tests/tags.yml b/modules/msk/oncokb/mafannotate/tests/tags.yml new file mode 100644 index 00000000..a4cfbc5e --- /dev/null +++ b/modules/msk/oncokb/mafannotate/tests/tags.yml @@ -0,0 +1,2 @@ +genomenexus/annotationpipeline: + - "modules/msk/oncokb/mafannotate/**"