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

Fix: calculate Cooks distances with few samples #44

Merged
merged 4 commits into from
Jan 13, 2023

Conversation

BorisMuzellec
Copy link
Collaborator

This PR aims to fix the bug described in Issue #43.

The issue seemed to be that the summation was done on the wrong axis in the trimmed_variance function, called through robust_method_of_moments_disp in the calculate_cooks method of the DeseqDataSet class.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Very high level review, but is there any way to add a unit test to check the behaviour that lead to this bug? This way, we make sure the codebase does not forget about it. Also, it's a good way to ensure this PR really fixes the related issue.

@BorisMuzellec
Copy link
Collaborator Author

Very high level review, but is there any way to add a unit test to check the behaviour that lead to this bug?

I guess we could add a test where the pipeline is run on a dataset with few samples, as the piece of code responsible for the bug only is run only when no cohort has 3 or more samples. Not sure what to test for though, would error-free execution be enough?

@ghost
Copy link

ghost commented Jan 12, 2023

Not sure what to test for though, would error-free execution be enough?

Yes I think that simply adding this corner case and ensuring it runs without error is a good starting point!

@BorisMuzellec BorisMuzellec requested a review from a user January 12, 2023 14:15
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @BorisMuzellec

@BorisMuzellec BorisMuzellec merged commit 56a37f3 into main Jan 13, 2023
@BorisMuzellec BorisMuzellec deleted the fix_small_sample_cooks branch January 13, 2023 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant