Skip to content

Add bamCompare support and robust BWA index resolution to ChIP-seq workflow#4

Open
WilliamLautertD wants to merge 2 commits into
mainfrom
codex/identify-column-for-input-samples-t9hf8d
Open

Add bamCompare support and robust BWA index resolution to ChIP-seq workflow#4
WilliamLautertD wants to merge 2 commits into
mainfrom
codex/identify-column-for-input-samples-t9hf8d

Conversation

@WilliamLautertD
Copy link
Copy Markdown
Owner

Motivation

  • Add automatic ChIP vs Input ratio bigWig generation (bamCompare) so ChIP samples can be directly compared to their paired Input controls.
  • Make control/Input pairing explicit in the sample sheet to avoid ambiguous pairing and to fail early when a control is missing.
  • Improve reference resolution so the workflow accepts either a BWA index basename or a FASTA and will auto-detect common .fa basenames and warn if it auto-corrects a relative path.

Description

  • Introduced a new BAM_COMPARE process that runs bamCompare with --ignoreDuplicates, --operation ratio, configurable --binSize and --smoothLength, and publishes ratio bigWigs to coverage/bamcompare.
  • Added new params in chipseq_nextflow.config: make_bamcompare, bamcompare_binsize, and bamcompare_smooth_length, and allocated withName: BAM_COMPARE CPUs.
  • Updated chipseq_samples.tsv template to include a control_sample column and updated the workflow to require a control_sample for non-Input conditions, storing it in meta.control_sample.
  • Implemented resolveBwaReference() and validateBwaReference() helper functions that locate BWA index files (.amb/.ann/.bwt/.pac/.sa) for a given basename or try .fa variants, set params.bwa_resolved_reference, and emit a warning if the path was auto-corrected.
  • Updated BWA_MEM_FILTER to use params.bwa_resolved_reference (or fall back to resolveBwaReference()), and added workflow wiring that joins chip sample BAMs with their Input BAMs and conditionally invokes BAM_COMPARE when params.make_bamcompare is enabled.
  • Documentation tweaks in README.md to document the control_sample pairing, bwa_index_prefix expectations, and bamCompare defaults.

Testing

  • No automated tests were run for this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant