Skip to content

Add formula based contrasts to deseq2 #8569

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

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

atrigila
Copy link
Contributor

nf-core/differentialabundance#459

Draft POC / work in progress

PR checklist

Closes #XXX

  • 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

@atrigila atrigila added the WIP Work in progress label May 28, 2025
@atrigila
Copy link
Contributor Author

atrigila commented Jun 2, 2025

I am not sure why only the conda test is failing even after setting seed.

Any ideas how to move forward?
cc @grst @pinin4fjords

@pinin4fjords
Copy link
Member

It's probably just floating point differences (IIRC there are rounding controls somewhere to help).

If you can, run with Docker and conda and compare the files to be sure.

@atrigila atrigila removed the WIP Work in progress label Jun 2, 2025
@atrigila atrigila marked this pull request as ready for review June 2, 2025 18:16
@atrigila atrigila requested a review from pinin4fjords as a code owner June 2, 2025 18:17
@atrigila atrigila requested a review from grst June 2, 2025 18:17
@atrigila atrigila marked this pull request as draft June 9, 2025 18:49
@@ -112,7 +125,8 @@ opt <- list(
cores = 1,
vs_blind = TRUE,
vst_nsub = 1000,
round_digits = NULL
round_digits = NULL,
seed = 1
Copy link
Member

Choose a reason for hiding this comment

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

I remember @pinin4fjords had a strong opinion on not setting a seed unless explicitly specified.
Can this default to NULL instead, and the set.seed below is only triggered if the seed is not NULL?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I will disagree strongly with folks who set seeds by default. The reason is that it gives unrealistic impressions of reproducibility. It's only valid in testing scenarios IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this had to be added for testing purposes only but I agree we can set this to NULL and then pass the arg in that test case.

@@ -281,22 +305,30 @@ if ((is_valid_string(opt\$exclude_samples_col)) && (is_valid_string(opt\$exclude
# Now specify the model. Use cell-means style so we can be explicit with the
# contrasts

model <- '~ 0'
if (is_valid_string(opt\$formula)) {
Copy link
Member

Choose a reason for hiding this comment

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

pls fix indentation

)
)
}
} else {
comp.results <-
Copy link
Member

Choose a reason for hiding this comment

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

pls fix indentation / consider autoformatting with air/styler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have the settings json file with

    "[r]": {
        "editor.formatOnSave": true
    }

but it doesn't seem to work, neither running air format . due to Failed to parse due to syntax errors. which stems from all opt$ having the backlash opt\$

Copy link
Member

Choose a reason for hiding this comment

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

ah, I see. That's correct, both formatters will only work on parsable syntax :/

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.

3 participants