Skip to content

Instantly share code, notes, and snippets.

@mikelove
Created August 28, 2015 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikelove/3fb993003ce5389849b7 to your computer and use it in GitHub Desktop.
Save mikelove/3fb993003ce5389849b7 to your computer and use it in GitHub Desktop.
fast VST
library(DESeq2)
# simulate data
dds <- makeExampleDESeqDataSet(n=80000,m=100)
# this takes 10 seconds on my machine
dds <- estimateSizeFactors(dds)
baseMean <- rowMeans(counts(dds, normalized=TRUE))
sum(baseMean > 1)
idx <- sample(which(baseMean > 5), 1000)
dds.sub <- dds[idx, ]
dds.sub <- estimateDispersions(dds.sub)
dispersionFunction(dds) <- dispersionFunction(dds.sub)
vsd <- varianceStabilizingTransformation(dds, blind=FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment