-
Notifications
You must be signed in to change notification settings - Fork 64
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
Fix: raise error when cooks outliers should have been refitted but were not #48
Conversation
…ed DeseqDataSet has "refit_cooks" set to True but Cooks outlier were not refitted
…ing a DeseqStats object from a DeseqDataSet object whose Cooks outliers were not refitted but should have been
pydeseq2/DeseqStats.py
Outdated
assert hasattr(dds, "replaced"), ( | ||
"dds has 'refit_cooks' set to True but Cooks outliers have not been " | ||
"refitted. Please run 'dds.refit()' first or set 'dds.refit_cooks' " | ||
"to False." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of an AssertionError
, what about raising an AttributeError
? Otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, an AttributeError
might be more appropriate indeed
…liers were not refit but should have been
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
if in the description of the PR you use: closes #issue_number the issue will automatically be closed when the PR is merged ( there are other possible keywords: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue )
Co-authored-by: Maria Telenczuk <[email protected]>
Thanks, I didn't know we could do that :) |
This PR addresses issue #46 by raising an
AssertionError
if one tries to initialize aDeseqStats
object from aDeseqDataSet
withrefit_cooks=True
but whose outliers were not refit.This is detected by checking that the
DeseqDataSet
has areplaced
attribute.A corresponding pytest was also added.
Closes #46.