Skip to content

Ensure column ordering on get_mag_depths.py#911

Merged
dialvarezs merged 3 commits intonf-core:devfrom
dialvarezs:fix-depth-columns
Nov 4, 2025
Merged

Ensure column ordering on get_mag_depths.py#911
dialvarezs merged 3 commits intonf-core:devfrom
dialvarezs:fix-depth-columns

Conversation

@dialvarezs
Copy link
Member

@dialvarezs dialvarezs commented Nov 4, 2025

This PR address an issue I found when working on the snapshots.
In some (machine dependent?) cases, the get_mag_depths.py would not produce consistent column ordering on depth summaries, and as we are merging them the dummy way via .collectfile(keepHeader: true), that could result in partially swapped results in the final summary.

Example of the outcome (same test, different machines):
image

I also improved the script a little to make it easier on the eyes.

PR checklist

  • 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/mag branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines 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).

@dialvarezs dialvarezs marked this pull request as ready for review November 4, 2025 07:37
Copy link
Member

@jfy133 jfy133 left a comment

Choose a reason for hiding this comment

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

I can't really comment on the python code from a perspective of expertise, but I think I can follow - The 'main' line that fixes the bug is:

    sample_names = sorted(sample_names)

right @dialvarezs ? This is what ensures consistent output ordering?

Co-authored-by: James A. Fellows Yates <jfy133@gmail.com>
@dialvarezs dialvarezs merged commit bb77ce6 into nf-core:dev Nov 4, 2025
6 checks passed
@dialvarezs dialvarezs deleted the fix-depth-columns branch November 4, 2025 08:59
@dialvarezs dialvarezs mentioned this pull request Nov 5, 2025
11 tasks
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