Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cc1141a
feat: updated fastANI module to include proper reference and query fi…
Dec 16, 2025
8d54dba
refactor: modified input/output options for fastANI and added stub test
Dec 17, 2025
fd58eb3
chore: updated meta.yml
Dec 17, 2025
7269f2e
Merge branch 'nf-core:master' into master
Ethan-Hetrick Dec 17, 2025
ae6a3c1
fix: corrected meta.yml
Dec 17, 2025
07024b8
fix: corrected file formats
Dec 17, 2025
b454c82
fix: added newline
Dec 17, 2025
c0979e1
fix: attempt 2 at fixing whitespaces
Dec 17, 2025
49bbc99
fix: attempt 3 at fixing whitespaces
Dec 17, 2025
4162446
fix: formatting
Dec 17, 2025
03ceb91
Update modules/nf-core/fastani/meta.yml
Ethan-Hetrick Dec 18, 2025
1b184c3
Update modules/nf-core/fastani/tests/main.nf.test
Ethan-Hetrick Dec 18, 2025
b2f8b66
Update modules/nf-core/fastani/main.nf
Ethan-Hetrick Dec 18, 2025
cd935a6
Update modules/nf-core/fastani/main.nf
Ethan-Hetrick Dec 18, 2025
e3fab37
Merge branch 'nf-core:master' into master
Ethan-Hetrick Dec 23, 2025
bd45cca
reverted changes to prefixes to properly accommodate a multi-way comp…
Dec 23, 2025
b60c343
Renamed test to be more descriptive
Dec 23, 2025
fe47276
Fixed whitespaces
Dec 23, 2025
b064fed
ran nf-test
Dec 23, 2025
979d31f
refactor: updated how tool version was output
Jan 14, 2026
86afed3
Merge branch 'master' into master
Ethan-Hetrick Jan 14, 2026
2c8c451
Update modules/nf-core/fastani/main.nf
Ethan-Hetrick Jan 14, 2026
d9f4922
fix: removed redundant tags in nf test script
Jan 14, 2026
c1fb69a
refactor: added new version syntax to stub as well
Jan 14, 2026
7df07cd
fix: fixed snapshot to capture new version syntax
Jan 14, 2026
75801b9
feature: added all v all mode test
Jan 14, 2026
8c8f5fa
chore: updated meta.yml to clarify input priority
Jan 14, 2026
523e1dd
chore: fixed whitespaces
Jan 14, 2026
9d1c320
chore: fixed whitespaces
Jan 14, 2026
1c042d6
fix: addressed nf-core lint errors and updated fastani version
Jan 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/fastani/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::fastani=1.32
- bioconda::fastani=1.34
64 changes: 30 additions & 34 deletions modules/nf-core/fastani/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,43 @@ process FASTANI {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/fastani:1.32--he1c1bb9_0' :
'biocontainers/fastani:1.32--he1c1bb9_0' }"
'https://depot.galaxyproject.org/singularity/fastani:1.34--hb66fcc3_7' :
'biocontainers/fastani:1.34--hb66fcc3_7' }"

input:
tuple val(meta), path(query)
path reference
tuple val(meta), path(query)
tuple val(meta2), path(reference)
path(ql)
path(rl)

output:
tuple val(meta), path("*.ani.txt"), emit: ani
path "versions.yml" , emit: versions
tuple val(meta), path("*.txt") , emit: ani
tuple val(meta), path("*.visual"), optional:true, emit: visual
tuple val(meta), path("*.matrix"), optional:true, emit: matrix
tuple val("${task.process}"), val("fastani"), eval('fastANI --version'), topic: versions, emit: versions_fastani
Copy link
Contributor

Choose a reason for hiding this comment

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

you'll need to add the old 2>&1 | sed 's/version//; somehow on the eval command to properly capture the verison. See other modules for reference such as jsaminesv


when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

