Skip to content

Add Vizgenpostprocessing/preparesegmentation module #8575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

mcmero
Copy link

@mcmero mcmero commented May 30, 2025

PR checklist

Closes #8441

  • 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 module conventions in the contribution docs
  • If necessary, include test data in your PR.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules test <MODULE> --profile docker
      • nf-core modules test <MODULE> --profile singularity
      • nf-core modules test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

This PR adds the preparesegmentation process for cell segmentation using the vizgen-postprocessing tool for the MERSCOPE spatial omics instrument. The plan would be to add runsegmentationontile​ and compiletilesegmentation​ as subsequent modules to create a segmentation subworkflow for the tool.

The test data is prepared within the test module, using generated dummy data plus an existing segmentation image in nf-core/test-datasets, which needs to be renamed and put in an images directory to work with this module.

I could not find a BioContainer or BioConda package for this tool.

@mcmero mcmero changed the title Vizgenpostprocessing/preparesegmentation Add Vizgenpostprocessing/preparesegmentation module Jun 2, 2025
Copy link
Contributor

@LouisLeNezet LouisLeNezet left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.
There is a few modification to make it more nf-core like.

@LouisLeNezet LouisLeNezet added awaiting-changes will be closed after 30 days and removed Ready for Review labels Jun 3, 2025
@mcmero
Copy link
Author

mcmero commented Jun 4, 2025

Thanks you @LouisLeNezet for the review! I've implemented your suggestions. I am getting CI fails now due to an unrelated module. Do you have any suggestions here?

Copy link
Contributor

@LouisLeNezet LouisLeNezet left a comment

Choose a reason for hiding this comment

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

Thanks for fixing the modules, this is much better !
Just a few comments before merging.

For the CI fail, something bad migth have happen in another PR.
We will look into it.

Comment on lines 13 to 14
tuple val(meta), path("*/*.json"), emit: segmentation_files
path "versions.yml" , emit: versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tuple val(meta), path("*/*.json"), emit: segmentation_files
path "versions.yml" , emit: versions
tuple val(meta), path("${prefix}/*.json"), emit: segmentation_files
path "versions.yml" , emit: versions

Copy link
Author

Choose a reason for hiding this comment

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

Using prefix here isn't passing nf-test, I'm not sure why:

╭──────────────────────────────────── nf-test error ────────────────────────────────────╮
│ Assertion failed:                                                                     │
│                                                                                       │
│ assert process.success                                                                │
│        |       |                                                                      │
│        |       false                                                                  │
│        VIZGENPOSTPROCESSING_PREPARESEGMENTATION                                       │
│                                                                                       │
│ java.lang.NullPointerException: Cannot invoke method getAt() on null object           │
│ Assertion failed:                                                                     │
│                                                                                       │
│ assert process.success                                                                │
│        |       |                                                                      │
│        |       false                                                                  │
│        VIZGENPOSTPROCESSING_PREPARESEGMENTATION                                       │
│                                                                                       │
│ java.lang.NullPointerException                                                        │
│                                                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────╯

Copy link
Contributor

Choose a reason for hiding this comment

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

That's strange, it means that the process didn't found the folder "$prefix/".
Is it really created as such ?

Copy link
Contributor

@LouisLeNezet LouisLeNezet Jun 6, 2025

Choose a reason for hiding this comment

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

I tried locally and didn't had any issue...
You need to also remove the def from def prefix = ...

    output:
    tuple val(meta), path("${prefix}/*.json"), emit: segmentation_files
    path "versions.yml"                      , emit: versions

    when:
    task.ext.when == null || task.ext.when

    script:
    ...
    prefix = task.ext.prefix ?: "${meta.id}"
    ...

    stub:
    ...
    prefix = task.ext.prefix ?: "${meta.id}"

description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*/*.json":
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- "*/*.json":
- "${prefix}/*.json":

mcmero and others added 2 commits June 6, 2025 09:48
Co-authored-by: Louis Le Nézet <[email protected]>
Co-authored-by: Louis Le Nézet <[email protected]>
@LouisLeNezet LouisLeNezet added awaiting-changes will be closed after 30 days and removed awaiting-changes will be closed after 30 days labels Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-changes will be closed after 30 days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new module: vizgenpostprocessing/preparesegmentation​
2 participants