This is a test version of Biostars. For the public version, visit https://www.biostars.org.
edgeR error

finding error to run edgeR , please check my code to be helpful for finding error and solving it. difficulty in finding the next steps of the code because of the occurring errors.

library(edgeR)
counts <- read.delim("GSE116959_series_matrix.txt", row.names = 1)
head(counts)
data <- read.table("annotation.txt",header=TRUE , sep = "\t")
data
head(data)

d0<- DGEList(counts=counts , group = factor(counts))
d0
dim(d0)
d0.full <- d0 #keep the old one in case we mess up
# filtering
countsPerMillion <- cpm(d0)
summary(countsPerMillion)
#'summary' is a useful function for exploring numeric data; eg. summary(1:100)
countCheck <- countsPerMillion > 1
head(countCheck)
keep <- which(rowSums(countCheck) >= 2)
d0 <- d0[keep,]
summary(cpm(d0)) #compare this to the original summary

# normalization 
?calcNormFactors
d0 <- calcNormFactors(d0, method="TMM")

#Data Exploration
plotMDS(d0)

#setting up the model
sampleType<- rep("N", ncol(d0)) #N=normal; T=tumour
sampleType[grep("T", colnames(d0))] <- "T"
#'grep' is a string matching function.
sampleReplicate <- paste("S", rep(1:6, each=2), sep="")
designMat <- model.matrix(~sampleReplicate + sampleType)
designMat


d1 <- estimateCommonDisp(d0,verbose = T)
names(d1)
plotBCV(d1)
design.mat<- model.matrix(~ 0 + d0$samples$group)
colnames(design.mat)<- levels(d0$samples$group)
d2<- estimateGLMCommonDisp(d0, design.mat)
d2<- estimateGLMTrendedDisp(d2, design.mat, method = "power")

d2<- estimateGLMTagwiseDisp(d2,design.mat)
plotBCV(d2)

et12 <- exactTest(d1, pair = c(1,2))
edger r deg

1 answer

Log in to answer this question.