Added intercept to regress_out()#2731
Conversation
implemented the "add_intercept" argument to regress_out()
Finished including add_intercept into regress_out
fixed regression model
fixed indexing
Codecov ReportAttention: Patch coverage is
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
|
for more information, see https://pre-commit.ci
|
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. |
|
Hi, I believe @LuckyMD detailed one use case here theislab/single-cell-tutorial#35. Is this enough to get started? |
|
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. |
For sure, thank you for the context! Is it possible to add a unit test that checks that with this set to |
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().