From b3a00f009a59f9d6c0db274b60766b8c17a2674b Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 12 Jul 2024 12:06:05 -0400 Subject: [PATCH 1/2] fix: check whether contrastsheet param is null resolves #196 --- conf/full_mm10.config | 1 - conf/test_human.config | 2 +- conf/test_mm10.config | 1 - main.nf | 8 +++++--- nextflow.config | 1 - subworkflows/local/input_check.nf | 8 ++++---- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/conf/full_mm10.config b/conf/full_mm10.config index 93e6c05..0a64efe 100644 --- a/conf/full_mm10.config +++ b/conf/full_mm10.config @@ -5,7 +5,6 @@ params { genome = 'mm10' outdir = "results/full_mm10" input = "${projectDir}/assets/samplesheet_full_mm10.csv" - contrasts = 'true' contrastsheet = "${projectDir}/assets/contrasts_full_mm10.yml" sicer { species = "mm10" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py diff --git a/conf/test_human.config b/conf/test_human.config index 0ea1f6b..c90f5ea 100644 --- a/conf/test_human.config +++ b/conf/test_human.config @@ -5,7 +5,7 @@ params { genome = 'hg38' outdir = "results/human" input = "assets/samplesheet_human.csv" - contrasts = false //'assets/contrasts_human.yml' + contrastsheet = null //'assets/contrasts_human.yml' //read_length = 50 sicer.species = "${params.genome}" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py diff --git a/conf/test_mm10.config b/conf/test_mm10.config index 421ff22..b8baddc 100644 --- a/conf/test_mm10.config +++ b/conf/test_mm10.config @@ -5,7 +5,6 @@ params { genome = 'mm10' outdir = "results/test_mm10" input = "${projectDir}/assets/samplesheet_test_mm10.csv" - contrasts = 'true' contrastsheet = "${projectDir}/assets/contrasts_test_mm10.yml" read_length = 50 sicer.species = "mm10" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py diff --git a/main.nf b/main.nf index 5c7b6b4..14598af 100644 --- a/main.nf +++ b/main.nf @@ -37,7 +37,7 @@ include { PHANTOM_PEAKS MULTIQC } from "./modules/local/qc.nf" -contrastsheet = params.contrastsheet ?: "/assets/contrast_test.ymls" +contrast_sheet = params.contrastsheet ? Channel.fromPath(file(params.contrastsheet, checkIfExists: true)) : params.contrastsheet workflow.onComplete { if (!workflow.stubRun && !workflow.commandLine.contains('-preview')) { @@ -67,7 +67,7 @@ workflow { } workflow CHIPSEQ { - INPUT_CHECK(file(params.input, checkIfExists: true), params.seq_center, file(contrastsheet)) + INPUT_CHECK(file(params.input, checkIfExists: true), params.seq_center, contrast_sheet) INPUT_CHECK.out.reads.set { raw_fastqs } raw_fastqs | CUTADAPT @@ -131,7 +131,9 @@ workflow CHIPSEQ { [ [ sample_basename: meta_split[0], tool: meta_split[1] ], bed ] } .set{ ch_consensus_peaks } - if (params.contrasts) { + + ch_contrasts = INPUT_CHECK.out.contrasts + if (!ch_contrasts.ifEmpty(null)) { // TODO use consensus peaks for regions of interest in diffbind CALL_PEAKS.out.bam_peaks .combine(deduped_bam) diff --git a/nextflow.config b/nextflow.config index 6c5829d..22a42cd 100644 --- a/nextflow.config +++ b/nextflow.config @@ -2,7 +2,6 @@ nextflow.enable.dsl = 2 params { input = null - contrasts = false seq_center = null read_length = null genome = null diff --git a/subworkflows/local/input_check.nf b/subworkflows/local/input_check.nf index 2d5fdb8..300913f 100644 --- a/subworkflows/local/input_check.nf +++ b/subworkflows/local/input_check.nf @@ -20,8 +20,8 @@ workflow INPUT_CHECK { .set { reads } // Run check on the contrast manifest - contrasts=Channel.empty() - if (params.contrasts) { + ch_contrasts = Channel.empty() + if (contrastsheet) { CHECK_CONTRASTS(valid_csv, contrastsheet) .csv .flatten() @@ -31,13 +31,13 @@ workflow INPUT_CHECK { [ sample_basename: meta.sample_basename, group: meta.group, contrast: meta.contrast ] } .unique() - .set{ contrasts } + .set{ ch_contrasts } } emit: reads = reads // channel: [ val(meta), [ reads ] ] csv = valid_csv - contrasts = contrasts + contrasts = ch_contrasts versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ] } From d54b1a3e047d5c8e5a0244cb2e2ce85aa080099e Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Fri, 12 Jul 2024 12:19:29 -0400 Subject: [PATCH 2/2] chore: update changelog --- CHANGELOG.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7732157..5da94fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,15 @@ ## CHAMPAGNE development version +### New features + - Create a script (`bin/champagne`) to provide an interface to the champagne CLI that works out-of-the-box without the need to install the python package with `pip`. (#180, @kelly-sovacool) - However, any dependencies not in the Python Standard Library must be installed for this to work. See the dependencies list in `pyproject.toml`. +- Allow additional columns in the sample sheet beyond the minimum required header. (#176, @kelly-sovacool) +- Add a workflow entry point to download fastq files from SRA. (#176, @kelly-sovacool) +- Add `test_human` profile with chipseq data from ENCODE. (#176, @kelly-sovacool) + +### Bug fixes + - Fix configuration files for compatibility with using the GitHub repo as the source. (#173, @kelly-sovacool) - These equivalent commands now work: ```sh @@ -9,11 +17,14 @@ champagne run --main CCBR/CHAMPAGNE ``` - Allow multiple samples to use the same input. (#176, @kelly-sovacool) -- Allow additional columns in the sample sheet beyond the minimum required header. (#176, @kelly-sovacool) +- In the biowulf config profile, switch variable $SLURM_JOBID to $SLURM_JOB_ID. (@kelly-sovacool) +- Increase resource allocations for chipseeker and deeptools. (#192, @slsevilla) +- Check the validity of the contrastsheet earlier on in the workflow. (#192, @slsevilla; #200, @kelly-sovacool) + +### Misc + - Change the peak widths histogram type from overlay to stack. (#176, @kelly-sovacool) -- Add a workflow entry point to download fastq files from SRA. (#176, @kelly-sovacool) -- Add `test_human` profile with chipseq data from ENCODE. (#176, @kelly-sovacool) -- In biowulf config profile, switch variable $SLURM_JOBID to $SLURM_JOB_ID. (@kelly-sovacool) +- Documentation improvements. (#192, @slsevilla) ## CHAMPAGNE 0.3.0