if (meta.batch_input) {
"""
fastANI \\
-ql $query \\
-rl $reference \\
-o ${prefix}.ani.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastani: \$(fastANI --version 2>&1 | sed 's/version//;')
END_VERSIONS
"""
} else {
"""
fastANI \\
-q $query \\
-r $reference \\
-o ${prefix}.ani.txt

cat <<-END_VERSIONS > versions.yml
"${task.process}":
fastani: \$(fastANI --version 2>&1 | sed 's/version//;')
END_VERSIONS
"""
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: ( meta.id ?: 'all' )
def prefix2 = task.ext.prefix2 ?: ( meta2.id ?: 'all' )
def input_query = query ? "-q ${query}": "--ql ${ql}"
def input_reference = reference ? "-r ${reference}": "--rl ${rl}"
"""
fastANI \\
$input_query \\
$input_reference \\
--threads $task.cpus \\
-o ${prefix}.txt
"""

stub:
def prefix = task.ext.prefix ?: ( meta.id ?: 'all')
"""
touch ${prefix}.visual
touch ${prefix}.txt
touch ${prefix}.matrix
"""
}
93 changes: 70 additions & 23 deletions modules/nf-core/fastani/meta.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: fastani
description: Alignment-free computation of average nucleotide Identity (ANI)
description: Alignment-free computation of Average Nucleotide Identity (ANI)
keywords:
- genome
- fasta
- ANI
tools:
- fastani:
description: FastANI is developed for fast alignment-free computation of whole-genome
Average Nucleotide Identity (ANI).
description: FastANI is developed for fast alignment-free computation of whole-genome Average Nucleotide Identity (ANI).
homepage: https://github.com/ParBLiSS/FastANI
documentation: https://github.com/ParBLiSS/FastANI
tool_dev_url: https://github.com/ParBLiSS/FastANI
Expand All @@ -19,37 +18,85 @@ input:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
e.g. [ id:'test' ]
- query:
type: file
description: Fasta file(s) to be queried
pattern: "*.fasta"
ontologies: []
- reference:
description: Fasta file to be used as the query. If provided, ql will be ignored.
pattern: "*.{fasta,fna,fa}"
ontologies:
- edam: http://edamontology.org/format_1929 # FASTA
- - meta2:
type: map
description: Groovy Map containing sample information for the reference
- reference:
type: file
description: Fasta file to be used as the reference. If provided, rl will be ignored.
pattern: "*.{fasta,fna,fa}"
ontologies:
- edam: http://edamontology.org/format_1929 # FASTA
- ql:
type: file
description: File containing a list of query fasta paths. query input takes precedence over this list if both are provided.
pattern: "*.txt"
ontologies:
- edam: "http://edamontology.org/format_2330" # TXT
- rl:
type: file
description: Fasta file(s) to be used as reference for the query
pattern: "*.fasta"
ontologies: []
description: File containing a list of reference fasta paths. reference input takes precedence over this list if both are provided.
pattern: "*.txt"
ontologies:
- edam: "http://edamontology.org/format_2330" # TXT
output:
ani:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.ani.txt":
e.g. [ id:'test' ]
- "*.txt":
type: file
description: Results of the query
pattern: "*.ani.txt"
ontologies: []
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
description: ANI results file
pattern: "*.txt"
ontologies:
- edam: "http://edamontology.org/format_2330" # TXT
visual:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- "*.visual":
type: file
optional: true
description: FastANI visualization output
pattern: "*.visual"
ontologies:
- edam: "http://edamontology.org/format_3475" # TSV
matrix:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test' ]
- "*.matrix":
type: file
optional: true
description: ANI matrix output
ontologies:
- edam: "http://edamontology.org/format_3033" # MATRIX
versions_fastani:
- - ${task.process}:
type: string
description: The name of the process
- fastani:
type: string
description: The name of the tool
- fastANI --version:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@abhi18av"
- "@Ethan-Hetrick"
maintainers:
- "@abhi18av"
- "@Ethan-Hetrick"
84 changes: 80 additions & 4 deletions modules/nf-core/fastani/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ nextflow_process {
tag "fastani"
script "../main.nf"
process "FASTANI"

test("FastANI") {
config "./nextflow.config"
test("sarscov2 - referece vs contigs - fastANI - 1 v 1 mode") {

when {
process {
Expand All @@ -16,14 +16,90 @@ nextflow_process {
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
input[1] = [
[ id:'test2' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[2] = []
input[3] = []
"""
}
}

then {
assertAll (
{ assert snapshot(
process.out.ani,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}
}

test("sarscov2 - referece vs contigs - fastANI - all vs all mode") {

when {
process {
"""
def q_src = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
def r_src = file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)

// stage into the nf-test execution directory
def q_stage = new File(workDir.toString(), 'query.fasta')
def r_stage = new File(workDir.toString(), 'ref.fasta')

// Ensures files are staged locally
q_stage.bytes = q_src.bytes
r_stage.bytes = r_src.bytes

// create ql/rl list files
def ql_file = new File(workDir.toString(), 'query.list')
def rl_file = new File(workDir.toString(), 'reference.list')

ql_file.text = q_stage.getAbsolutePath() + System.lineSeparator()
Copy link
Contributor

Choose a reason for hiding this comment

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

But isnt ql_file.text now only contain the copied file q_stage path? What about the original q_src file? For many-to-many, it should include both.
Same for the reference text file below

rl_file.text = r_stage.getAbsolutePath() + System.lineSeparator()

input[0] = [ [], [] ]
input[1] = [ [], [] ]
input[2] = file( ql_file.getAbsolutePath(), checkIfExists: true )
input[3] = file( rl_file.getAbsolutePath(), checkIfExists: true )
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.ani,
process.out.findAll { key, val -> key.startsWith("versions") }
).match() }
)
}
}

test("stub") {

options '-stub'

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
input[1] = [
[ id:'test2' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fasta/contigs.fasta', checkIfExists: true)
]
input[2] = []
input[3] = []
"""
}
}

then {
assertAll (
{ assert snapshot(process.out).match() }
)
}
Expand Down
Loading
Loading