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

Added intercept to regress_out() #2731

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Added intercept to regress_out() #2731

wants to merge 7 commits into from

Conversation

ggit12
Copy link

@ggit12 ggit12 commented Nov 6, 2023

Added the boolean argument "add_intercept" to regress_out, and implemented code to optionally add the intercept back to the residuals in the result of regress_out().

  • Release notes not necessary because:

implemented the "add_intercept" argument to regress_out()
Finished including add_intercept into regress_out
fixed regression model
fixed indexing
@ggit12
Copy link
Author

ggit12 commented Nov 6, 2023

@LuckyMD

Copy link

codecov bot commented Nov 6, 2023

Codecov Report

Merging #2731 (5b9bc72) into master (b23229f) will decrease coverage by 0.01%.
The diff coverage is 86.95%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2731      +/-   ##
==========================================
- Coverage   72.87%   72.87%   -0.01%     
==========================================
  Files         110      110              
  Lines       12100    12107       +7     
==========================================
+ Hits         8818     8823       +5     
- Misses       3282     3284       +2     
Files Coverage Δ
scanpy/preprocessing/_simple.py 82.03% <86.95%> (-0.19%) ⬇️

@flying-sheep flying-sheep added this to the 1.10.0 milestone Nov 7, 2023
@flying-sheep
Copy link
Member

Hi! Can you explain a bit what use cases this helps people with? When would one want to set this to True?

Once we have a good example, you can use that to write a small test that checks if it works as intended.

@ggit12
Copy link
Author

ggit12 commented Nov 7, 2023

Hi,

I believe @LuckyMD detailed one use case here theislab/single-cell-tutorial#35.

Is this enough to get started?

@danielee0707
Copy link

danielee0707 commented Nov 8, 2023

Thanks for implementing this! I used it to regress out total counts and cell cycle scores before highly variable gene selection, and it worked well. The clusters are better separated without artifacts, unlike running regressing function after HVG.

@flying-sheep
Copy link
Member

flying-sheep commented Nov 9, 2023

Is this enough to get started?

For sure, thank you for the context!

Is it possible to add a unit test that checks that with this set to True, clusters are better separated?

@ivirshup ivirshup modified the milestones: 1.10.0, 1.11.0 Feb 20, 2024
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.

None yet

4 participants