Skip to content

Instantly share code, notes, and snippets.

@GabrielHoffman
Created August 25, 2020 18:20
Show Gist options
  • Save GabrielHoffman/8f8638f038ab3d48ffe42d954fa3c5d9 to your computer and use it in GitHub Desktop.
Save GabrielHoffman/8f8638f038ab3d48ffe42d954fa3c5d9 to your computer and use it in GitHub Desktop.
library(edgeR)
library(variancePartition)
dge = DGEList( counts = NEW.COUNTS )
dge = calcNormFactors(dge)
# standard design
form = ~ Dx + scale(RIN) + ageOfDeath + Reported_Gender + scale(IntronicRate) + scale(IntragenicRate) + scale(IntergenicRate)
design = model.matrix(form, COVARIATES)
# standard voom and lmFit
vobj = voomWithDreamWeights(dge, form, COVARIATES)
fit = dream(vobj, form, info, computeResiduals=TRUE)
# fit = eBayes(fit) # if only fixed effects
residExpression = residuals(fit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment