-
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| # 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.2.0" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,42 @@ | ||||||
| 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.2.0--pyhdfd78af_0' | ||||||
| : 'docker.io/griffithlab/civicpy:v5.2.0' }" | ||||||
|
Comment on lines
+7
to
+8
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are non-standard because I ran into issues building the wave container for docker + singularity
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a quay.io repository for custom docker containers. It is a recommendation to upload them there so that we stay independent of third parties that might delete the images. See the docs for more info. You can request the upload via #request-core in the nf-core slack. I think its fine to store it there until they resolve the issue on their side :) |
||||||
|
|
||||||
| input: | ||||||
| tuple val(meta), path(vcf), path(tbi) | ||||||
| val annotation_genome_version | ||||||
|
|
||||||
| output: | ||||||
| tuple val(meta), path("*.vcf"), emit: vcf | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 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 ?: '' | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}.civic" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If input and output names can overlap, use |
||||||
|
|
||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """ | ||||||
| export CIVICPY_CACHE_FILE=\$PWD/.civicpy | ||||||
|
|
||||||
| civicpy annotate-vcf \\ | ||||||
| --input-vcf ${vcf} \\ | ||||||
| --output-vcf ${prefix}.vcf \\ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We usually want the vcf files to be bgzipped if possible |
||||||
| --reference ${annotation_genome_version} \\ | ||||||
| ${args} | ||||||
| """ | ||||||
|
|
||||||
| stub: | ||||||
| def args = task.ext.args ?: '' | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}.civic" | ||||||
|
|
||||||
| """ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see above |
||||||
| touch ${prefix}.vcf | ||||||
| """ | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "civicpy_annotate" | ||
|
|
||
| description: A python client and analysis toolkit for the Clinical Interpretations of Variants in Cancer (CIViC) knowledgebase | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you be more specific for annotate here? |
||
| 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" | ||
|
|
||
| - 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": | ||
| type: file | ||
| description: Annotated VCF file | ||
| pattern: "*.vcf" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
|
|
||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3750 # YAML | ||
|
|
||
| authors: | ||
| - "@emmcauley" | ||
| maintainers: | ||
| - "@emmcauley" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| 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 { | ||
| 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' | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| 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 { | ||
| 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' | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| 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 { | ||
| 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' | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| file(process.out.vcf[0][1]).name, | ||
| process.out.versions_civicpy | ||
| ).match() } | ||
|
Comment on lines
+86
to
+89
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can use for the stub assertion. It should not be necessary to do any other assertions in the stub test. |
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "homo_sapiens - vcf - GRCh38 - stub": { | ||
| "content": [ | ||
| "test_sample.civic.vcf", | ||
| [ | ||
| [ | ||
| "CIVICPY_ANNOTATE", | ||
| "civicpy", | ||
| "5.2.0" | ||
| ] | ||
| ] | ||
| ], | ||
| "meta": { | ||
| "nf-test": "0.9.3", | ||
| "nextflow": "25.10.2" | ||
| }, | ||
| "timestamp": "2026-03-26T17:38:23.86228" | ||
| }, | ||
| "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" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| process { | ||
| withName: CIVICPY_ANNOTATE { | ||
| ext.args = '--include-status accepted' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We want the ext.args to be present in the main.nf.test file. That makes everything more readable in one go. See the module specifications for more info. |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conda probably has the same issue as the biocontainer / wave container?