Skip to content

Commit

Permalink
Merge pull request #200 from CCBR/iss-190-kls
Browse files Browse the repository at this point in the history
fix: check whether contrastsheet param is null
  • Loading branch information
kelly-sovacool authored Jul 15, 2024
2 parents a2bfd64 + d54b1a3 commit 97ac019
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
19 changes: 15 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
## 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
nextflow run CCBR/CHAMPAGNE
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

Expand Down
1 change: 0 additions & 1 deletion conf/full_mm10.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion conf/test_human.config
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion conf/test_mm10.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ nextflow.enable.dsl = 2

params {
input = null
contrasts = false
seq_center = null
read_length = null
genome = null
Expand Down
8 changes: 4 additions & 4 deletions subworkflows/local/input_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 ]
}

Expand Down

0 comments on commit 97ac019

Please sign in to comment.