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
21 changes: 4 additions & 17 deletions modules/nf-core/calder2/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ process CALDER2 {
tag "$meta.id"
label 'process_high'

// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/r-calder2:0.7--r43hdfd78af_1' :
'biocontainers/r-calder2:0.7--r43hdfd78af_1' }"


input:
tuple val(meta), path(cool)
val resolution

output:
tuple val(meta), path("${prefix}/") , emit: output_folder
tuple val(meta), path("${prefix}/intermediate_data/") , emit: intermediate_data_folder , optional: true
path "versions.yml" , emit: versions
tuple val(meta), path("${prefix}/") , emit: output_folder
tuple val(meta), path("${prefix}/intermediate_data/") , emit: intermediate_data_folder, optional: true
// WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
tuple val("${task.process}"), val('calder'), val('0.7'), emit: versions_calder, topic: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -26,7 +25,6 @@ process CALDER2 {
prefix = task.ext.prefix ?: "${meta.id}"
def suffix = resolution ? "::/resolutions/$resolution" : ""
def cpus = task.cpus ?: 1
def VERSION = '0.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
# getting binsize as mandatory input for calder
binsize="\$(cooler info --field bin-size $cool$suffix)"
Expand All @@ -37,16 +35,10 @@ process CALDER2 {
--type cool \\
--bin_size "\${binsize}" \\
$args

cat <<-END_VERSIONS > versions.yml
"${task.process}":
calder: $VERSION
END_VERSIONS
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '0.7' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
mkdir -p ${prefix}/sub_compartments
mkdir -p ${prefix}/sub_domains
Expand All @@ -58,10 +50,5 @@ process CALDER2 {
touch ${prefix}/sub_compartments/cor_with_ref.txt

touch ${prefix}/sub_domains/all_nested_boundaries.bed

cat <<-END_VERSIONS > versions.yml
"${task.process}":
calder: $VERSION
END_VERSIONS
"""
}
53 changes: 34 additions & 19 deletions modules/nf-core/calder2/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,63 @@ tools:
documentation: "https://github.com/CSOgroup/CALDER2"
tool_dev_url: "https://github.com/CSOgroup/CALDER2"
doi: "10.1038/s41467-021-22666-3"
licence: ["MIT"]
licence:
- "MIT"
identifier: ""
input:
- - meta:
type: map
description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false
]
description: Groovy Map containing sample information. E.g. [ id:'test',
single_end:false ]
- cool:
type: file
description: Path to COOL file
pattern: "*.{cool.mcool}"
ontologies: []
- resolution:
type: integer
description: In case a .mcool file is provided, which resolution level to use
for the analysis
description: In case a .mcool file is provided, which resolution level to
use for the analysis
output:
output_folder:
- - meta:
type: map
description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false
]
description: Groovy Map containing sample information. E.g. [ id:'test',
single_end:false ]
- ${prefix}/:
type: directory
description: Output folder containing sub-compartment (.tsv/.bed) and domain
boundaries calls (.bed)
description: Output folder containing sub-compartment (.tsv/.bed) and
domain boundaries calls (.bed)
intermediate_data_folder:
- - meta:
type: map
description: Groovy Map containing sample information. E.g. [ id:'test', single_end:false
]
description: Groovy Map containing sample information. E.g. [ id:'test',
single_end:false ]
- ${prefix}/intermediate_data/:
type: directory
description: Output folder containing intermediate data produced during the
computation
description: Output folder containing intermediate data produced during
the computation
versions_calder:
- - ${task.process}:
type: string
description: The name of the process
- calder:
type: string
description: The name of the tool
- "0.7":
type: string
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
- calder:
type: string
description: The name of the tool
- "0.7":
type: string
description: The expression to obtain the version of the tool
authors:
- "@lucananni93"
maintainers:
Expand Down
40 changes: 19 additions & 21 deletions modules/nf-core/calder2/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import groovy.io.FileType

nextflow_process {

name "Test Process CALDER2"
Expand All @@ -14,15 +12,17 @@ nextflow_process {
test("test-calder2-cool") {

when {
params {
module_args = '--genome hg38'
}
process {
"""
input[0] = [
[ id:'test' ], //meta map
[ id:'test' ],
file('https://raw.githubusercontent.com/CSOgroup/CALDER2/main/tests/testthat/data/test.cool', checkIfExists: true)
]

input[1] = [:]

"""
}
}
Expand All @@ -31,12 +31,9 @@ nextflow_process {
assertAll(
{ assert process.success },
{
def output_dir = file(process.out.output_folder[0][1])
def all_files = []

file(process.out.output_folder[0][1]).eachFileRecurse (FileType.FILES) { file ->
all_files << file
}

output_dir.eachFileRecurse { all_files << it }
def all_file_names = all_files.collect { it.name }.toSorted()

def stable_file_names = [
Expand All @@ -52,7 +49,7 @@ nextflow_process {
assert snapshot(
all_file_names,
stable_files,
process.out.versions[0]
process.out.findAll { key, val -> key.startsWith('versions') }
).match()
}
)
Expand All @@ -62,15 +59,17 @@ nextflow_process {
test("test-calder2-mcool") {

when {
params {
module_args = '--genome hg38'
}
process {
"""
input[0] = [
[ id:'test' ], //meta map
[ id:'test' ],
file('https://raw.githubusercontent.com/CSOgroup/CALDER2/main/tests/testthat/data/test.mcool', checkIfExists: true)
]

input[1] = 100000

"""
}
}
Expand All @@ -79,12 +78,9 @@ nextflow_process {
assertAll(
{ assert process.success },
{
def output_dir = file(process.out.output_folder[0][1])
def all_files = []

file(process.out.output_folder[0][1]).eachFileRecurse (FileType.FILES) { file ->
all_files << file
}

output_dir.eachFileRecurse { all_files << it }
def all_file_names = all_files.collect { it.name }.toSorted()

def stable_file_names = [
Expand All @@ -100,7 +96,7 @@ nextflow_process {
assert snapshot(
all_file_names,
stable_files,
process.out.versions[0]
process.out.findAll { key, val -> key.startsWith('versions') }
).match()
}
)
Expand All @@ -111,23 +107,25 @@ nextflow_process {
options '-stub'

when {
params {
module_args = '--genome hg38'
}
process {
"""
input[0] = [
[ id:'test' ], //meta map
[ id:'test' ],
file('https://raw.githubusercontent.com/CSOgroup/CALDER2/main/tests/testthat/data/test.mcool', checkIfExists: true)
]

input[1] = 100000

"""
}
}

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