Skip to content

Centrifuger centrifuger#11181

Open
haris18s wants to merge 8 commits intonf-core:masterfrom
haris18s:centrifuger_centrifuger
Open

Centrifuger centrifuger#11181
haris18s wants to merge 8 commits intonf-core:masterfrom
haris18s:centrifuger_centrifuger

Conversation

@haris18s
Copy link
Copy Markdown
Contributor

PR checklist

Closes #XXX

  • This comment contains a description of changes (with reason).
  • If you've added a new tool - have you followed 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.
  • Ensure that the test works with either Docker / Singularity:
    • For modules:
      • nf-core modules test centrifuger/centrifuger --profile docker
      • nf-core modules test centrifuger/centrifuger --profile singularity
      • nf-core modules test centrifuger/centrifuger --profile conda

Description

Classificion model for Centrifguer modules

Module details

  • Tool: Centrifuger v1.1.0
  • Inputs: Single-end or paired-end FASTQ reads + Centrifuger database (.cfr files)
  • !! Tests could not be fully validated locally due to Apple Silicon (ARM) architecture limitations . The test database (.cfr files) may need to be rebuilt on a native x86 machine .

@haris18s haris18s requested review from a team as code owners April 14, 2026 13:02
Comment thread .vscode/settings.json Outdated
@haris18s haris18s force-pushed the centrifuger_centrifuger branch 4 times, most recently from de98ca6 to af0fc61 Compare April 16, 2026 14:18
@jfy133
Copy link
Copy Markdown
Member

jfy133 commented Apr 16, 2026

@nf-core-bot fix linting

@mashehu mashehu force-pushed the centrifuger_centrifuger branch from d13ee7f to cc86b31 Compare April 16, 2026 18:43
@haris18s haris18s force-pushed the centrifuger_centrifuger branch 2 times, most recently from 2677360 to 02b122b Compare April 20, 2026 07:05
Comment thread modules/nf-core/centrifuger/centrifuger/tests/main.nf.test.snap Outdated
@haris18s haris18s force-pushed the centrifuger_centrifuger branch from 02b122b to 539a2e3 Compare April 20, 2026 07:59
tuple val(meta), path("${meta.id}.tsv"), emit: classification_file
tuple val(meta), path("${meta.id}.classified*"), optional: true, emit: fastq_classified
tuple val(meta), path("${meta.id}.unclassified*"), optional: true, emit: fastq_unclassified
tuple val("${task.process}"), val('centrifuger'), eval("centrifuger -v 2>&1 | head -n 1 | cut -d ' ' -f 2 | sed 's/^v//'"),emit: versions_centrifuger, topic: versions
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.

Suggested change
tuple val("${task.process}"), val('centrifuger'), eval("centrifuger -v 2>&1 | head -n 1 | cut -d ' ' -f 2 | sed 's/^v//'"),emit: versions_centrifuger, topic: versions
tuple val("${task.process}"), val('centrifuger'), eval("centrifuger -v 2>&1 | sed 's/Centrifuger v//'"),emit: versions_centrifuger, topic: versions

no need to be so fancy 🙂

Copy link
Copy Markdown
Contributor

@famosab famosab left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution to nf-core! We really appreciate it. I added a few comments to your PR.

Comment thread modules/nf-core/centrifuger/centrifuger/tests/main.nf.test Outdated
Comment on lines +103 to +108
{ assert snapshot(
file(process.out.classification_file[0][1]).name,
file(process.out.fastq_classified[0][1]).name,
file(process.out.fastq_unclassified[0][1]).name,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
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 can use

{ assert snapshot(sanitizeOutput(process.out)).match() }

for the stub assertion. It should not be necessary to do any other assertions in the stub test.

Comment on lines +43 to +46
file(process.out.classification_file[0][1]).name,
file(process.out.fastq_classified[0][1]).name,
file(process.out.fastq_unclassified[0][1]).name,
process.out.findAll { key, val -> key.startsWith('versions') }
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.

Are all of these files instable in md5sum?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

classification_file has a stable MD5, but the classified/unclassifeid are empty due to the tiny test database that was made - so linter rejects it.

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.

then lets get the md5sum of classification_file and leave the names for the other :)

Comment thread modules/nf-core/centrifuger/centrifuger/main.nf Outdated
Comment thread modules/nf-core/centrifuger/centrifuger/main.nf
Comment thread modules/nf-core/centrifuger/centrifuger/main.nf Outdated
Comment thread modules/nf-core/centrifuger/centrifuger/main.nf
@haris18s
Copy link
Copy Markdown
Contributor Author

Thank you for your contribution to nf-core! We really appreciate it. I added a few comments to your PR.

Thanks for the comments and suggestions

@haris18s haris18s force-pushed the centrifuger_centrifuger branch from 2fb3f96 to 2566f28 Compare April 22, 2026 08:56
jfy133 and others added 4 commits April 22, 2026 12:33
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Comment thread modules/nf-core/centrifuger/centrifuger/main.nf Outdated
Comment thread modules/nf-core/centrifuger/centrifuger/main.nf Outdated
Copy link
Copy Markdown
Member

@jfy133 jfy133 left a comment

Choose a reason for hiding this comment

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

Last stretch, once these are addressed you're good to go!

}

}
test("sarscov2 - fastq_single_end_stub") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
test("sarscov2 - fastq_single_end_stub") {
test("sarscov2 - fastq - single_end - stub") {

)
}
}
test("sarscov2 - fastq_paired_end") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
test("sarscov2 - fastq_paired_end") {
test("sarscov2 - fastq - paired_end") {

}
}

test("sarscov2 - fastq_single_end") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
test("sarscov2 - fastq_single_end") {
test("sarscov2 - fastq - single_end") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To follow our typical convention

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/centrifuger:1.1.0--hf426362_0':
'biocontainers/centrifuger:1.1.0--hf426362_0' }"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was changed like 2 days ago

Suggested change
'biocontainers/centrifuger:1.1.0--hf426362_0' }"
'quay.io/biocontainers/centrifuger:1.1.0--hf426362_0' }"


input:
tuple val(meta), path(reads)
path db
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion(non-blocking)
I would argue the db could also have a meta (in this case meta2 - we use meta with databases in taxprofiler)

Suggested change
path db
tuple val(meta2), path(db)

If you go with it, make sure to update the tests

${umi_arg} \\
-t ${task.cpus} \\
${args} > ${prefix}.tsv

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change

#main output
touch ${prefix}.tsv

#Optional outputs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#Optional outputs
## Optional outputs

def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo ${args}
#main output
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
#main output
## main output

- edam: http://edamontology.org/format_1930 #FASTQ
- db:
type: directory
description: Path to directory containing Centrifuger database files.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
description: Path to directory containing Centrifuger database files.
description: Path to directory containing Centrifuger database files (that end in `.cfr`).

- ${meta.id}.tsv:
type: file
description: |
File contαining classification results
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
File contαining classification results
File containing classification results

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.

5 participants