diff --git a/CHANGELOG.md b/CHANGELOG.md index e3c8302..9544318 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Added` + Add CALDER2 compartments calling (see '--compartments_caller' option) + - Add new '--balancing_opts' to update `cooler balance` arguments - New subworkflow based on `pairtools` to detect valid pairs. The user diff --git a/nextflow.config b/nextflow.config index 66dbaf2..8e105f1 100644 --- a/nextflow.config +++ b/nextflow.config @@ -90,6 +90,7 @@ params { res_dist_decay = '250000' tads_caller = 'insulation' res_tads = '40000' + compartments_caller = 'cooltools' res_compartments = '250000' // Workflow diff --git a/nextflow_schema.json b/nextflow_schema.json index d4f08cf..4e20ba7 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -314,6 +314,11 @@ "default": "insulation", "description": "Define methods for TADs calling" }, + "compartments_caller": { + "type": "string", + "default": "cooltools", + "description": "Define methods for compartments calling" + }, "res_tads": { "type": "string", "pattern": "^(\\d+)(,\\d+)*$", diff --git a/subworkflows/local/compartments.nf b/subworkflows/local/compartments.nf index 7497e36..0ab2298 100644 --- a/subworkflows/local/compartments.nf +++ b/subworkflows/local/compartments.nf @@ -1,5 +1,5 @@ include { COOLTOOLS_EIGSCIS } from '../../modules/local/cooltools/eigscis' - +include { CALDER2 } from '../../modules/nfcore/calder2/main' workflow COMPARTMENTS { take: @@ -10,14 +10,26 @@ workflow COMPARTMENTS { main: ch_versions = Channel.empty() - COOLTOOLS_EIGSCIS( - cool, - fasta.map{it -> it[1]}.collect(), - chrsize.map{it -> it[1]}.collect() - ) - ch_versions = ch_versions.mix(COOLTOOLS_EIGSCIS.out.versions) + if (params.compartments_caller =~ 'cooltools'){ + COOLTOOLS_EIGSCIS( + cool, + fasta.map{it -> it[1]}.collect(), + chrsize.map{it -> it[1]}.collect() + ) + ch_versions = ch_versions.mix(COOLTOOLS_EIGSCIS.out.versions) + ch_comp = COOLTOOLS_EIGSCIS.out.results + } + + if (params.compartments_caller =~ 'calder2'){ + CALDER2( + cool, + Channel.value([]) + ) + ch_versions = ch_versions.mix(CALDER2.out.versions + ch_comp = CALDER2.out.output_folder + } emit: versions = ch_versions - compartments = COOLTOOLS_EIGSCIS.out.results + compartments = ch_comp }