Skip to content

Cooltools insulation #3634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9952de7
[cooltools/insulation] init
nservant Jul 12, 2023
7c87026
[cooltools/insulation] new module
nservant Jul 12, 2023
3d667f2
[cooltools/insulation] lint
nservant Jul 12, 2023
ade58e6
Merge branch 'master' into cooltools_insulation
adamrtalbot Aug 2, 2023
709e007
update env with cooltools 0.5.4 and bedgraphtobigwig
nservant Aug 10, 2023
481b8e4
Merge branch 'cooltools_insulation' of github.com:nservant/modules in…
nservant Aug 10, 2023
ecc1da9
Merge branch 'master' into cooltools_insulation
SPPearce Apr 29, 2024
ce87e34
Merge branch 'master' into cooltools_insulation
SPPearce Jun 25, 2024
41a3efb
Swap to nf-test
SPPearce Jun 25, 2024
d7336e8
Update meta
SPPearce Jun 25, 2024
5162643
update version
SPPearce Jun 25, 2024
5e34af5
Merge branch 'master' into cooltools_insulation
SPPearce Jun 27, 2024
b77feb2
Merge branch 'master' into cooltools_insulation
SPPearce Mar 7, 2025
454a80f
lint .yml files
Thibault-Poinsignon Jun 3, 2025
8da86ab
update test dataset
Thibault-Poinsignon Jun 4, 2025
8237103
Merge pull request #2 from Thibault-Poinsignon/cooltools_insulation
nservant Jun 5, 2025
3c3aef5
Merge branch 'master' into cooltools_insulation
SPPearce Jun 5, 2025
3bc0d60
Update modules/nf-core/cooltools/insulation/tests/main.nf.test
Thibault-Poinsignon Jun 5, 2025
b5f1da9
Update file path
Thibault-Poinsignon Jun 5, 2025
33c4abc
add edam ontologies
Thibault-Poinsignon Jun 6, 2025
c32add8
Merge pull request #3 from Thibault-Poinsignon/cooltools_insulation
nservant Jun 6, 2025
3812060
Merge branch 'master' into cooltools_insulation
SPPearce Jun 6, 2025
4ba6899
Merge branch 'master' into cooltools_insulation
Thibault-Poinsignon Jun 16, 2025
72304e3
fix testdata_path param
Thibault-Poinsignon Jun 16, 2025
70cd9cc
Merge pull request #4 from Thibault-Poinsignon/cooltools_insulation
nservant Jun 16, 2025
ea7b764
fix params in main.nf
Thibault-Poinsignon Jun 16, 2025
2e77fc8
Merge pull request #5 from Thibault-Poinsignon/cooltools_insulation
nservant Jun 16, 2025
05bf340
Merge branch 'master' into cooltools_insulation
Thibault-Poinsignon Jun 16, 2025
ae51186
update cooltools version
Thibault-Poinsignon Jun 17, 2025
84e4a74
Merge pull request #6 from Thibault-Poinsignon/cooltools_insulation
nservant Jun 17, 2025
c1b8d51
Fix cooltools version
Thibault-Poinsignon Jun 17, 2025
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
6 changes: 6 additions & 0 deletions modules/nf-core/cooltools/insulation/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::cooltools=0.7.1
49 changes: 49 additions & 0 deletions modules/nf-core/cooltools/insulation/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
process COOLTOOLS_INSULATION {
tag "${meta.id}"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cooltools:0.7.1--py39hff726c5_2' :
'biocontainers/cooltools:0.7.1--py39hff726c5_2' }"

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

output:
tuple val(meta), path("*tsv"), emit:tsv
tuple val(meta), path("*.bw"), optional: true, emit: bigwig
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}"
"""
cooltools insulation \\
-p ${task.cpus} \\
-o ${prefix}_insulation.tsv \\
${cool} \\
${args} \\

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

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_insulation.tsv

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

}
51 changes: 51 additions & 0 deletions modules/nf-core/cooltools/insulation/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "cooltools_insulation"
description: Calculate the diamond insulation scores and call insulating boundaries
keywords:
- cool
- insulation
- Hi-C
tools:
- "cooltools":
description: "Analysis tools for genomic interaction data stored in .cool format"
homepage: "https://cooltools.readthedocs.io"
documentation: "https://cooltools.readthedocs.io"
tool_dev_url: "https://github.com/open2c/cooltools/"
doi: "10.5281/zenodo.5214125"
licence: ["MIT"]
identifier: biotools:cooltools

input:
- - meta:
type: map
description: Groovy Map containing sample information e.g. id:'test'
- cool:
type: file
description: cool file
pattern: "*.cool"

output:
- tsv:
- meta:
type: map
description: Groovy Map containing sample information e.g. id:'test'
- "*tsv":
type: file
description: tsv file with insulation score and boundaries for several window sizes
ontologies:
- edam: "http://edamontology.org/format_3475" # TSV
- bigwig:
- meta:
type: map
description: Groovy Map containing sample information e.g. id:'test'
- "*.bw":
type: file
description: bigwig file for different window sizes
ontologies:
- edam: "http://edamontology.org/format_3006" # bigWig
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@nservant"
62 changes: 62 additions & 0 deletions modules/nf-core/cooltools/insulation/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "cooltools"
tag "cooltools/insulation"

test("homo_sapiens - bam") {

when {
params {
modules_testdata_base_path = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/"
}
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.balanced.2.cool', checkIfExists: true)
]
"""
}
}

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

}

test("homo_sapiens - bam - stub") {

options "-stub"

when {
params {
modules_testdata_base_path = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/"
}
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/cooler/merge/toy/toy.symm.upper.balanced.2.cool', checkIfExists: true)
]
"""
}
}

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

}

}
80 changes: 80 additions & 0 deletions modules/nf-core/cooltools/insulation/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"homo_sapiens - bam": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_insulation.tsv:md5,950b848b7be4bbd63e897bd3989871de"
]
],
"1": [

],
"2": [
"versions.yml:md5,49359edc002cbf2d7f08475a768bf565"
],
"bigwig": [

],
"tsv": [
[
{
"id": "test"
},
"test_insulation.tsv:md5,950b848b7be4bbd63e897bd3989871de"
]
],
"versions": [
"versions.yml:md5,49359edc002cbf2d7f08475a768bf565"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-06-04T17:09:54.801181735"
},
"homo_sapiens - bam - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test_insulation.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [

],
"2": [
"versions.yml:md5,49359edc002cbf2d7f08475a768bf565"
],
"bigwig": [

],
"tsv": [
[
{
"id": "test"
},
"test_insulation.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,49359edc002cbf2d7f08475a768bf565"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.2"
},
"timestamp": "2025-06-04T17:10:08.339260848"
}
}
Loading