Skip to content

Commit

Permalink
fix: support coeff=None for continuous factors in lfc_shrink()
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisMuzellec committed Aug 1, 2023
1 parent a0ff4a4 commit 61838d1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pydeseq2/ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,14 @@ def lfc_shrink(self, coeff: Optional[str] = None) -> None:
(default: ``None``).
"""

contrast_level = f"{self.contrast[0]}_{self.contrast[1]}_vs_{self.contrast[2]}"
if self.contrast[1] == self.contrast[2] == "":
# The factor being tested is continuous
contrast_level = self.contrast[0]
else:
# The factor being tested is categorical
contrast_level = (
f"{self.contrast[0]}_{self.contrast[1]}_vs_{self.contrast[2]}"
)

if coeff is not None:
if coeff not in self.LFC.columns:
Expand Down

0 comments on commit 61838d1

Please sign in to comment.