-
Notifications
You must be signed in to change notification settings - Fork 1.1k
new module: fastaguard #12239
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
ehsanestaji
wants to merge
6
commits into
nf-core:master
Choose a base branch
from
ehsanestaji:fastaguard-module
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
new module: fastaguard #12239
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aef7705
add fastaguard module
ehsanestaji a820207
test: inline fastaguard fixtures
ehsanestaji 548f431
test: shorten fastaguard fixtures
ehsanestaji 88f93dc
fix: align fastaguard module conventions
ehsanestaji 11cca40
fix: update fastaguard module for 0.6.0
ehsanestaji 5f52339
Merge branch 'master' into fastaguard-module
SPPearce 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,5 @@ | ||
| channels: | ||
| - conda-forge | ||
| - bioconda | ||
| dependencies: | ||
| - bioconda::fastaguard=0.6.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,34 @@ | ||
| process FASTAGUARD { | ||
| 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/fastaguard:0.6.0--hfa8f182_0': | ||
| 'quay.io/biocontainers/fastaguard:0.6.0--hfa8f182_0' }" | ||
|
|
||
| input: | ||
| tuple val(meta), path(fasta) | ||
|
|
||
| output: | ||
| tuple val(meta), path("*.fastaguard.html"), emit: html | ||
| tuple val(meta), path("*.fastaguard.json"), emit: json | ||
| tuple val(meta), path("*.fastaguard.tsv"), emit: tsv | ||
| tuple val(meta), path("*.fastaguard_mqc.json"), emit: mqc | ||
| tuple val("${task.process}"), val('fastaguard'), eval('fastaguard --version | cut -d " " -f 2'), emit: versions_fastaguard, topic: versions | ||
|
|
||
| when: | ||
| task.ext.when == null || task.ext.when | ||
|
|
||
| script: | ||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||
| def args = task.ext.args ?: '' | ||
| """ | ||
| fastaguard ${fasta} \ | ||
| ${args} \ | ||
| --out ${prefix}.fastaguard.html \ | ||
| --json ${prefix}.fastaguard.json \ | ||
| --tsv ${prefix}.fastaguard.tsv \ | ||
| --multiqc ${prefix}.fastaguard_mqc.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,97 @@ | ||
| name: "fastaguard" | ||
| description: FASTA preflight QC for assembly pipelines | ||
| keywords: | ||
| - fasta | ||
| - assembly | ||
| - qc | ||
| tools: | ||
| - "fastaguard": | ||
| description: FASTA preflight QC for assembly pipelines | ||
| homepage: "https://github.com/ehsanestaji/FastaGuard" | ||
| documentation: "https://github.com/ehsanestaji/FastaGuard" | ||
| tool_dev_url: "https://github.com/ehsanestaji/FastaGuard" | ||
| licence: | ||
| - "MIT" | ||
| identifier: "" | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'sample' ] | ||
| - fasta: | ||
| type: file | ||
| description: Assembly FASTA file | ||
| pattern: "*.{fa,fasta,fa.gz,fasta.gz}" | ||
| ontologies: [] | ||
| output: | ||
| html: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'sample' ] | ||
| - "*.fastaguard.html": | ||
| type: file | ||
| description: FastaGuard HTML report | ||
| pattern: "*.fastaguard.html" | ||
| ontologies: [] | ||
| json: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'sample' ] | ||
| - "*.fastaguard.json": | ||
| type: file | ||
| description: FastaGuard JSON report | ||
| pattern: "*.fastaguard.json" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3464 | ||
| tsv: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'sample' ] | ||
| - "*.fastaguard.tsv": | ||
| type: file | ||
| description: FastaGuard TSV summary | ||
| pattern: "*.fastaguard.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 | ||
| mqc: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. [ id:'sample' ] | ||
| - "*.fastaguard_mqc.json": | ||
| type: file | ||
| description: MultiQC custom-content JSON | ||
| pattern: "*.fastaguard_mqc.json" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3464 | ||
| versions_fastaguard: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - fastaguard: | ||
| type: string | ||
| description: The tool name | ||
| - fastaguard --version | cut -d " " -f 2: | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| topics: | ||
| versions: | ||
| - - ${task.process}: | ||
| type: string | ||
| description: The process the versions were collected from | ||
| - fastaguard: | ||
| type: string | ||
| description: The tool name | ||
| - fastaguard --version | cut -d " " -f 2: | ||
| type: eval | ||
| description: The expression to obtain the version of the tool | ||
| authors: | ||
| - "@ehsanestaji" |
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,123 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test FASTAGUARD" | ||
| script "../main.nf" | ||
| process "FASTAGUARD" | ||
| config "./nextflow.config" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "fastaguard" | ||
| tag "fastaguard_single" | ||
|
|
||
| test("pass FASTA emits all reports") { | ||
| when { | ||
| process { | ||
| """ | ||
| def fasta = file(workDir.resolve("pass.fa").toString()) | ||
| fasta.text = [ | ||
| ">clean", | ||
| ("ACGT" * 60) | ||
| ].join("\\n") + "\\n" | ||
|
|
||
| input[0] = [ | ||
| [ id:'pass' ], | ||
| fasta | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } | ||
| ) | ||
| } | ||
|
SPPearce marked this conversation as resolved.
|
||
| } | ||
|
|
||
| test("warn FASTA preserves reports") { | ||
| when { | ||
| process { | ||
| """ | ||
| def fasta = file(workDir.resolve("warn.fa").toString()) | ||
| fasta.text = [ | ||
| ">long", | ||
| ("ACGT" * 60), | ||
| ">tiny", | ||
| "ACGT" | ||
| ].join("\\n") + "\\n" | ||
|
|
||
| input[0] = [ | ||
| [ id:'warn' ], | ||
| fasta | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("fail FASTA preserves reports for gate review") { | ||
| when { | ||
| process { | ||
| """ | ||
| def fasta = file(workDir.resolve("fail.fa").toString()) | ||
| fasta.text = [ | ||
| ">dup", | ||
| "ACGTACGT", | ||
| ">dup", | ||
| "ACGTACGT", | ||
| ">bad", | ||
| "ACGTXYZ" | ||
| ].join("\\n") + "\\n" | ||
|
|
||
| input[0] = [ | ||
| [ id:'fail' ], | ||
| fasta | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("invalid FASTA is represented in the evidence path") { | ||
| when { | ||
| process { | ||
| """ | ||
| def fasta = file(workDir.resolve("invalid.fa").toString()) | ||
| fasta.text = [ | ||
| ">empty_record", | ||
| ">next_record", | ||
| "ACGT" | ||
| ].join("\\n") + "\\n" | ||
|
|
||
| input[0] = [ | ||
| [ id:'invalid' ], | ||
| fasta | ||
| ] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(sanitizeOutput(process.out, unstableKeys: ["html", "json", "tsv", "mqc"])).match() } | ||
| ) | ||
| } | ||
| } | ||
| } | ||
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.