diff --git a/CHANGELOG.md b/CHANGELOG.md index 491f4296..8c56805d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated pipeline template to [nf-core/tools 2.7.2](https://github.com/nf-core/tools/releases/tag/2.7.2) - [[#317](https://github.com/nf-core/chipseq/issues/317)] Added metro map +- [[#288](https://github.com/nf-core/chipseq/issues/291)] Bump `chromap` version 2 and enable all the steps below chromap again when paired-end data is processed. ## [[2.0.0](https://github.com/nf-core/chipseq/releases/tag/2.0.0)] - 2022-10-03 diff --git a/bin/bampe_rm_orphan.py b/bin/bampe_rm_orphan.py index 4ab9935b..ddba1d6f 100755 --- a/bin/bampe_rm_orphan.py +++ b/bin/bampe_rm_orphan.py @@ -46,7 +46,6 @@ def makedir(path): - if not len(path) == 0: try: os.makedirs(path) @@ -63,7 +62,6 @@ def makedir(path): def bampe_rm_orphan(BAMIn, BAMOut, onlyFRPairs=False): - ## SETUP DIRECTORY/FILE STRUCTURE OutDir = os.path.dirname(BAMOut) makedir(OutDir) @@ -89,7 +87,6 @@ def bampe_rm_orphan(BAMIn, BAMOut, onlyFRPairs=False): ## FILTER FOR READS ON SAME CHROMOSOME IN FR ORIENTATION if onlyFRPairs: if pair1.tid == pair2.tid: - ## READ1 FORWARD AND READ2 REVERSE STRAND if not pair1.is_reverse and pair2.is_reverse: if pair1.reference_start <= pair2.reference_start: diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py index eaf0d24c..3fd6ff8a 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -49,7 +49,6 @@ def check_samplesheet(file_in, file_out): sample_mapping_dict = {} with open(file_in, "r", encoding="utf-8-sig") as fin: - ## Check header MIN_COLS = 2 HEADER = ["sample", "fastq_1", "fastq_2", "antibody", "control"] @@ -156,7 +155,6 @@ def check_samplesheet(file_in, file_out): + "\n" ) for sample in sorted(sample_mapping_dict.keys()): - ## Check that multiple runs of the same sample are of the same datatype i.e. single-end / paired-end if not all(x[0] == sample_mapping_dict[sample][0][0] for x in sample_mapping_dict[sample]): print_error( diff --git a/bin/igv_files_to_session.py b/bin/igv_files_to_session.py index 629e6cc9..6fdcb1a9 100755 --- a/bin/igv_files_to_session.py +++ b/bin/igv_files_to_session.py @@ -55,7 +55,6 @@ def makedir(path): - if not len(path) == 0: try: os.makedirs(path) @@ -72,7 +71,6 @@ def makedir(path): def igv_files_to_session(XMLOut, ListFile, ReplaceFile, Genome, PathPrefix=""): - makedir(os.path.dirname(XMLOut)) replaceFileDict = {} diff --git a/bin/macs2_merged_expand.py b/bin/macs2_merged_expand.py index aa401123..28ffb087 100755 --- a/bin/macs2_merged_expand.py +++ b/bin/macs2_merged_expand.py @@ -55,7 +55,6 @@ def makedir(path): - if not len(path) == 0: try: os.makedirs(path) @@ -78,7 +77,6 @@ def makedir(path): def macs2_merged_expand(MergedIntervalTxtFile, SampleNameList, OutFile, isNarrow=False, minReplicates=1): - makedir(os.path.dirname(OutFile)) combFreqDict = {} diff --git a/modules.json b/modules.json index a2d49adf..7af6cca7 100644 --- a/modules.json +++ b/modules.json @@ -27,12 +27,12 @@ }, "chromap/chromap": { "branch": "master", - "git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905", + "git_sha": "d6b7b1f108dab88b0269a4331767c36a1a8da960", "installed_by": ["modules"] }, "chromap/index": { "branch": "master", - "git_sha": "5e34754d42cd2d5d248ca8673c0a53cdf5624905", + "git_sha": "d6b7b1f108dab88b0269a4331767c36a1a8da960", "installed_by": ["modules"] }, "custom/dumpsoftwareversions": { diff --git a/modules/nf-core/chromap/chromap/main.nf b/modules/nf-core/chromap/chromap/main.nf index 137f0340..5b7631cb 100644 --- a/modules/nf-core/chromap/chromap/main.nf +++ b/modules/nf-core/chromap/chromap/main.nf @@ -2,15 +2,15 @@ process CHROMAP_CHROMAP { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::chromap=0.2.1 bioconda::samtools=1.15.1" : null) + conda "bioconda::chromap=0.2.4 bioconda::samtools=1.16.1" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:963e4fe6a85c548a4018585660aed79780a175d3-0' : - 'quay.io/biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:963e4fe6a85c548a4018585660aed79780a175d3-0' }" + 'https://depot.galaxyproject.org/singularity/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:5b2e433ab8b3d1ef098fc944b567fd98caa23f56-0' : + 'quay.io/biocontainers/mulled-v2-1f09f39f20b1c4ee36581dc81cc323c70e661633:5b2e433ab8b3d1ef098fc944b567fd98caa23f56-0' }" input: tuple val(meta), path(reads) - path fasta - path index + tuple val(meta2), path(fasta) + tuple val(meta2), path(index) path barcodes path whitelist path chr_order diff --git a/modules/nf-core/chromap/chromap/meta.yml b/modules/nf-core/chromap/chromap/meta.yml index a86fddc9..10ce8f58 100644 --- a/modules/nf-core/chromap/chromap/meta.yml +++ b/modules/nf-core/chromap/chromap/meta.yml @@ -20,7 +20,7 @@ tools: homepage: https://github.com/haowenz/chromap documentation: https://github.com/haowenz/chromap tool_dev_url: https://github.com/haowenz/chromap - doi: "" + licence: ["GPL v3"] input: - meta: @@ -33,6 +33,11 @@ input: description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, respectively. + - meta2: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test' ] - fasta: type: file description: | @@ -86,3 +91,4 @@ output: authors: - "@mahesh-panchal" + - "@joseespinosa" diff --git a/modules/nf-core/chromap/index/main.nf b/modules/nf-core/chromap/index/main.nf index ee370695..25ee6a7e 100644 --- a/modules/nf-core/chromap/index/main.nf +++ b/modules/nf-core/chromap/index/main.nf @@ -2,17 +2,17 @@ process CHROMAP_INDEX { tag "$fasta" label 'process_medium' - conda (params.enable_conda ? "bioconda::chromap=0.2.1" : null) + conda "bioconda::chromap=0.2.4" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/chromap:0.2.1--hd03093a_0' : - 'quay.io/biocontainers/chromap:0.2.1--hd03093a_0' }" + 'https://depot.galaxyproject.org/singularity/chromap:0.2.4--hd03093a_0' : + 'quay.io/biocontainers/chromap:0.2.4--hd03093a_0' }" input: - path fasta + tuple val(meta), path(fasta) output: - path "*.index" , emit: index - path "versions.yml", emit: versions + tuple val(meta), path ("*.index"), emit: index + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-core/chromap/index/meta.yml b/modules/nf-core/chromap/index/meta.yml index 6659221f..39c5459b 100644 --- a/modules/nf-core/chromap/index/meta.yml +++ b/modules/nf-core/chromap/index/meta.yml @@ -11,10 +11,15 @@ tools: homepage: https://github.com/haowenz/chromap documentation: https://github.com/haowenz/chromap tool_dev_url: https://github.com/haowenz/chromap - doi: "" + licence: ["GPL v3"] input: + - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - fasta: type: file description: Fasta reference file. @@ -24,6 +29,11 @@ output: type: file description: File containing software versions pattern: "versions.yml" + - meta: + type: map + description: | + Groovy Map containing reference information + e.g. [ id:'test' ] - index: type: file description: Index file of the reference genome @@ -31,3 +41,4 @@ output: authors: - "@mahesh-panchal" + - "@joseespinosa" diff --git a/subworkflows/local/prepare_genome.nf b/subworkflows/local/prepare_genome.nf index 6c18b41b..ed5377bf 100644 --- a/subworkflows/local/prepare_genome.nf +++ b/subworkflows/local/prepare_genome.nf @@ -176,10 +176,10 @@ workflow PREPARE_GENOME { ch_chromap_index = UNTAR_CHROMAP_INDEX ( [ [:], params.chromap_index ] ).untar.map{ it[1] } ch_versions = ch_versions.mix(UNTAR.out.versions) } else { - ch_chromap_index = file(params.chromap_index) + ch_chromap_index = [ [:], file(params.chromap_index) ] } } else { - ch_chromap_index = CHROMAP_INDEX ( ch_fasta ).index + ch_chromap_index = CHROMAP_INDEX ( [ [:], ch_fasta ] ).index ch_versions = ch_versions.mix(CHROMAP_INDEX.out.versions) } } diff --git a/workflows/chipseq.nf b/workflows/chipseq.nf index 5d7c67af..08069eb6 100644 --- a/workflows/chipseq.nf +++ b/workflows/chipseq.nf @@ -208,39 +208,11 @@ workflow CHIPSEQ { FASTQC_TRIMGALORE.out.reads, PREPARE_GENOME.out.chromap_index, PREPARE_GENOME.out.fasta + .map { + [ [:], it ] + } ) - - // Filter out paired-end reads until the issue below is fixed - // https://github.com/nf-core/chipseq/issues/291 - // ch_genome_bam = ALIGN_CHROMAP.out.bam - ALIGN_CHROMAP - .out - .bam - .branch { - meta, bam -> - single_end: meta.single_end - return [ meta, bam ] - paired_end: !meta.single_end - return [ meta, bam ] - } - .set { ch_genome_bam_chromap } - - ch_genome_bam_chromap - .paired_end - .collect() - .map { - it -> - def count = it.size() - if (count > 0) { - log.warn "=============================================================================\n" + - " Paired-end files produced by chromap cannot be used by some downstream tools due to the issue below:\n" + - " https://github.com/nf-core/chipseq/issues/291\n" + - " They will be excluded from the analysis. Consider using a different aligner\n" + - "===================================================================================" - } - } - - ch_genome_bam = ch_genome_bam_chromap.single_end + ch_genome_bam = ALIGN_CHROMAP.out.bam ch_genome_bam_index = ALIGN_CHROMAP.out.bai ch_samtools_stats = ALIGN_CHROMAP.out.stats ch_samtools_flagstat = ALIGN_CHROMAP.out.flagstat