Skip to content

Gc bias genomes - #71

Open
adrianreich wants to merge 28 commits into
masterfrom
gc_bias_genomes
Open

Gc bias genomes#71
adrianreich wants to merge 28 commits into
masterfrom
gc_bias_genomes

Conversation

@adrianreich

Copy link
Copy Markdown

No description provided.

Copilot AI lite review requested due to automatic review settings August 27, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for generating GC bias curves per organism when using composite references that provide a gc_groups_dir, while still producing the whole-reference curve. This fits the pipeline’s “collect statistics” stage and extends what gets forwarded into downstream aggregation.

Changes:

  • Introduces gc_bias_curves subworkflow to run Picard GC bias on whole reference and (optionally) per-contig-group subsets, plus concatenation of curves.
  • Adds new modules for subsetting BAMs by contig group and concatenating GC bias metrics.
  • Extends reference configuration to include gc_groups_dir for multiple genomes and updates reference paths.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
subworkflows/gc_bias_curves.nf New subworkflow orchestrating whole-reference and per-group GC bias generation.
modules/subset_bam_to_contig_group.nf New process to subset BAMs to contig groups with header validation for Picard compatibility.
modules/gc_bias.nf Refactors GC bias process to be reusable for whole vs group curves and to label group in output metrics.
modules/concatenate_gc_bias.nf New process to combine whole + per-group GC bias metrics into one file.
main.nf Switches pipeline to use gc_bias_curves and adds optional --genome_contigs aggregation input when contig groups exist.
conf/references.config Adds gc_groups_dir entries and updates reference file locations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread modules/concatenate_gc_bias.nf Outdated
Comment thread main.nf

///////// Collect statistics ///////
gc_bias( md_bams, genome_fa, genome_fai )
gc_bias_curves( md_bams )
@adrianreich
adrianreich requested a review from lnblum August 28, 2026 21:02
@adrianreich

Copy link
Copy Markdown
Author

Fixed the snapshots and pinned the versions of nextflow so that we don't have the CI failures anymore

@lnblum lnblum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Bit of a bummer that we have to write all the bams another time for really big runs, but not sure there's a feasible streaming option that doesn't make debugging harder.

Did you happen to test the workflow for a genome without gc_groups_dir, as I'm guessing folks running it externally may not use this feature?

I may have tried to derive contigs.txt and the bed file from an fai to reduce the number of independent inputs..what was your thinking around that?

@bwlang

bwlang commented Aug 31, 2026

Copy link
Copy Markdown
Member

I guess the ideal scenario (for a later improvement) would be to patch the gc bias tool to take a contig list and calculate on the fly. Probably pretty easy to add...

@adrianreich

Copy link
Copy Markdown
Author

Turned into a larger thing to incorporate the gc_groups and updating all of the genomes in the amazon bucket (including adding mouse). Updated the snapshots and pinned versions so that CI failures don't creep up again.

@adrianreich
adrianreich requested a review from lnblum September 3, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants