Skip to content

DOC Degrees of freedom corner case#153

Merged
BorisMuzellec merged 5 commits intomainfrom
degrees_of_freedom_corner_case
Jul 24, 2023
Merged

DOC Degrees of freedom corner case#153
BorisMuzellec merged 5 commits intomainfrom
degrees_of_freedom_corner_case

Conversation

@BorisMuzellec
Copy link
Copy Markdown
Collaborator

What does your PR implement? Be specific.

As pointed out by @mikelove, in the corner case where the design matrix has fewer than 3 degrees of freedom, the distribution of log dispersions is poorly estimated by the MAD, as in fit_dispersion_prior (cf the DESeq2 implementation of estimateDispersionsPriorVar).

This is a relatively minor issue that should be addressed in the future. Meanwhile, this PR:

  • updates the docstring of fit_dispersion_prior to reflect this issue,
  • raises a warning when this corner case arises.

@BorisMuzellec BorisMuzellec requested a review from a user July 19, 2023 09:14
@BorisMuzellec BorisMuzellec marked this pull request as draft July 19, 2023 09:15
@BorisMuzellec BorisMuzellec marked this pull request as ready for review July 19, 2023 11:59
Copy link
Copy Markdown
Collaborator

@maikia maikia left a comment

Choose a reason for hiding this comment

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

Thanks @BorisMuzellec
LGTM.

pydeseq2/dds.py Outdated

The computation is based on genes whose dispersions are above 100 * min_disp.

NB: when the design matrix has fewer than 3 degrees of freedom, the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NB can have different meanings. could you use NOTE: or something more explicit instead?

@BorisMuzellec BorisMuzellec merged commit 450f0d5 into main Jul 24, 2023
@BorisMuzellec BorisMuzellec deleted the degrees_of_freedom_corner_case branch July 24, 2023 10:25
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