-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: civicpy/annotate module #11079
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
Draft
emmcauley
wants to merge
3
commits into
nf-core:master
Choose a base branch
from
fulcrumgenomics:em_civipy_annotate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| - nodefaults | ||
| dependencies: | ||
| - "bioconda::civicpy=5.3.0" | ||
| - "bioconda::htslib=1.21" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| process CIVICPY_ANNOTATE { | ||
| tag "${meta.id}" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container | ||
| ? 'https://depot.galaxyproject.org/singularity/civicpy:5.3.0--pyhdfd78af_0' | ||
| : 'biocontainers/civicpy:5.3.0--pyhdfd78af_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(vcf), path(tbi) | ||
| val annotation_genome_version | ||
| path cache | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.vcf.gz"), emit: vcf | ||
| tuple val("${task.process}"), val('civicpy'), eval("civicpy --version | sed 's/.*version //'"), topic: versions, emit: versions_civicpy | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| if ("${vcf}" == "${prefix}.vcf.gz") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
| """ | ||
| export CIVICPY_CACHE_FILE=\$PWD/${cache} | ||
|
|
||
| civicpy annotate-vcf \\ | ||
| --input-vcf ${vcf} \\ | ||
| --output-vcf ${prefix}.vcf \\ | ||
|
emmcauley marked this conversation as resolved.
|
||
| --reference ${annotation_genome_version} \\ | ||
| ${args} | ||
|
|
||
| bgzip ${prefix}.vcf | ||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| prefix = task.ext.prefix ?: "${meta.id}" | ||
| if ("${vcf}" == "${prefix}.vcf.gz") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!" | ||
| """ | ||
|
emmcauley marked this conversation as resolved.
|
||
| echo "" | gzip > ${prefix}.vcf.gz | ||
| """ | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| name: "civicpy_annotate" | ||
| description: A python client and analysis toolkit to annotate variants with | ||
| information from the Clinical Interpretations of Variants in Cancer (CIViC) | ||
| knowledgebase | ||
| keywords: | ||
| - clinical interpretation | ||
| - variant annotation | ||
| - genetic variation analysis | ||
| - genomics | ||
| tools: | ||
| - "civicpy": | ||
| description: "CIViC variant knowledgebase analysis toolkit." | ||
| homepage: "https://docs.civicpy.org/en/latest/" | ||
| documentation: "https://docs.civicpy.org/en/latest/" | ||
| tool_dev_url: "https://github.com/griffithlab/civicpy" | ||
| doi: "10.1200/CCI.19.00127" | ||
| licence: | ||
| - "MIT" | ||
| identifier: biotools:CIViCpy | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1', single_end:false ]` | ||
| - vcf: | ||
| type: file | ||
| description: Sorted and indexed VCF file | ||
| pattern: "*.{vcf}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
| - tbi: | ||
| type: file | ||
| description: Tabix index for the input VCF | ||
| pattern: "*.tbi" | ||
| ontologies: [] | ||
| - annotation_genome_version: | ||
| type: string | ||
| description: Reference genome version passed to civicpy (e.g. GRCh38) | ||
| output: | ||
| vcf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1', single_end:false ]` | ||
| - "*.vcf.gz": | ||
| type: file | ||
| description: Annotated bgzipped VCF file | ||
| pattern: "*.vcf.gz" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
| - edam: http://edamontology.org/format_3989 | ||
| versions_civicpy: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - civicpy: | ||
| type: string | ||
| description: The name of the tool | ||
| - civicpy --version | sed 's/.*version //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - civicpy: | ||
| type: string | ||
| description: The name of the tool | ||
| - civicpy --version | sed 's/.*version //': | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@emmcauley" | ||
| maintainers: | ||
| - "@emmcauley" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process CIVICPY_ANNOTATE" | ||
| script "../main.nf" | ||
| process "CIVICPY_ANNOTATE" | ||
| config "./nextflow.config" | ||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "civicpy" | ||
| tag "civicpy/annotate" | ||
|
|
||
| test("homo_sapiens - vcf - GRCh38") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--include-status accepted' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test_sample' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = 'GRCh38' | ||
| input[2] = [] // no cache | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| path(process.out.vcf[0][1]).vcf.variantsMD5, | ||
| process.out.versions_civicpy | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - vcf - GRCh37") { | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--include-status accepted' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test_sample' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = 'GRCh37' | ||
| input[2] = [] // no cache | ||
|
|
||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| path(process.out.vcf[0][1]).vcf.variantsMD5, | ||
| process.out.versions_civicpy | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - vcf - GRCh38 - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| params { | ||
| module_args = '--include-status accepted' | ||
| } | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test_sample' ], | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/paired_mutect2_calls/test_test2_paired_mutect2_calls.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = 'GRCh38' | ||
| input[2] = [] // no cache | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert snapshot(sanitizeOutput(process.out)).match() | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "homo_sapiens - vcf - GRCh38 - stub": { | ||
| "content": [ | ||
| { | ||
| "vcf": [ | ||
| [ | ||
| { | ||
| "id": "test_sample" | ||
| }, | ||
| "/Users/erin/git/fg/nf-core-modules/.nf-test/tests/68c278fdc09fc81e903baebccd095f9b/work/67/5f3e6d98571cd26509b0fc94a4804a/test_sample.civic.vcf.gz" | ||
| ] | ||
| ], | ||
| "versions_civicpy": [ | ||
| [ | ||
| "CIVICPY_ANNOTATE", | ||
| "civicpy", | ||
| "" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.2" | ||
| }, | ||
| "timestamp": "2026-04-14T12:22:14.319968" | ||
| }, | ||
| "homo_sapiens - vcf - GRCh37": { | ||
| "content": [ | ||
| "bf3fe04101ac5b192de625ebf9a4324f", | ||
| [ | ||
| [ | ||
| "CIVICPY_ANNOTATE", | ||
| "civicpy", | ||
| "5.2.0" | ||
| ] | ||
| ] | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.2" | ||
| }, | ||
| "timestamp": "2026-03-27T11:16:21.699688" | ||
| }, | ||
| "homo_sapiens - vcf - GRCh38": { | ||
| "content": [ | ||
| "bf3fe04101ac5b192de625ebf9a4324f", | ||
| [ | ||
| [ | ||
| "CIVICPY_ANNOTATE", | ||
| "civicpy", | ||
| "5.2.0" | ||
| ] | ||
| ] | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.2" | ||
| }, | ||
| "timestamp": "2026-03-27T11:15:57.673023" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| process { | ||
| withName: CIVICPY_ANNOTATE { | ||
| ext.args = params.module_args | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.