-
Notifications
You must be signed in to change notification settings - Fork 5
Fix/clinvar prepare #206
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
Merged
AmberVerhasselt
merged 4 commits into
IntGenomicsLab:dev
from
AmberVerhasselt:fix/clinvar-prepare
Sep 25, 2026
Merged
Fix/clinvar prepare #206
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
07473cc
Download ClinVar once in PREPARE_VEP_PLUGINS, pinned by MD5
AmberVerhasselt 941567f
Report VEPPLUGIN_CLINVAR's version through versions.yml, not eval()
AmberVerhasselt 3962825
Fill in PR number in CHANGELOG entry
AmberVerhasselt a327baa
Address review on #206: fetch only http(s)/ftp, pin the CHM13 index
AmberVerhasselt 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
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
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
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
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
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,8 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| # renovate: datasource=conda depName=conda-forge/wget | ||
| - conda-forge::wget=1.21.4 |
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,68 @@ | ||
| process VEPPLUGIN_CLINVAR { | ||
| tag "${vcf_url.toString().tokenize('/').last()}" | ||
| label 'process_single' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container | ||
| ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/3b/3b54fa9135194c72a18d00db6b399c03248103f87e43ca75e4b50d61179994b3/data' | ||
| : 'community.wave.seqera.io/library/wget:1.21.4--8b0fcde81c17be5e'}" | ||
|
|
||
| input: | ||
| tuple val(vcf_url), val(tbi_url), val(md5), val(tbi_md5) | ||
|
|
||
| output: | ||
| path "${vcf_name}{,.tbi}", emit: files | ||
| // versions.yml rather than an eval() topic: eval outputs are numbered pipeline-wide, so adding | ||
| // one shifts the cache key of every other task that has one and breaks -resume of existing runs | ||
| path "versions.yml" , emit: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| vcf_name = vcf_url.toString().tokenize('/').last() | ||
| def sums = [ md5 ? "${md5} ${vcf_name}" : null, tbi_md5 ? "${tbi_md5} ${vcf_name}.tbi" : null ].findAll() | ||
| def check = sums ? "printf '%s\\n' ${sums.collect { line -> "'${line}'" }.join(' ')} | md5sum -c -" : '' | ||
| """ | ||
| # Retry a transient 503 from NCBI: a linear backoff of 1 s, 2 s, ... up to 10 s, about 45 s over 10 tries | ||
| wget \\ | ||
| --no-verbose \\ | ||
| --tries=10 \\ | ||
| --waitretry=10 \\ | ||
| --retry-on-http-error=429,500,502,503,504 \\ | ||
| ${args} \\ | ||
| -O ${vcf_name} \\ | ||
| ${vcf_url} | ||
|
|
||
| # Saved next to the VCF under the name VEP looks for, whatever the host calls it | ||
| wget \\ | ||
| --no-verbose \\ | ||
| --tries=10 \\ | ||
| --waitretry=10 \\ | ||
| --retry-on-http-error=429,500,502,503,504 \\ | ||
| ${args} \\ | ||
| -O ${vcf_name}.tbi \\ | ||
| ${tbi_url} | ||
|
|
||
| # Pinned checksums keep the release fixed: a host that re-publishes under the same name fails here | ||
| ${check} | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| wget: \$(wget --version | head -1 | cut -d ' ' -f 3) | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| stub: | ||
| vcf_name = vcf_url.toString().tokenize('/').last() | ||
| """ | ||
| echo "" | gzip > ${vcf_name} | ||
| touch ${vcf_name}.tbi | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| wget: \$(wget --version | head -1 | cut -d ' ' -f 3) | ||
| END_VERSIONS | ||
| """ | ||
| } |
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,51 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "vepplugin_clinvar" | ||
| description: Download a dated ClinVar VCF and its index once per run, checked against a pinned MD5, for the VEP --custom annotation | ||
| keywords: | ||
| - vep | ||
| - clinvar | ||
| - download | ||
| - annotation | ||
| tools: | ||
| - "wget": | ||
| description: "GNU Wget is a free software package for retrieving files using HTTP, HTTPS, FTP and FTPS" | ||
| homepage: "https://www.gnu.org/software/wget/" | ||
| documentation: "https://www.gnu.org/software/wget/manual/wget.html" | ||
| licence: ["GPL-3.0-or-later"] | ||
| identifier: "" | ||
|
|
||
| input: | ||
| - - vcf_url: | ||
| type: string | ||
| description: URL of the ClinVar VCF; its basename becomes the output name | ||
| - tbi_url: | ||
| type: string | ||
| description: URL of the tabix index published alongside the VCF | ||
| - md5: | ||
| type: string | ||
| description: | | ||
| Expected MD5 of the VCF. When set, a download that does not match fails | ||
| the task. May be null, in which case the release is not verified. | ||
| - tbi_md5: | ||
| type: string | ||
| description: | | ||
| Expected MD5 of the index, checked the same way. May be null, as for | ||
| NCBI, which publishes no checksum for its indexes. | ||
|
|
||
| output: | ||
| files: | ||
| - "${vcf_name}{,.tbi}": | ||
| type: file | ||
| description: The ClinVar VCF and its tabix index | ||
| pattern: "*.vcf.gz{,.tbi}" | ||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
|
|
||
| authors: | ||
| - "@AmberVerhasselt" | ||
| maintainers: | ||
| - "@AmberVerhasselt" |
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,41 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process VEPPLUGIN_CLINVAR" | ||
| script "../main.nf" | ||
| process "VEPPLUGIN_CLINVAR" | ||
|
|
||
| // "small" is what .github/workflows/nf-test.yml selects on for pull_request | ||
| tag "small" | ||
| tag "modules" | ||
| tag "modules_local" | ||
| tag "vepplugin_clinvar" | ||
|
Collaborator
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. Nit: PR CI runs only |
||
|
|
||
| // Stub only: a real run downloads the full ClinVar release | ||
| test("clinvar release - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| 'https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/archive_2.0/2026/clinvar_20260829.vcf.gz', | ||
| 'https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/archive_2.0/2026/clinvar_20260829.vcf.gz.tbi', | ||
| 'dffae274fd559ee764d1de44f36df2cf', | ||
| null // NCBI publishes no checksum for its index | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| // the VCF keeps its release name, and the index sits beside it under the name VEP looks for | ||
| { assert process.out.files[0].collect { f -> file(f).name }.sort() == [ 'clinvar_20260829.vcf.gz', 'clinvar_20260829.vcf.gz.tbi' ] }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
| } | ||
Oops, something went wrong.
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.
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.
This block replaces the default
publishDir, and the default is where thesaveAsthat dropsversions.ymllives. REVEL and EVE report their versions through topics, so this never mattered for them.VEPPLUGIN_CLINVARemits aversions.yml, so every run now publishes<outdir>/vep_plugins/versions.yml.