Created
January 22, 2025 09:38
-
-
Save ATpoint/2b3859ab74a417a95ad6559ddf5aedad to your computer and use it in GitHub Desktop.
Convert TMM-based normalization factor and library size from edgeR to DESeq2-compatible 1-centered size factors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Say we have a SingleCellExperiment "se" | |
nf <- se$norm.factors | |
ls <- se$lib.size | |
# effective library size | |
els <- ls * nf | |
# size factors centered around 1 | |
geomeans <- exp(mean(log(els))) | |
sf <- els / geomeans |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment