Skip to content

Add pseudo_count to log2_FC so zero mean genes don't break fold changes#9

Open
mertcan-demir wants to merge 1 commit into
SimoneTiberi:masterfrom
mertcan-demir:master
Open

Add pseudo_count to log2_FC so zero mean genes don't break fold changes#9
mertcan-demir wants to merge 1 commit into
SimoneTiberi:masterfrom
mertcan-demir:master

Conversation

@mertcan-demir

@mertcan-demir mertcan-demir commented May 12, 2026

Copy link
Copy Markdown

Hi! First time contributing, so please let me know if I missed anything. I noticed log2_FC() throws Inf when one group has zero mean expression. So I added a pseudo_count parameter as a quick fix. The default is 0 so nothing changes. Not sure if this is the best way to handle it (maybe preprocessing the assay is cleaner like proportional constants as edgeR do with prior.count?), but it solved the issue on my end without touching the mean_* columns. Happy to adjust if you prefer a different approach! Changes are only in R/log2_FC.R one new param + validation + a one-liner in the FC calculation.

@SimoneTiberi

Copy link
Copy Markdown
Owner

Hi Mert, thanks a lot for spotting this issue and informing us!
I appreciate your contribution: I'll look at it in June and implement a solution (yours or something similar) both in our Github and Bioconductor repositories.

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.

2 participants