diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py index 59af511a348b1c995da1fb70075f50e3a6ff5a51..c498ef45ee96e33a8d4f81b0be948028c712db61 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -126,7 +126,7 @@ class RowChecker: for row in self.modified: sample = row[self._sample_col] seen[sample] += 1 - row[self._sample_col] = f"{sample}_T{seen[sample]}" + ##row[self._sample_col] = f"{sample}_T{seen[sample]}" def read_head(handle, num_lines=10): diff --git a/conf/modules.config b/conf/modules.config index 6a5ccd5f19dfee8372954c388f64c103e10145a4..031e7c6ee51d2834a9039fe09fce5bcee6dc1d3d 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -163,6 +163,7 @@ process { mode: 'copy', enabled: params.hicpro_maps ] + ext.prefix = { "${meta.id}.${resolution}" } } withName: 'ICE_NORMALIZATION' { @@ -193,6 +194,7 @@ process { saveAs: { filename -> filename.equals('versions.yml') ? null : filename }, mode: 'copy' ] + ext.prefix={ "cooler_bins_${cool_bin}" } } withName: 'COOLER_CLOAD' { @@ -202,6 +204,7 @@ process { mode: 'copy', enabled : params.save_raw_maps ] + ext.prefix = { "${meta.id}.${cool_bin}" } ext.args = "pairs -c1 2 -p1 3 -c2 4 -p2 5" } @@ -212,7 +215,7 @@ process { mode: 'copy' ] ext.args = '--force' - ext.prefix = { "${meta.id}_balanced" } + ext.prefix = { "${cool.baseName}_balanced" } } withName: 'COOLER_DUMP' { @@ -258,6 +261,7 @@ process { mode: 'copy' ] ext.args = '--bigwig' + ext.prefix = { "${meta.id}.${resolution}" } } //******************************** @@ -270,6 +274,7 @@ process { mode: 'copy' ] ext.args = '15 25 50 --window-pixels' + ext.prefix = { "${meta.id}.${resolution}" } } withName: 'HIC_FIND_TADS' { @@ -279,5 +284,6 @@ process { mode: 'copy' ] ext.args = '--correctForMultipleTesting fdr' + ext.prefix = { "${meta.id}.${resolution}" } } } diff --git a/modules/local/hicpro/bowtie2_merge.nf b/modules/local/hicpro/bowtie2_merge.nf index ed200d6a3eee66eccce53a0e1f15dc04eacdc2c9..ed6817c68d1516ed0ebba6a623b591a3125b778b 100644 --- a/modules/local/hicpro/bowtie2_merge.nf +++ b/modules/local/hicpro/bowtie2_merge.nf @@ -1,5 +1,5 @@ process MERGE_BOWTIE2{ - tag "$prefix" + tag "${meta.id}" label 'process_medium' conda (params.enable_conda ? "bioconda::samtools=1.15.1" : null) diff --git a/modules/local/hicpro/build_contact_maps.nf b/modules/local/hicpro/build_contact_maps.nf index 097ff59a8f51465b4867146a400211664d24067c..18ed243a98fd8daa0ee2c372cb23f5a67ab12cbc 100644 --- a/modules/local/hicpro/build_contact_maps.nf +++ b/modules/local/hicpro/build_contact_maps.nf @@ -1,5 +1,5 @@ process BUILD_CONTACT_MAPS{ - tag "$meta.id - $res" + tag "${meta.id}" label 'process_high_memory' conda (params.enable_conda ? "conda-forge::sed=4.7" : null) @@ -8,19 +8,20 @@ process BUILD_CONTACT_MAPS{ 'ubuntu:20.04' }" input: - tuple val(meta), path(vpairs), val(res) - path chrsize + tuple val(meta), path(vpairs), val(resolution) + tuple val(meta2), path(chrsize) output: - tuple val(meta), val(res), path("*.matrix"), path("*.bed"), emit: maps + tuple val(meta), val(resolution), path("*.matrix"), path("*.bed"), emit: maps script: + def prefix = task.ext.prefix ?: "${meta.id}" """ build_matrix \\ --matrix-format upper \\ - --binsize ${res} \\ + --binsize ${resolution} \\ --chrsizes ${chrsize} \\ --ifile ${vpairs} \\ - --oprefix ${meta.id}_${res} + --oprefix ${prefix} """ } diff --git a/modules/local/hicpro/combine_mates.nf b/modules/local/hicpro/combine_mates.nf index 83b18dc17fd76bc737bf7749a5d28953309c0a6c..c0a806381038e40269b8d215fc38325fddfd19a6 100644 --- a/modules/local/hicpro/combine_mates.nf +++ b/modules/local/hicpro/combine_mates.nf @@ -1,5 +1,5 @@ process COMBINE_MATES { - tag "$prefix" + tag "${meta.id}" label 'process_low' conda (params.enable_conda ? "conda-forge::python=3.9 bioconda::pysam=0.19.0" : null) diff --git a/modules/local/hicpro/merge_stats.nf b/modules/local/hicpro/merge_stats.nf index 743f3740f4a630a506c510cd4879c50844f51b7f..757ec23aaad8e471fd58ea2234db8210e351e969 100644 --- a/modules/local/hicpro/merge_stats.nf +++ b/modules/local/hicpro/merge_stats.nf @@ -1,4 +1,5 @@ process MERGE_STATS { + tag "${meta.id}" label 'process_low' conda (params.enable_conda ? "conda-forge::python=3.9" : null) diff --git a/modules/local/hicpro/run_ice.nf b/modules/local/hicpro/run_ice.nf index 996baf1e117dffa39ddc4a3c9769075771dab359..bf9bf6e25779c0622983b616e55fd2e7dbccb189 100644 --- a/modules/local/hicpro/run_ice.nf +++ b/modules/local/hicpro/run_ice.nf @@ -1,5 +1,5 @@ process ICE_NORMALIZATION{ - tag "$rmaps" + tag "${meta.id}" label 'process_high_memory' conda (params.enable_conda ? "conda-forge::python=3.9 bioconda::iced=0.5.10 conda-forge::numpy=1.22.3" : null) diff --git a/modules/local/multiqc.nf b/modules/local/multiqc.nf index 8fa76a16f250b1c5e2f1394508985b4a0b3ab2ab..8af7656b0220b56a3ae8e385ee4291baa9fbd1f4 100644 --- a/modules/local/multiqc.nf +++ b/modules/local/multiqc.nf @@ -1,10 +1,10 @@ process MULTIQC { label 'process_medium' - conda (params.enable_conda ? 'bioconda::multiqc=1.12' : null) - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/multiqc:1.12--pyhdfd78af_0' : - 'quay.io/biocontainers/multiqc:1.12--pyhdfd78af_0' }" + conda (params.enable_conda ? 'bioconda::multiqc=1.13' : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/multiqc:1.13--pyhdfd78af_0' : + 'quay.io/biocontainers/multiqc:1.13--pyhdfd78af_0' }" input: path multiqc_config diff --git a/modules/local/split_cooler_dump.nf b/modules/local/split_cooler_dump.nf index 38e7357e2222b4216fa346fbf12fad3004b1e209..b7272e81d51866dcc7f8aacf8d44f2d0c9cca81a 100644 --- a/modules/local/split_cooler_dump.nf +++ b/modules/local/split_cooler_dump.nf @@ -2,12 +2,17 @@ process SPLIT_COOLER_DUMP { tag "$meta.id" label 'process_low' + conda (params.enable_conda ? "conda-forge::gawk=5.1.0" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" + input: tuple val(meta), path(bedpe) output: - path "*.txt", emit: matrix - path "versions.yml", emit: versions + tuple val(meta), path("*.txt"), emit: matrix + path ("versions.yml"), emit: versions script: def args = task.ext.args ?: '' diff --git a/subworkflows/local/hicpro.nf b/subworkflows/local/hicpro.nf index 8b106a0820cf808501add6e5ad886cc726626107..60f99e08fab7782b4763c628f8d26087008d21be 100644 --- a/subworkflows/local/hicpro.nf +++ b/subworkflows/local/hicpro.nf @@ -72,6 +72,7 @@ workflow HICPRO { //if (params.split_fastq){ ch_valid_pairs = ch_valid_pairs.map{ it -> removeChunks(it)}.groupTuple() + ch_valid_pairs.view() ch_hicpro_stats = HICPRO_MAPPING.out.mapstats.map{it->removeChunks(it)}.groupTuple() .concat(HICPRO_MAPPING.out.pairstats.map{it->removeChunks(it)}.groupTuple(), ch_valid_stats.map{it->removeChunks(it)}.groupTuple()) diff --git a/subworkflows/local/input_check.nf b/subworkflows/local/input_check.nf index 9735a49889301692fde334da4403577bfa4313c6..3f21f1f2c5a6a82fc781647724c6db3b574813e0 100644 --- a/subworkflows/local/input_check.nf +++ b/subworkflows/local/input_check.nf @@ -9,7 +9,6 @@ workflow INPUT_CHECK { samplesheet // file: /path/to/samplesheet.csv main: - if (params.split_fastq){ SAMPLESHEET_CHECK ( samplesheet ) diff --git a/workflows/hic.nf b/workflows/hic.nf index d5ba119a27e94424d993fd1082746fed62566214..0f39687a16eadb0c00d359945c76a070fa8d4cab 100644 --- a/workflows/hic.nf +++ b/workflows/hic.nf @@ -184,6 +184,7 @@ workflow HIC { // // SUB-WORFLOW: HiC-Pro // + INPUT_CHECK.out.reads.view() HICPRO ( INPUT_CHECK.out.reads, PREPARE_GENOME.out.index,