From 1bd1b1583a00b0bcc34d3959d02d2a03a0282ea6 Mon Sep 17 00:00:00 2001 From: bjlang <> Date: Tue, 9 Jul 2024 17:41:27 +0200 Subject: [PATCH] Clean up and removal of double slashes --- README.md | 2 +- conf/modules.config | 29 +++++++++---------- ...antify_qc_bedtools_featurecounts_deseq2.nf | 2 +- workflows/chipseq.nf | 11 ++----- 4 files changed, 18 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 2dcb70e1..ad2e4ea9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ ## Introduction -**nfcore/chipseq** is a bioinformatics analysis pipeline used for Chromatin ImmunopreciPitation sequencing (ChIP-seq) data. +**nfcore/chipseq** is a bioinformatics analysis pipeline used for Chromatin ImmunoPrecipitation sequencing (ChIP-seq) data. On release, automated continuous integration tests run the pipeline on a [full-sized dataset](https://github.com/nf-core/test-datasets/tree/chipseq#full-test-dataset-origin) on the AWS cloud infrastructure. The dataset consists of FoxA1 (transcription factor) and EZH2 (histone,mark) IP experiments from _Franco et al. 2015_ ([GEO: GSE59530](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE59530), [PMID: 25752574](https://pubmed.ncbi.nlm.nih.gov/25752574/)) and _Popovic et al. 2014_ ([GEO: GSE57632](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE57632), [PMID: 25188243](https://pubmed.ncbi.nlm.nih.gov/25188243/)), respectively. This ensures that the pipeline runs on AWS, has sensible resource allocation defaults set to run on real-world datasets, and permits the persistent storage of results to benchmark between pipeline releases and other analysis sources. The results obtained from running the full-sized tests can be viewed on the [nf-core website](https://nf-co.re/chipseq/results). diff --git a/conf/modules.config b/conf/modules.config index e374f867..f5f8394c 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -550,10 +550,7 @@ process { params.aligner == "chromap" ? "--format BAM" : '' //TODO check if not needed anymore with new chromap versions ].join(' ').trim() publishDir = [ - path: { [ - "${params.outdir}/${params.aligner}/merged_library/macs2", - params.narrow_peak? '/narrow_peak' : '/broad_peak' - ].join('') }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -562,14 +559,14 @@ process { withName: 'FRIP_SCORE' { ext.args = '-bed -c -f 0.20' publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/qc" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/qc" }, enabled: false ] } withName: 'MULTIQC_CUSTOM_PEAKS' { publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/qc" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/qc" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -582,7 +579,7 @@ if (!params.skip_peak_annotation) { ext.args = '-gid' ext.prefix = { "${meta.id}_peaks" } publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -594,7 +591,7 @@ if (!params.skip_peak_annotation) { withName: 'PLOT_MACS2_QC' { ext.args = '-o ./ -p macs2_peak' publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/qc" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/qc" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -604,7 +601,7 @@ if (!params.skip_peak_annotation) { ext.args = '-o ./' ext.prefix = 'macs2_annotatePeaks' publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/qc" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/qc" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -619,7 +616,7 @@ if (!params.skip_consensus_peaks) { ext.when = { meta.multiple_groups || meta.replicates_exist } ext.prefix = { "${meta.id}.consensus_peaks" } publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/consensus/${meta.id}" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/consensus/${meta.id}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -629,7 +626,7 @@ if (!params.skip_consensus_peaks) { ext.args = '-F SAF -O --fracOverlap 0.2' ext.prefix = { "${meta.id}.consensus_peaks" } publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/consensus/${meta.id}" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/consensus/${meta.id}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -642,7 +639,7 @@ if (!params.skip_consensus_peaks) { ext.args = '-gid' ext.prefix = { "${meta.id}.consensus_peaks" } publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/consensus/${meta.id}" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/consensus/${meta.id}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -651,7 +648,7 @@ if (!params.skip_consensus_peaks) { withName: 'ANNOTATE_BOOLEAN_PEAKS' { ext.prefix = { "${meta.id}.consensus_peaks" } publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/consensus/${meta.id}" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/consensus/${meta.id}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -671,7 +668,7 @@ if (!params.skip_consensus_peaks) { ].join(' ').trim() ext.prefix = { "${meta.id}.consensus_peaks" } publishDir = [ - path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}/consensus/${meta.id}/deseq2" }, + path: { "${params.outdir}/${params.aligner}/merged_library/macs2/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}/consensus/${meta.id}/deseq2" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] @@ -685,7 +682,7 @@ if (!params.skip_igv) { withName: 'IGV' { publishDir = [ [ - path: { "${params.outdir}/igv/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}" }, + path: { "${params.outdir}/igv/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}" }, mode: params.publish_dir_mode, pattern: '*.{txt,xml}' ], @@ -704,7 +701,7 @@ if (!params.skip_multiqc) { withName: 'MULTIQC' { ext.args = params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' publishDir = [ - path: { "${params.outdir}/multiqc/${params.narrow_peak ? '/narrow_peak' : '/broad_peak'}" }, + path: { "${params.outdir}/multiqc/${params.narrow_peak ? 'narrow_peak' : 'broad_peak'}" }, mode: params.publish_dir_mode, saveAs: { filename -> filename.equals('versions.yml') ? null : filename } ] diff --git a/subworkflows/local/bed_consensus_quantify_qc_bedtools_featurecounts_deseq2.nf b/subworkflows/local/bed_consensus_quantify_qc_bedtools_featurecounts_deseq2.nf index e3a38432..6b9b8efe 100644 --- a/subworkflows/local/bed_consensus_quantify_qc_bedtools_featurecounts_deseq2.nf +++ b/subworkflows/local/bed_consensus_quantify_qc_bedtools_featurecounts_deseq2.nf @@ -30,7 +30,7 @@ workflow BED_CONSENSUS_QUANTIFY_QC_BEDTOOLS_FEATURECOUNTS_DESEQ2 { ch_peaks .map { meta, peak -> - [ meta.antibody, meta.id.split('_')[0..-2].join('_'), peak ] + [ meta.antibody, meta.id - ~/_T\d+$/, peak ] } .groupTuple() .map { diff --git a/workflows/chipseq.nf b/workflows/chipseq.nf index 6f722b6f..54343de6 100644 --- a/workflows/chipseq.nf +++ b/workflows/chipseq.nf @@ -7,8 +7,6 @@ // // MODULE: Loaded from modules/local/ // -include { MACS2_CONSENSUS } from '../modules/local/macs2_consensus' -include { DESEQ2_QC } from '../modules/local/deseq2_qc' include { IGV } from '../modules/local/igv' include { MULTIQC } from '../modules/local/multiqc' include { MULTIQC_CUSTOM_PHANTOMPEAKQUALTOOLS } from '../modules/local/multiqc_custom_phantompeakqualtools' @@ -46,9 +44,6 @@ include { DEEPTOOLS_PLOTPROFILE } from '../modules/nf-core/deeptools/plo include { DEEPTOOLS_PLOTHEATMAP } from '../modules/nf-core/deeptools/plotheatmap/main' include { DEEPTOOLS_PLOTFINGERPRINT } from '../modules/nf-core/deeptools/plotfingerprint/main' include { KHMER_UNIQUEKMERS } from '../modules/nf-core/khmer/uniquekmers/main' -include { SUBREAD_FEATURECOUNTS } from '../modules/nf-core/subread/featurecounts/main' - -include { HOMER_ANNOTATEPEAKS as HOMER_ANNOTATEPEAKS_CONSENSUS } from '../modules/nf-core/homer/annotatepeaks/main' // // SUBWORKFLOW: Consisting entirely of nf-core/modules @@ -240,13 +235,13 @@ workflow CHIPSEQ { meta, bam -> def meta_clone = meta.clone() meta_clone.remove('read_group') - meta_clone.id = meta_clone.id.split('_')[0..-2].join('_') + meta_clone.id = meta_clone.id - ~/_T\d+$/ [ meta_clone, bam ] } .groupTuple(by: [0]) .map { - it -> - [ it[0], it[1].flatten() ] + meta, bam -> + [ meta, bam.flatten() ] } .set { ch_sort_bam }