Skip to content

Macs gsize docs validation - #548

Merged
JoseEspinosa merged 11 commits into
nf-core:devfrom
Kevin-Brockers:macs-gsize-docs-validation
Nov 18, 2026
Merged

JoseEspinosa merged 11 commits into
nf-core:devfrom
Kevin-Brockers:macs-gsize-docs-validation

Conversation

@Kevin-Brockers

@Kevin-Brockers Kevin-Brockers commented Nov 16, 2026 •

Copy link
Copy Markdown

PR checklist

Closes #478.
Claude and I tried to clarify the usage of macs_gsize.
Changed behavior ->


  1. If --macs_gsize is provided, this value is always used. It can be given as an integer, e.g. --macs_gsize 2805665311.
  2. If --genome and --read_length are provided and pre-computed macs_gsize for
    igenomes.config exist it will be used.
    Some commonly used genomes contain pre-computed macs_gsize with different read length (50, 75, 100, 150 and
    200 ).
  3. If --read_length is the only value provided for e.g. custom genomes (--fasta), then macs_gsize is calculated from the genome FASTA with khmer unique-kmers.py.

This should fix the bug described in #478.

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/chipseq branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit bd2ef1e

+| ✅ 273 tests passed       |+
#| ❔   5 tests were ignored |#
!| ❗   9 tests had warnings |!
Details

❗ Test warnings:

  • pipeline_todos - TODO string in CHANGELOG.md: ## v2.2.0dev - [unreleased replace with date on release ]
  • pipeline_todos - TODO string in nextflow.config: Optionally, you can add a pipeline-specific nf-core config at https://github.com/nf-core/configs
  • pipeline_todos - TODO string in nextflow.config: Update the field with the details of the contributors to your pipeline. New with Nextflow version 24.10.0
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in CONTRIBUTING.md: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc.
  • pipeline_todos - TODO string in main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!

❔ Tests ignored:

  • nextflow_config - Config default ignored: params.bamtools_filter_pe_config
  • nextflow_config - Config default ignored: params.bamtools_filter_se_config
  • files_unchanged - File ignored due to lint config: assets/nf-core-chipseq_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-chipseq_logo_dark.png
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore

✅ Tests passed:

Run details

  • nf-core/tools version 4.2.2
  • Run at 2026-11-18 12:30:03

@JoseEspinosa JoseEspinosa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a question, otherwise great job!

Comment thread nextflow_schema.json Resolved
Comment thread nextflow_schema.json Resolved
Comment thread main.nf Outdated
def getMacsGsize(params) {
def val = null
if (params.genomes && params.genome && params.genomes.containsKey(params.genome)) {
if (params.macs_gsize) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@JoseEspinosa after opening the PR, I realized that the pipeline actually never uses params.macs_gsize as a fall back, as suggested in the error message and the usage.

I added it now. I hope this solution is fine?

Also initialized macs_gsize in the nextflow.config.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I remember well @Kevin-Brockers, it was not initialize since otherwise, the parameter was not overwritten by the function that reads the predefined values, maybe in recent nextflow versions this behavior have changed, but worth checking

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think this changed with the newer nextflow versions.

Before this PR, params.macs_gsize is assigned by getMacsGsize(), therefore params.macs_gsize is always reassigned and --macs_gsize from the cli is never used in the pipeline.
I tested this behavior locally, I don't know how to write a nf-test for this.

Not sure if the params.macs_gsize = getMacsGsize() is an ideal pattern (reassigning params on the fly), I would be in favor of declaring a new variable instead but didn't want to make to many changes.

@Kevin-Brockers

Copy link
Copy Markdown
Author

What might be worth discussing is whether to let the user specify --macs_gsize at all or make --read_length required instead.

The behavior could be:

  1. if macs_gsize exist for the igenome use it.
  2. if macs_gsize does not exist for igenome or a custom reference genome fasta, always compute it using khmer.

I can ask on slack what user think? Setting a random macs_gsize could be dangerous...

@JoseEspinosa

Copy link
Copy Markdown
Member

What might be worth discussing is whether to let the user specify --macs_gsize at all or make --read_length required instead.

The behavior could be:

1. if macs_gsize exist for the igenome use it.

2. if macs_gsize does not exist for igenome or a custom reference genome fasta, always compute it using `khmer`.

I can ask on slack what user think? Setting a random macs_gsize could be dangerous...

Yes, I agree it could be dangerous, but it is something that can not be done by mistake, so the user is on full control of it.
Regarding, the code change:

Before this PR, params.macs_gsize is assigned by getMacsGsize(), therefore params.macs_gsize is always reassigned and --macs_gsize from the cli is never used in the pipeline.

I don't think this was the case, the thing is that nextflow does not overwrite this value when it is provided by the CLI or in the config file and the params.macs_gsize = getMacsGsize() in the script is silently ignored. That is why if you set macs_gsize=null in the nextflow.config then the value will never be reassigned.

Comment thread main.nf Resolved

@JoseEspinosa JoseEspinosa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Nice job! 🚀

@JoseEspinosa
JoseEspinosa merged commit 1fb7059 into nf-core:dev Nov 18, 2026
20 checks passed
@Kevin-Brockers
Kevin-Brockers deleted the macs-gsize-docs-validation branch November 18, 2026 20:26
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.

2 participants