-
Notifications
You must be signed in to change notification settings - Fork 936
Vembrane filter #9340
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
dhtt
wants to merge
8
commits into
nf-core:master
Choose a base branch
from
dhtt:vembrane_filter
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.
+666
−0
Open
Vembrane filter #9340
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6cf01ef
Hackathon - Add vembrane filter module
trangdo-hsc 0155088
Prepare for merge
trangdo-hsc 0a600e7
Prepare for merge
trangdo-hsc 5d1333f
Format, updates yml, add stub tests to vembrane/filter
dhtt f93e871
Prepare for merge
trangdo-hsc 7d199da
Prepare for merge
trangdo-hsc 0df8278
Fix output extension, output name, meta.yml
dhtt 6ac59f8
Minor fixes in snapshot test, main & meta output
dhtt 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::vembrane=2.4.0" |
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,65 @@ | ||
| process VEMBRANE_FILTER { | ||
| 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/vembrane:2.4.0--pyhdfd78af_0' | ||
| : 'biocontainers/vembrane:2.4.0--pyhdfd78af_0'}" | ||
|
|
||
| input: | ||
| tuple val(meta), path(vcf) | ||
| val expression | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.{vcf,bcf,bcf.gz}"), emit: vcf | ||
| path "versions.yml" , emit: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def args = task.ext.args ?: '' | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| extension = args.contains("--output-fmt vcf") || args.contains("-Ovcf") ? "vcf" : | ||
| args.contains("--output-fmt bcf") || args.contains("-Obcf") ? "bcf" : | ||
| args.contains("--output-fmt uncompressed-bcf") || args.contains("-Ouncompressed-bcf") ? "bcf.gz" : | ||
| "vcf" | ||
|
|
||
| if ("${vcf}" == "${prefix}.${extension}") { | ||
| error("Input and output names are the same, use \"task.ext.prefix\" in module configuration to disambiguate!") | ||
| } | ||
|
|
||
dhtt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
| vembrane filter \\ | ||
| ${args} \\ | ||
| ${expression} \\ | ||
| -o ${prefix}.${extension} \\ | ||
| ${vcf} | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| vembrane: \$(vembrane --version | sed '1!d;s/.* //') | ||
| END_VERSIONS | ||
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| extension = args.contains("--output-fmt vcf") || args.contains("-Ovcf") ? "vcf" : | ||
| args.contains("--output-fmt bcf") || args.contains("-Obcf") ? "bcf" : | ||
| args.contains("--output-fmt uncompressed-bcf") || args.contains("-Ouncompressed-bcf") ? "bcf.gz" : | ||
| "vcf" | ||
|
|
||
| if ("${vcf}" == "${prefix}.${extension}") { | ||
| error("Input and output names are the same, use \"task.ext.prefix\" in module configuration to disambiguate!") | ||
| } | ||
|
|
||
| """ | ||
| touch ${prefix}.${extension} | ||
|
|
||
| cat <<-END_VERSIONS > versions.yml | ||
| "${task.process}": | ||
| vembrane: \$(vembrane --version | sed '1!d;s/.* //') | ||
| 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,64 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
| name: "vembrane_filter" | ||
| description: Filter VCF files with vembrane | ||
| keywords: | ||
| - filter | ||
| - vcf | ||
| - bcf | ||
| - genomics | ||
| - variant | ||
| - annotation | ||
| tools: | ||
| - "vembrane": | ||
| description: "Filter VCF/BCF files with Python expressions." | ||
| homepage: "https://github.com/vembrane/vembrane/tree/main" | ||
| documentation: "https://github.com/vembrane/vembrane/blob/main/docs/filter.md" | ||
| tool_dev_url: "https://github.com/vembrane/vembrane.git" | ||
| doi: "10.1093/bioinformatics/btac810" | ||
| licence: ["MIT"] | ||
| identifier: biotools:vembrane/filter | ||
|
|
||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - vcf: | ||
| type: file | ||
| description: | | ||
| Path to the VCF/BCF file to be filtered. | ||
| e.g. 'file.vcf', 'file.vcf.gz', 'file.bcf', 'file.bcf.gz' | ||
| pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}" | ||
| ontologies: [] | ||
| - expression: | ||
| type: string | ||
| description: | | ||
| The filter expression can be any valid python expression that evaluates to a value of type bool. | ||
| e.g. 'ANN["SYMBOL"] == "CDH2"' | ||
| ontologies: [] | ||
|
|
||
| output: | ||
| vcf: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'test' ] | ||
| - "*.{vcf,bcf,bcf.gz}": | ||
| type: file | ||
| description: Filtered VCF output file | ||
| pattern: "*.{vcf,bcf,bcf.gz}" | ||
| ontologies: [] | ||
| versions: | ||
| - versions.yml: | ||
| type: file | ||
| description: File containing software versions | ||
| pattern: "versions.yml" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3750 # YAML | ||
| authors: | ||
| - "@trangdo-hsc" | ||
| - "@mkatsanto" | ||
| maintainers: | ||
| - "@trangdo-hsc" |
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,224 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process VEMBRANE" | ||
| script "../main.nf" | ||
| process "VEMBRANE_FILTER" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "vembrane" | ||
| tag "vembrane/filter" | ||
|
|
||
| test("homo sapiens - vcf") { | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo sapiens - vcf.gz") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.vcf.gz', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo sapiens - bcf") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.bcf', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo sapiens - bcf.gz") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bcf.gz', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo sapiens - vcf - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/vcf/test.rnaseq.vcf', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).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/popgen/plink_simulated.vcf.gz', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo sapiens - bcf - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/vcf/test.bcf', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).match() } | ||
| ) | ||
| } | ||
|
|
||
| } | ||
|
|
||
| test("homo sapiens - bcf.gz - stub") { | ||
|
|
||
| options "-stub" | ||
|
|
||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test' ], // meta map | ||
| file(params.modules_testdata_base_path + 'genomics/homo_sapiens/popgen/plink_simulated.bcf.gz', checkIfExists: true), | ||
| ] | ||
| input[1] = "'QUAL >= 30'" | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out, | ||
| path(process.out.versions[0]).yaml | ||
| ).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.