-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: BCFTOOLS_PLUGINVCF2TABLE #11219
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
Open
emmcauley
wants to merge
18
commits into
nf-core:master
Choose a base branch
from
fulcrumgenomics:em_bcftools_vcf_to_table
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.
Open
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a504b29
feat: BCFTOOLS_PLUGINVCF2TABLE
emmcauley f567cdd
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 70a3e6d
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley ca81087
fix: linting, test params, ontologies
emmcauley 526093c
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley d2a3d91
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley bcec421
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 6192b59
fix: reviewer comments
emmcauley 89c5fd6
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 3d62bd1
fix: fix versions emission + update snapshot
emmcauley d3de5af
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 0fdc9c3
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 3c0fd25
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 5f860dd
fix: update meta
emmcauley ff5c6d4
fix: reviewer comments -> collapse tuples, oras -> https, process_low…
emmcauley a9e86e3
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 367e756
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 1c8d38f
Merge branch 'master' into em_bcftools_vcf_to_table
emmcauley 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::bcftools=1.23.1" |
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 BCFTOOLS_PLUGINVCF2TABLE { | ||
| tag "${meta.id}" | ||
| label 'process_medium' | ||
|
|
||
| conda "${moduleDir}/environment.yml" | ||
| container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container | ||
| ? 'oras://community.wave.seqera.io/library/bcftools:1.23.1--16b1a31e5dc795f7' | ||
| : 'community.wave.seqera.io/library/bcftools:1.23.1--4d193a5f61d4aed7'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(vcf), path(tbi) | ||
| tuple val(meta2), path(regions) | ||
| tuple val(meta3), path(targets) | ||
| tuple val(meta4), path(samples) | ||
|
emmcauley marked this conversation as resolved.
Outdated
|
||
|
|
||
| output: | ||
| tuple val(meta), path("*.txt"), emit: txt | ||
| tuple val("${task.process}"), val('bcftools'), eval("bcftools --version"), topic: versions, emit: versions_bcftools | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def regions_file = regions ? "--regions-file ${regions}" : '' | ||
| def targets_file = targets ? "--targets-file ${targets}" : '' | ||
| def samples_file = samples ? "--samples-file ${samples}" : '' | ||
| """ | ||
| bcftools \\ | ||
| +vcf2table \\ | ||
| ${args} \\ | ||
| ${regions_file} \\ | ||
| ${targets_file} \\ | ||
| ${samples_file} \\ | ||
| ${vcf} \\ | ||
| > ${prefix}.txt | ||
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| """ | ||
| touch ${prefix}.txt | ||
| """ | ||
| } | ||
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,119 @@ | ||
| name: bcftools_pluginvcf2table | ||
| description: | | ||
| Converts VCF/BCF files into a tab-delimited table using the bcftools +vcf2table plugin. | ||
| Each variant is output as one row, with INFO and FORMAT fields as columns. | ||
| keywords: | ||
| - bcftools | ||
| - vcf | ||
| - table | ||
| - variant calling | ||
| tools: | ||
| - bcftools: | ||
| description: | | ||
| BCFtools is a set of utilities for variant calling and manipulating VCF/BCF files. | ||
| The +vcf2table plugin converts VCF records into a tab-delimited table format. | ||
| homepage: http://samtools.github.io/bcftools/bcftools.html | ||
| documentation: http://www.htslib.org/doc/bcftools.html | ||
| doi: "10.1093/gigascience/giab008" | ||
| licence: | ||
| - "MIT" | ||
| identifier: biotools:bcftools | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| ontologies: [] | ||
| - vcf: | ||
| type: file | ||
| description: VCF/BCF file to be converted (optionally bgzipped). | ||
| pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3016" # VCF | ||
| - tbi: | ||
| type: file | ||
| description: Index of the VCF/BCF file (required when vcf is bgzipped). | ||
| pattern: "*.{tbi,csi}" | ||
| ontologies: [] | ||
| - - meta2: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing regions file information | ||
| e.g. [ id:'test' ] | ||
| ontologies: [] | ||
| - regions: | ||
| type: file | ||
| description: | | ||
| Optional. Restrict the operation to regions listed in this BED or VCF file. | ||
| Relies on a tabix index. | ||
| pattern: "*.{bed,vcf,vcf.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3003" # BED | ||
| - edam: "http://edamontology.org/format_3016" # VCF | ||
| - - meta3: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing targets file information | ||
| e.g. [ id:'test' ] | ||
| ontologies: [] | ||
| - targets: | ||
| type: file | ||
| description: | | ||
| Optional. Restrict the operation to regions listed in this file | ||
| (does not rely on index files). | ||
| pattern: "*.{bed,vcf,vcf.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3003" # BED | ||
| - edam: "http://edamontology.org/format_3016" # VCF | ||
| - - meta4: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing samples file information | ||
| e.g. [ id:'test' ] | ||
| ontologies: [] | ||
| - samples: | ||
| type: file | ||
| description: | | ||
| Optional. File of sample names to include or exclude. | ||
| pattern: "*.txt" | ||
| ontologies: [] | ||
| output: | ||
| txt: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test', single_end:false ] | ||
| ontologies: [] | ||
| - "*.txt": | ||
| type: file | ||
| description: Tab-delimited table output from bcftools +vcf2table. | ||
| pattern: "*.txt" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_3475" # TSV | ||
| versions_bcftools: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - bcftools: | ||
| type: string | ||
| description: The name of the tool | ||
| - "bcftools --version": | ||
| type: string | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The name of the process | ||
| - bcftools: | ||
| type: string | ||
| description: The name of the tool | ||
| - "bcftools --version": | ||
| type: string | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@emmcauley" | ||
| maintainers: | ||
| - "@emmcauley" |
119 changes: 119 additions & 0 deletions
119
modules/nf-core/bcftools/pluginvcf2table/tests/main.nf.test
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,119 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process BCFTOOLS_PLUGINVCF2TABLE" | ||
| script "../main.nf" | ||
| process "BCFTOOLS_PLUGINVCF2TABLE" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "bcftools" | ||
| tag "bcftools/pluginvcf2table" | ||
|
|
||
| test("homo_sapiens - vcf_gz - tbi") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = [ [], [] ] | ||
| input[2] = [ [], [] ] | ||
| input[3] = [ [], [] ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - vcf_gz - tbi - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = [ [], [] ] | ||
| input[2] = [ [], [] ] | ||
| input[3] = [ [], [] ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| } | ||
| test("homo_sapiens - vcf_gz - tbi - regions") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = [ ['test_regions'], [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bed/test.bed', checkIfExists: true) ] ] | ||
| input[2] = [ [], [] ] | ||
| input[3] = [ [], [] ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out)).match() }, | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo_sapiens - vcf_gz - tbi - regions - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz', checkIfExists: true), | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.vcf.gz.tbi', checkIfExists: true) | ||
| ] | ||
| input[1] = [ ['test_regions'], [file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bed/test.bed', checkIfExists: true) ] ] | ||
| input[2] = [ [], [] ] | ||
| input[3] = [ [], [] ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(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.
Uh oh!
There was an error while loading. Please reload this page.