Skip to content
Merged
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
12 changes: 7 additions & 5 deletions modules/nf-core/pints/caller/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ channels:
- conda-forge
- bioconda
dependencies:
- bedtools=2.31.1
- htslib=1.22.1
- pip=25.2
- pybedtools=0.12.0
- python=3.12.6
- bioconda::bedtools=2.31.1
- bioconda::htslib=1.22.1
- bioconda::pybedtools=0.12.0
- conda-forge::python=3.12.6
- conda-forge::numpy=2.1.1
- conda-forge::pandas=2.2.3
- conda-forge::pip=25.2
- pip:
# NOTE PINTS isn't adding conda builds and is a few versions behind.
# renovate: datasource=pypi depName=pypints
Expand Down
35 changes: 20 additions & 15 deletions modules/nf-core/pints/caller/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ process PINTS_CALLER {
val assay_type

output:
tuple val(meta), path("*_divergent_peaks.bed") , optional:true, emit: divergent_TREs
tuple val(meta), path("*_bidirectional_peaks.bed") , optional:true, emit: bidirectional_TREs
tuple val(meta), path("*_unidirectional_peaks.bed"), optional:true, emit: unidirectional_TREs
tuple val(meta), path("peakcalling_*.log") , emit: peakcalling_log
path "versions.yml" , emit: versions
tuple val(meta), path("*_divergent_peaks.bed") , emit: divergent_TREs , optional:true
tuple val(meta), path("*_bidirectional_peaks.bed") , emit: bidirectional_TREs , optional:true
tuple val(meta), path("*_unidirectional_peaks.bed"), emit: unidirectional_TREs, optional:true
tuple val(meta), path("peakcalling_*.log") , emit: peakcalling_log
tuple val("${task.process}"), val('pints') , eval("pints_caller --version") , emit: versions_pints , topic: versions
tuple val("${task.process}"), val('python'), eval("python --version | sed 's/Python //g'"), emit: versions_python, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -31,18 +32,22 @@ process PINTS_CALLER {
// error "Please use bam or BigWig files"
"""
pints_caller \\
--bam-file $bams \\
--bam-file ${bams} \\
--save-to . \\
--file-prefix $prefix \\
--thread $task.cpus \\
--file-prefix ${prefix} \\
--thread ${task.cpus} \\
--dont-check-updates \\
--exp-type $assay_type \\
$args
--exp-type ${assay_type} \\
${args}
"""

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

cat <<-END_VERSIONS > versions.yml
"${task.process}":
python: \$(python --version | sed 's/Python //g')
pints: \$(pints_caller --version)
END_VERSIONS
"""
touch ${prefix}_divergent_peaks.bed
touch ${prefix}_bidirectional_peaks.bed
touch ${prefix}_unidirectional_peaks.bed
touch peakcalling_2026_08_05_14_20_53_41.log
"""
}
55 changes: 46 additions & 9 deletions modules/nf-core/pints/caller/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ tools:
documentation: "https://github.com/hyulab/PINTS/blob/main/README.md"
tool_dev_url: "https://github.com/hyulab/PINTS"
doi: "10.1038/s41587-022-01211-7"
licence: ["GPL v3"]
licence:
- "GPL v3"
identifier: biotools:pyPINTS
input:
- - meta:
Expand Down Expand Up @@ -73,8 +74,7 @@ output:
e.g. [ id:'test', single_end:false ]
- "*_unidirectional_peaks.bed":
type: file
description: Unidirectional TREs, maybe lncRNAs transcribed from enhancers
(e-lncRNAs)
description: Unidirectional TREs, maybe lncRNAs transcribed from enhancers (e-lncRNAs)
pattern: "*_unidirectional_peaks.bed"
optional: true
ontologies: []
Expand All @@ -89,13 +89,50 @@ output:
description: Peakcalling log for debugging purposes
pattern: "peakcalling_*.log"
ontologies: []
versions_pints:
- - ${task.process}:
type: string
description: The name of the process
- pints:
type: string
description: The name of the tool
- pints_caller --version:
type: eval
description: The expression to obtain the version of the tool

versions_python:
- - ${task.process}:
type: string
description: The name of the process
- python:
type: string
description: The name of the tool
- python --version | sed 's/Python //g':
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- pints:
type: string
description: The name of the tool
- pints_caller --version:
type: eval
description: The expression to obtain the version of the tool

- - ${task.process}:
type: string
description: The name of the process
- python:
type: string
description: The name of the tool
- python --version | sed 's/Python //g':
type: eval
description: The expression to obtain the version of the tool

authors:
- "@edmundmiller"
maintainers:
Expand Down
51 changes: 37 additions & 14 deletions modules/nf-core/pints/caller/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,24 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
{ assert snapshot( // Ignore peakcalling_log as file name has time stamp
process.out.divergent_TREs,
process.out.bidirectional_TREs,
file(process.out.unidirectional_TREs.get(0).get(1).get(0)).name,
path(process.out.versions.get(0)).yaml,
).match("bams")
},
process.out.unidirectional_TREs.collect{meta, beds -> [meta, beds.collect{bed -> file(bed).name}]},
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}

}

test("groHMM data - [bam], fasta") {
tag "test"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
[ id:'test' ],
file("https://raw.githubusercontent.com/Kraus-Lab/groHMM/master/inst/extdata/S0mR1.bam", checkIfExists: true),
[],
]
Expand All @@ -61,14 +60,12 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
{ assert snapshot( // Ignore peakcalling_log as file name has time stamp
process.out.divergent_TREs,
process.out.bidirectional_TREs,
file(process.out.unidirectional_TREs[0][1]).name,
path(process.out.versions.get(0)).yaml,
).match("single_bam")
},
{ assert snapshot(path(process.out.versions.get(0)).yaml).match("versions") },
process.out.unidirectional_TREs.collect{meta, bed -> [meta, file(bed).name]},
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}
}
Expand All @@ -79,7 +76,7 @@ nextflow_process {
process {
"""
input[0] = [
[ id:'test', single_end:false ],
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
[],
]
Expand All @@ -96,6 +93,32 @@ nextflow_process {
}
}

test("groHMM data - [bam, bam], fasta -- stub") {
options "-stub"
when {
process {
"""
input[0] = [
[ id:'test' ],
[
file("https://raw.githubusercontent.com/Kraus-Lab/groHMM/master/inst/extdata/S0mR1.bam", checkIfExists: true),
file("https://raw.githubusercontent.com/Kraus-Lab/groHMM/master/inst/extdata/S40mR1.bam", checkIfExists: true)
],
[],
]
input[1] = "GROseq"
"""
}
}

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

// TODO Test single bigwig input
// TODO Test multiple bigwig input
}
Loading