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 8 commits into
base: main
Choose a base branch
from
Open

Added intercept to regress_out() #2731

wants to merge 8 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

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.44%. Comparing base (a28fe88) to head (5063fe9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/scanpy/preprocessing/_simple.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2731      +/-   ##
==========================================
- Coverage   75.44%   75.44%   -0.01%     
==========================================
  Files         113      113              
  Lines       13250    13254       +4     
==========================================
+ Hits         9997     9999       +2     
- Misses       3253     3255       +2     
Files with missing lines Coverage Δ
src/scanpy/preprocessing/_simple.py 89.75% <50.00%> (-0.41%) ⬇️

@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
@flying-sheep flying-sheep modified the milestones: 1.11.0, 1.12.0 Dec 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.

4 participants