Skip to content

Instantly share code, notes, and snippets.

@crazyhottommy
Created November 1, 2013 21:51
Show Gist options
  • Save crazyhottommy/7272522 to your computer and use it in GitHub Desktop.
Save crazyhottommy/7272522 to your computer and use it in GitHub Desktop.
basic work flow of DESeq
setwd("/home/tommy/scripts")
library("DESeq")
countsTable<- read.delim("All_counts_nozero_1pseudocount_with_header.txt", header=TRUE)
rownames(countsTable)<- countsTable$Gene
countsTable<- countsTable[,-1]
head(countsTable)
conds<- factor(c("alpha","beta","alpha","beta","alpha","beta"))
cds<- newCountDataSet(countsTable, conds)
cds<- estimateSizeFactors(cds)
sizeFactors(cds)
head(counts(cds))
head(counts(cds,normalized=TRUE))
cds<- estimateDispersions(cds)
plotDispEsts(cds)
res = nbinomTest( cds, 'alpha', 'beta' )
head(res)
plotMA(res)
hist(res$pval, breaks=100, col='skyblue', border='slateblue', main='')
resSig = res[ res$pval < 0.1, ]
head(resSig)
cdsBlind<- estimateDispersions(cds, method= "blind")
vsd<- varianceStabilizingTransformation(cdsBlind)
plotPCA(vsd, intgroup=c("condition"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment