scverse / scverse/PyDESeq2

[BUG] Overflows in irls_solver and shape mismatch in _refit_without_outliers when using continuous variable

Open
#201 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
761
Forks
90
Avg merge
25m
Merged PRs (30d)
10

Description

When using a continuous variable I get
ValueError: shape mismatch: value array of shape (228,77) could not be broadcast to indexing result of shape (228,7)
while running self.varm["LFC"][to_replace] = sub_dds.varm["LFC"] in _refit_without_outliers.

I also get overflow warnings from irls_solver.

  • Setting 1
    design_factors=['Batch','Condition']
    continuous_factors=None

Works fine

  • Setting 2
    design_factors=['Batch', 'Age', 'Condition']
    continuous_factors=None

Works fine (Refitting 29547 outliers, compared to 1567 in the previous setting, does this make sense?)

  • Setting 3
    design_factors=['Batch', 'Age', 'Condition']
    continuous_factors=['Age']

Overflows in irls_solver (similar to Issue #169). To be precise, I do not get these in previous settings.

ValueError: shape mismatch: value array of shape (228,77) could not be broadcast to indexing result of shape (228,7)
(while running self.varm["LFC"][to_replace] = sub_dds.varm["LFC"] in _refit_without_outliers)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the three design_factors and continuous_factors settings in the report, then inspect _refit_without_outliers where self.varm["LFC"] is assigned and irls_solver where the overflow warnings occur. Done means the continuous-variable case no longer raises the reported shape-mismatch error and the associated overflows are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.