Differential gene expression analysis with no replicates using edgeR
0
0
Entering edit mode
2.0 years ago
Apex92 ▴ 300

Dear all,

I have an experimental design where I have only one sample in each condition (2 conditions in total) and want to do differential gene expression analysis using edgeR.

This is the script I want to use for the analysis and it runs without any errors - with this post I just want to check if I am not missing anything specific in the script of edgeR.

Thanks.

##################################
##### edger for 1 vs 1 comparison #####
##################################

library(edgeR)

countData <- read.csv(file="countmatrix.csv", header=TRUE, sep=",")
head(countData)

#select specific samples
countData = subset(countData, select = c(Geneid,ctrl,kd))
head(countData)

#keep tows if their total is above a certain value
thresh <- 50
countData <- countData[rowSums(countData[,-1]) > thresh,]

#############################################
######### Creating a DGEList object #########
########################################
dgList <- DGEList(counts=countData[,-1], genes=countData[,1])

dgList

#################################
######## Normalisation ##########
#################################
dgList <- calcNormFactors(dgList, method="TMM")

########################################
########### Setting up the Model ############
########################################
group <- factor(c("ctrl","kd"))
designMat <- model.matrix(~group)
designMat

designMat.reduced <- matrix(1,2,1) 
designMat.reduced

#############################################
########### Estimating Dispersion ###########
#############################################
dgList <- estimateGLMCommonDisp(dgList, design=designMat.reduced,
                                method="deviance", robust = TRUE, subset=NULL)


####################################
########## Differential Expression ##########
####################################
fit <- glmFit(dgList, designMat)
lrt <- glmLRT(fit)

edgeR_result <- topTags(lrt, n=Inf)

write.table(edgeR_result, file="DEGs.csv", sep=",",row.names = FALSE)
edgeR RNA-seq DEG • 3.2k views
ADD COMMENT
0
Entering edit mode

The edgeR manual has a section on doing exploratory analysis without replicates, please read it.

ADD REPLY
0
Entering edit mode

Thank you for your comment - I have already looked at the manual and chose the third option from section 2.12 which is also in the code above. But I just pasted the whole code to see if it is concrete and if I am not missing anything. This is my first time working with edgeR and that is why I am a bit cautious.

ADD REPLY
0
Entering edit mode

As a general rule you should try and understand what each line of code does, by looking in the manual and googling, rather than pasting the whole code in without understanding it. It can be hard at first but it will help you a lot in the long run.

ADD REPLY
0
Entering edit mode

If you follow the manual precisely you're fine.

ADD REPLY
0
Entering edit mode

I just want to verify my code, without replication using edgeR. Please check it and give your suggestions. it may help me to go forward.

Thanks in advance

library(edgeR)

rawpattihypo <- read.table("rawpattihypo", header = TRUE, row.names = 1)
condition <- factor(c("Bro","Lay"))

d <- DGEList(counts = rawpattihypo, group=condition)
d1 <- calcNormFactors(d)

bcv <- 0.2
et <- exactTest(d1, dispersion = bcv^2)

top <- topTags(et)
summary(de <- decideTestsDGE(et))
detags <- rownames(d1)[as.logical(de)]

plotSmear(et, de.tags=detags)
abline(h=c(-1, 1), col="blue")
write.csv(et,"demo_edger.csv")
ADD REPLY
0
Entering edit mode

Are you guys in the same course or is this a duplicate account? Read the manual, code is there.

ADD REPLY
0
Entering edit mode

Sorry, sir. I am not using a duplicate account. I have just seen a similar question here and thought of asking my question here. Because it may help me to get answers to my question very fast. even though some code is given in the manual, I just want to verify my code. with this code, I am not facing any errors. so after doing all the work if the code is wrong in the final, everything will go waste that's why I am asking. Thanks for your time sir Sincerely KAMALAKKANNAN R Phd scholar CUKerala, India

ADD REPLY
0
Entering edit mode

If you are sharing code for others to review, please create a minimal example. That means removing any code which doesn't affect the actual output like the head(d1), d1$samples, it's all just noise and makes it harder for anyone to follow.

ADD REPLY
0
Entering edit mode

Yes, sorry sir I have removed it.. please tell me whether it is ok or not?

ADD REPLY
0
Entering edit mode

Hi Apex92 user, I also have only 2 samples with no replicates, can you share the latest script that you applied for samples with no replicates? I need it. thank you

ADD REPLY
0
Entering edit mode

Guys, learn to read manuals. The edgeR user guide literally has a section "what to do without replicates".

Find it at https://www.bioconductor.org/packages/release/bioc/vignettes/edgeR/inst/doc/edgeRUsersGuide.pdf

ADD REPLY
0
Entering edit mode

thank you for your answer, before, I checked the "2.12 What to do if you have no replicates" section. this script applied estimateGLMCommonDisp method as well but didn't use exactTest(y, dispersion=bcv^2). I just want to know why Apex92 didn't use exactTest. without using exactTest I got logical results but when I applied the exactTest method I got confusing results. what do you think?

ADD REPLY

Login before adding your answer.

Traffic: 1771 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6