Differential gene expression analysis with no replicates using edgeR
0
0
Entering edit mode
8 weeks ago
Apex92 ▴ 240

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)

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

#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 • 668 views
0
Entering edit mode

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

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.

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.

0
Entering edit mode

If you follow the manual precisely you're fine.

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.

library(edgeR)

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")

0
Entering edit mode

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

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

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.

0
Entering edit mode

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