-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add aardvark merge #12334
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
kubranarci
merged 3 commits into
nf-core:master
from
kubranarci:add-newmodule-aardvark-merge
Jul 10, 2026
Merged
add aardvark merge #12334
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,7 @@ | ||
| --- | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::aardvark=0.10.5 |
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,66 @@ | ||
| process AARDVARK_MERGE { | ||
| tag "$meta.id" | ||
| label 'process_low' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? | ||
| 'https://depot.galaxyproject.org/singularity/aardvark:0.10.5--h4349ce8_0': | ||
| 'quay.io/biocontainers/aardvark:0.10.5--h4349ce8_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(vcfs), path(indexes) | ||
| tuple val(meta2), path(fasta) | ||
| tuple val(meta3), path(bed) | ||
|
|
||
| output: | ||
| tuple val(meta), path('*.summary.tsv') , emit: summary | ||
| tuple val(meta), path('*.passing.vcf.gz') , emit: passing_vcf | ||
| tuple val(meta), path('*.passing.vcf.gz.tbi') , emit: passing_vcf_index | ||
| tuple val(meta), path('*.regions.bed.gz') , emit: passing_regions | ||
| tuple val(meta), path('*.regions.bed.gz.tbi') , emit: passing_regions_index | ||
| tuple val(meta), path('*.failed_regions.bed.gz') , emit: failed_regions | ||
| tuple val(meta), path('*.failed_regions.bed.gz.tbi') , emit: failed_regions_index | ||
| tuple val(meta), path('*.json') , emit: runinfo | ||
| tuple val("${task.process}"), val('aardvark'), eval("aardvark merge --version 2>&1 | sed 's/aardvark-bio-merge //; s/-conda//'"), topic: versions, emit: versions_aardvark | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def inputs = vcfs.collect { file -> "--input-vcf ${file}" }.join(' ') | ||
|
|
||
| """ | ||
| aardvark merge \\ | ||
| --threads $task.cpus \\ | ||
| --reference $fasta \\ | ||
| $inputs \\ | ||
| --regions ${bed} \\ | ||
| --output-vcfs $prefix \\ | ||
| --output-debug $prefix \\ | ||
| --output-summary ${prefix}.summary.tsv \\ | ||
| $args | ||
|
|
||
| for f in ${prefix}/*; do | ||
| mv "\$f" "${prefix}.\${f##*/}" | ||
| done | ||
|
|
||
| """ | ||
|
|
||
| stub: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| echo $args | ||
|
|
||
| echo "" | gzip > ${prefix}.passing.vcf.gz | ||
| echo "" | gzip > ${prefix}.regions.bed.gz | ||
| echo "" | gzip > ${prefix}.failed_regions.bed.gz | ||
| touch ${prefix}.passing.vcf.gz.tbi | ||
| touch ${prefix}.regions.bed.gz.tbi | ||
| touch ${prefix}.failed_regions.bed.gz.tbi | ||
| touch ${prefix}.summary.tsv | ||
| touch ${prefix}.cli_settings.json | ||
| """ | ||
| } |
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,160 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "aardvark_merge" | ||
| description: A tool to evaluate and merge multiple variant calls into a consensus VCF. | ||
| keywords: | ||
| - variant calling | ||
| - vcf | ||
| - comparison | ||
| - consensus | ||
| - merging | ||
| tools: | ||
| - aardvark: | ||
| description: | | ||
| The aardvark merge command provides a method to merge variant calls. This functionality is helpful when multiple | ||
| variant callers or technologies are used for the same sample. Merging variant sets can be complex and Aardvark | ||
| simplifies this process by modeling the variants as haplotypes. This allows for different merge strategies for | ||
| resolving conflicting variant sets. | ||
| homepage: "https://github.com/PacificBiosciences/aardvark" | ||
| documentation: "https://github.com/PacificBiosciences/aardvark/blob/main/docs/methods.md#merge-strategies" | ||
| tool_dev_url: "https://github.com/PacificBiosciences/aardvark" | ||
| doi: "10.1101/2025.10.03.680257" | ||
| licence: ["MIT"] | ||
| identifier: biotools:aardvark | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1' ]` | ||
| - vcfs: | ||
| type: file | ||
| description: List of VCF files to be merged | ||
| pattern: "*.{vcf.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
| - indexes: | ||
| type: file | ||
| description: List of index files for the input VCF files | ||
| pattern: "*.{vcf.gz.tbi,vcf.gz.csi,tbi,csi}" | ||
| - - meta2: | ||
| type: map | ||
| description: Groovy Map containing reference fasta information | ||
| - fasta: | ||
| type: file | ||
| description: Reference genome fasta file | ||
| pattern: "*.{fasta,fa,fasta.gz,fa.gz}" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_1929 # FASTA | ||
| - - meta3: | ||
| type: map | ||
| description: Groovy Map containing bed information | ||
| - bed: | ||
| type: file | ||
| description: Optional BED file containing genomic regions to restrict the merge operation | ||
| pattern: "*.{bed}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3586" | ||
|
|
||
| output: | ||
| summary: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.summary.tsv": | ||
| type: file | ||
| description: Global summary statistics of the variant merge | ||
| pattern: "*.summary.tsv" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3475" # TSV | ||
| passing_vcf: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.passing.vcf.gz": | ||
| type: file | ||
| description: Merged VCF file containing passing variants | ||
| pattern: "*.passing.vcf.gz" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" | ||
| passing_vcf_index: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.passing.vcf.gz.tbi": | ||
| type: file | ||
| description: Index file for the merged passing VCF | ||
| pattern: "*.passing.vcf.gz.tbi" | ||
| passing_regions: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.regions.bed.gz": | ||
| type: file | ||
| description: BED file of regions containing passing variants | ||
| pattern: "*.regions.bed.gz" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3586" | ||
| passing_regions_index: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.regions.bed.gz.tbi": | ||
| type: file | ||
| description: Index file for the passing regions BED | ||
| pattern: "*.regions.bed.gz.tbi" | ||
| failed_regions: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.failed_regions.bed.gz": | ||
| type: file | ||
| description: BED file of regions that failed merging criteria | ||
| pattern: "*.failed_regions.bed.gz" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3586" | ||
| failed_regions_index: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.failed_regions.bed.gz.tbi": | ||
| type: file | ||
| description: Index file for the failed regions BED | ||
| pattern: "*.failed_regions.bed.gz.tbi" | ||
| runinfo: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*.json": | ||
| type: file | ||
| description: JSON file containing parameter settings used during the run | ||
| pattern: "*.json" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3464 # JSON | ||
| versions_aardvark: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "aardvark": | ||
| type: string | ||
| description: The name of the tool | ||
| - "aardvark merge --version 2>&1 | sed 's/aardvark-bio-merge //; s/-conda//'": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
|
|
||
| topics: | ||
| versions: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: The name of the process | ||
| - "aardvark": | ||
| type: string | ||
| description: The name of the tool | ||
| - "aardvark merge --version 2>&1 | sed 's/aardvark-bio-merge //; s/-conda//'": | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
|
|
||
| authors: | ||
| - "@kubranarci" | ||
| maintainers: | ||
| - "@kubranarci" |
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,98 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process AARDVARK_MERGE" | ||
| script "../main.nf" | ||
| process "AARDVARK_MERGE" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "aardvark" | ||
| tag "aardvark/merge" | ||
|
|
||
| config "./nextflow.config" | ||
|
|
||
| test("homo_sapiens - vcf.gz") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| [ 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/haplotypecaller_calls/test2_haplotc.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), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| ] | ||
| input[1] = [ | ||
| [ id:'fasta' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) | ||
| ] | ||
| input[2] = [ | ||
| [id:'bed' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot( | ||
| path(process.out.passing_vcf[0][1]).vcf.summary, | ||
| file(process.out.passing_vcf[0][1]).name, | ||
| file(process.out.passing_vcf_index[0][1]).name, | ||
| file(process.out.failed_regions[0][1]).name, | ||
|
georgiakes marked this conversation as resolved.
|
||
| process.out.passing_regions, | ||
| process.out.passing_regions_index, | ||
| process.out.failed_regions_index, | ||
| process.out.runinfo, | ||
| process.out.summary, | ||
| process.out.findAll { key, val -> key.startsWith('versions') } | ||
| ).match() | ||
| } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - vcf.gz - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| [ 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/haplotypecaller_calls/test2_haplotc.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), | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/gatk/haplotypecaller_calls/test2_haplotc.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| ] | ||
| input[1] = [ | ||
| [ id:'fasta' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/genome.fasta', checkIfExists: true) | ||
| ] | ||
| input[2] = [ | ||
| [id:'bed' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr21/sequence/multi_intervals.bed', checkIfExists: true) | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assert process.success | ||
| assertAll( | ||
| { assert snapshot(process.out).match() } | ||
|
kubranarci marked this conversation as resolved.
|
||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| } | ||
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.