Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions modules/nf-core/priorcons/build_priors/environment.yml
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::priorcons=0.1.0"
49 changes: 49 additions & 0 deletions modules/nf-core/priorcons/build_priors/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process PRIORCONS_BUILDPRIORS {
tag "$meta.id"
label 'process_low'

// TODO pending the container and singularity image being available with priorcons installed.
conda "${moduleDir}/environment.yml"
// container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
// 'https://depot.galaxyproject.org/singularity/YOUR-TOOL-HERE':
// 'biocontainers/YOUR-TOOL-HERE' }"

input:
tuple val(meta), path(alignment) // Input alignment FASTA file
val ref_id // Reference sequence ID

output:
tuple val(meta), path("*.parquet"), emit: priors
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}"
"""
priorcons \\
build-priors \\
--input ${alignment} \\
--ref ${ref_id} \\
--output ${prefix}.parquet \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
priorcons: \$(priorcons --version 2>&1 | sed 's/priorcons //')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.parquet

cat <<-END_VERSIONS > versions.yml
"${task.process}":
priorcons: \$(priorcons --version 2>&1 | sed 's/priorcons //')
END_VERSIONS
"""
}
58 changes: 58 additions & 0 deletions modules/nf-core/priorcons/build_priors/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "priorcons_buildpriors"
description: Build empirical priors from alignment data for consensus sequence
generation
keywords:
- alignment
- priors
- consensus
- genomics
tools:
- "priorcons":
description: "Tool for integrating consensus sequences using prior information."
homepage: "https://github.com/zhliUU/PriorCons"
documentation: "https://github.com/zhliUU/PriorCons"
tool_dev_url: "https://github.com/zhliUU/PriorCons"
licence: ["MIT"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- alignment:
type: file
description: Multiple sequence alignment file
pattern: "*.aln"
ontologies:
- edam: "http://edamontology.org/format_1984" # Plain text alignment format
- ref_id:
type: string
description: Reference sequence ID within the alignment file

output:
priors:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.parquet":
type: file
description: Empirical priors data in Parquet format
pattern: "*.parquet"
ontologies: []
versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: "http://edamontology.org/format_3750" # YAML

authors:
- "@zhliUU"
maintainers:
- "@zhliUU"
72 changes: 72 additions & 0 deletions modules/nf-core/priorcons/build_priors/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
nextflow_process {

name "Test Process PRIORCONS_BUILDPRIORS"
script "../main.nf"
process "PRIORCONS_BUILDPRIORS"

tag "modules"
tag "modules_nfcore"
tag "priorcons"
tag "priorcons/buildpriors"

test("build_priors_testfiles") {

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[ id:'rsv_test' ],
file('https://raw.githubusercontent.com/GERMAN00VP/PriorCons/b518f3725b2cc8820222ea52024a0a63f9e6dfe1/rsv_files/build_priors_testfiles/build_priors_test.aln', checkIfExists: true)
]
input[1] = 'RSV_BD'
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
process.out.priors
).match() }
)
}

}

test("build_priors_testfiles - stub") {

options "-stub"

when {
params {
outdir = "$outputDir"
}
process {
"""
input[0] = [
[ id:'rsv_test' ],
file('https://raw.githubusercontent.com/GERMAN00VP/PriorCons/b518f3725b2cc8820222ea52024a0a63f9e6dfe1/rsv_files/build_priors_testfiles/build_priors_test.aln', checkIfExists: true)
]
input[1] = 'RSV_BD'
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.versions,
process.out.priors
).match() }
)
}

}

}
42 changes: 42 additions & 0 deletions modules/nf-core/priorcons/build_priors/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"build_priors_testfiles - stub": {
"content": [
[
"versions.yml:md5,7555426e5737f1dc9bc4f261c31536e2"
],
[
[
{
"id": "rsv_test"
},
"rsv_test.parquet:md5,d41d8cd98f00b204e9800998ecf8427e"
]
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-10-29T15:05:15.403088"
},
"build_priors_testfiles": {
"content": [
[
"versions.yml:md5,7555426e5737f1dc9bc4f261c31536e2"
],
[
[
{
"id": "rsv_test"
},
"rsv_test.parquet:md5,c10fe51463dd23c5aa34fb39ccac9586"
]
]
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.0"
},
"timestamp": "2025-10-29T15:04:13.584116"
}
}
Loading