Skip to content
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

Contrasts schema validation #410

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Conversation

nschcolnicov
Copy link

To close #405 once the issue in the schema plugin is sorted out

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/differentialabundance branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nf-test test main.nf.test -profile test,docker).
  • 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).

@nf-core-bot
Copy link
Member

Warning

Newer version of the nf-core template is available.

Your pipeline is using an old version of the nf-core template: 3.0.2.
Please update your pipeline to the latest version.

For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation.

Copy link

github-actions bot commented Dec 20, 2024

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

Posted for pipeline commit 1398579

+| ✅ 304 tests passed       |+
#| ❔   6 tests were ignored |#
!| ❗   4 tests had warnings |!

❗ Test warnings:

  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • 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:

✅ Tests passed:

Run details

  • nf-core/tools version 3.0.2
  • Run at 2025-01-22 16:31:06

@nschcolnicov
Copy link
Author

Waiting on new nf-schema version 2.3.0 soon to be released

@nschcolnicov nschcolnicov marked this pull request as ready for review January 14, 2025 17:19
@nschcolnicov
Copy link
Author

nschcolnicov commented Jan 14, 2025

@grst I added the changes you mentioned, pipeline is working and tests are passing. Based on what we discussed here, we now need to merge this shinyngs PR, then make a new release, and then update the nf-core module, so that I can then update this PR with the latest version that allows .yaml contrasts files and I can delete the script in the bin/ folder. Looping @pinin4fjords in.

@pinin4fjords
Copy link
Member

bioconda/bioconda-recipes#53271

@nschcolnicov
Copy link
Author

@grst @pinin4fjords All set, please take a look!

Copy link
Member

@pinin4fjords pinin4fjords left a comment

Choose a reason for hiding this comment

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

A couple of comments. Please also update the tube map to reflect the the move away from CSV for contrasts.

Note also that this is quite a breaking change, so the next pipeline release is definitely a major one after this: 2.0.0.

workflows/differentialabundance.nf Outdated Show resolved Hide resolved
workflows/differentialabundance.nf Outdated Show resolved Hide resolved
@grst
Copy link
Member

grst commented Jan 21, 2025

Note also that this is quite a breaking change, so the next pipeline release is definitely a major one after this: 2.0.0.

Huh, I thought we kept accepting both formats for now? I'm fine either way, but then we should consider postponing a 2.0 release until we also implemented formula-based model definitions (#362) as this might possibly break compatibility to the current yaml format again.

@pinin4fjords
Copy link
Member

Huh, I thought we kept accepting both formats for now?

I thought so too, but the rest of the changes here seemed to indicate a change of plan.

@nschcolnicov
Copy link
Author

@grst I was acting on this comment. However, I noticed that @pinin4fjords had a different opinion about it. I can revert the changes regarding CSV compatibility; I just need to know the final decision on this matter.

@grst
Copy link
Member

grst commented Jan 21, 2025

I think the cost of backwards-compatibility is low here, so let's keep it.
Then we hopefully make breaking changes only once when switching to formula-based model definition.

@nschcolnicov
Copy link
Author

nschcolnicov commented Jan 21, 2025

@grst @pinin4fjords Adding backwards compatibility wasn't as trivial as I thought since I couldn't find a way of having a json schema that works for both csv and yaml files. What I did instead was add a line of code that would remove the contrasts schema validation from the nextflow_schema.json (and store it into a new schema file), whenever a csv contrasts file is provided. I also added a test case for csv contrasts file so that we don't lose this compatibility with further changes.
fa717f1
Let me know what you think

@pinin4fjords
Copy link
Member

@grst @pinin4fjords Adding backwards compatibility wasn't as trivial as I thought since I couldn't find a way of having a json schema that works for both csv and yaml files. What I did instead was add a line of code that would remove the contrasts schema validation from the nextflow_schema.json (and store it into a new schema file), whenever a csv contrasts file is provided. I also added a test case for csv contrasts file so that we don't lose this compatibility with further changes. fa717f1 Let me know what you think

I really don't think we should be dynamically changing workflow files. I see a few options:

  1. An extra param (contrasts_yml or somesuch), validated separately.
  2. (temporarily) no validation at all.
  3. We give up on the backwards compatibility given that there are more overheads than we expected.

Maybe we just bit the bullet and do 3. I would have liked it to be backwards compatible, but it's not looking very feasible without a high degree of additional complexity.

Thoughts?

@nschcolnicov
Copy link
Author

@grst @pinin4fjords Adding backwards compatibility wasn't as trivial as I thought since I couldn't find a way of having a json schema that works for both csv and yaml files. What I did instead was add a line of code that would remove the contrasts schema validation from the nextflow_schema.json (and store it into a new schema file), whenever a csv contrasts file is provided. I also added a test case for csv contrasts file so that we don't lose this compatibility with further changes. fa717f1 Let me know what you think

I really don't think we should be dynamically changing workflow files. I see a few options:

  1. An extra param (contrasts_yml or somesuch), validated separately.
  2. (temporarily) no validation at all.
  3. We give up on the backwards compatibility given that there are more overheads than we expected.

Maybe we just bit the bullet and do 3. I would have liked it to be backwards compatible, but it's not looking very feasible without a high degree of additional complexity.

Thoughts?

I like the idea of keeping backwards compatibility + keeping the validation, so I'm inclined towards the first bullet point. Let me revert the latest commit and add a draft commit with these changes and we can review again.

@nschcolnicov nschcolnicov force-pushed the contrasts_schema_validation branch from fa717f1 to 69a88be Compare January 22, 2025 14:41
@grst
Copy link
Member

grst commented Jan 23, 2025

I'm fine with either solution. It will anyway be a temporary solution until we start implementing the formula-based model definition.

@nschcolnicov
Copy link
Author

@pinin4fjords What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

4 participants