Skip to content

Added intercept to regress_out()#2731

Open
ggit12 wants to merge 9 commits into
scverse:mainfrom
ggit12:master
Open

Added intercept to regress_out()#2731
ggit12 wants to merge 9 commits into
scverse:mainfrom
ggit12:master

Conversation

@ggit12

@ggit12 ggit12 commented Nov 6, 2023

Copy link
Copy Markdown

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

ggit12 commented Nov 6, 2023

Copy link
Copy Markdown
Author

@LuckyMD

@codecov

codecov Bot commented Nov 6, 2023

Copy link
Copy Markdown

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
Copy Markdown
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

ggit12 commented Nov 7, 2023

Copy link
Copy Markdown
Author

Hi,

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

Is this enough to get started?

@danielee0707

danielee0707 commented Nov 8, 2023

Copy link
Copy Markdown

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

flying-sheep commented Nov 9, 2023

Copy link
Copy Markdown
Member

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
@flying-sheep flying-sheep modified the milestones: 1.12.0, 1.13.0 Jan 23, 2026
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