Skip to content

new module: fastaguard#12239

Open
ehsanestaji wants to merge 4 commits into
nf-core:masterfrom
ehsanestaji:fastaguard-module
Open

new module: fastaguard#12239
ehsanestaji wants to merge 4 commits into
nf-core:masterfrom
ehsanestaji:fastaguard-module

Conversation

@ehsanestaji

Copy link
Copy Markdown
Contributor

Description

This PR adds a new FASTAGUARD module for FastaGuard, a FASTA preflight and triage tool for assembly and submission-readiness workflows.

The module emits HTML, JSON, TSV, MultiQC custom-content JSON, a captured FastaGuard exit-code file, and topic-channel version metadata. PASS/WARN/FAIL/invalid FASTA fixtures are included so blocking FASTA results still preserve report evidence for workflow review.

No existing FastaGuard module, open PR, or open issue was found before opening this PR.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests.
  • If you've added a new tool, follow the module conventions in the contribution docs.
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Broadcast software version numbers to topic: versions.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label.
  • Use BioConda and BioContainers if possible to fulfil software requirements.

Local validation

  • nf-core modules lint fastaguard - 47 passed, 0 warnings, 0 failures.
  • nf-core modules test fastaguard --profile conda --once --no-prompts - all tests passed.
  • nf-core modules test fastaguard --profile docker --once --no-prompts - all tests passed.
  • nf-core modules test fastaguard --profile singularity - not run locally because Singularity/Apptainer is not installed on this macOS host.

Comment thread modules/nf-core/fastaguard/tests/main.nf.test
Comment thread modules/nf-core/fastaguard/tests/data/fail.fa Outdated
def fasta = file(workDir.resolve("pass.fa").toString())
fasta.text = [
">clean",
"ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could probably make this string a bit shorter ;)

Comment thread modules/nf-core/fastaguard/main.nf Outdated
def prefix = task.ext.prefix ?: meta.id
def args = task.ext.args ?: '--profile assembly --gate pipeline'
"""
set +e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required, it should be set by default.

Suggested change
set +e

Comment thread modules/nf-core/fastaguard/main.nf Outdated
task.ext.when == null || task.ext.when

script:
def prefix = task.ext.prefix ?: meta.id

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work?
This is what we normally use:

Suggested change
def prefix = task.ext.prefix ?: meta.id
def prefix = task.ext.prefix ?: ${meta.id}

Comment thread modules/nf-core/fastaguard/main.nf Outdated

script:
def prefix = task.ext.prefix ?: meta.id
def args = task.ext.args ?: '--profile assembly --gate pipeline'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't normally set default args like this. Are they required for the tool to run? Or to run on the test data?

Comment thread modules/nf-core/fastaguard/main.nf Outdated
Comment on lines +35 to +42
status=\$?
set -e

printf "%s\\n" "\${status}" > ${prefix}.fastaguard.exit_code

if [ "\${status}" -eq 3 ]; then
exit "\${status}"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for, why are you trying to capture the exit code in this way?

Comment thread modules/nf-core/fastaguard/meta.yml Outdated
type: eval
description: The expression to obtain the version of the tool
authors:
- "FastaGuard contributors"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the author of the nf-core/module (i.e. you)

def fasta = file(workDir.resolve("pass.fa").toString())
fasta.text = [
">clean",
("ACGT" * 60)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? If so, that's cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants