Same data for the same code, why do I get different numbers of DEGs?
0
0
Entering edit mode
6.5 years ago
a511512345 ▴ 190

Same data for the same code, why do I get different numbers of DEGs. Hello everyone, I encountered a problem when using the samr package to find differential expressed genes. The same data for the same code, why do I get a different number of DEGs? For example, I got 108 DEGs in one analysis, but I got 368 DEGs when I repeated the following code. My code is as follows:

x=read.csv("expr.csv",sep = ',',row.names = 1,header = T)
#View(head(x))
Pheno<-read.csv('target.csv',sep = ',',header = T,row.names = 1)
R<-rownames(pheno)
x=x[,R]
y=pheno$group
Data=list(x=as.matrix(x),y=y,geneid=rownames(x),genenames=as.character(rownames(x)),logged2=TRUE)
Samr.obj<-samr(data,resp.type="Two class unpaired", nperms=1000)
Delta.table <- samr.compute.delta.table(samr.obj, min.foldchange=1.2,nvals=100)
Siggenes.table <- samr.compute.siggenes.table(samr.obj, del=0, data, delta.table,all.genes=TRUE)
a <- siggenes.table$genes.up; # all up regulated genes
b <- siggenes.table$genes.lo; ​​# all down regulated genes
c <- rbind(a,b)
#View(head(c))
Lo <- c[as.numeric(c[,8])<20,]#FDR<20%
For (i in 1:nrow(lo))
{
 Tp <- as.numeric(as.vector(as.matrix(lo[i,1])))-1;
 Lo[i,3] <- as.character(as.vector(as.matrix(x[tp,1])));
}
Write.csv(lo,"DEGs.csv")
samr,DEG • 1.8k views
ADD COMMENT
1
Entering edit mode

set a seed and try

ADD REPLY
0
Entering edit mode

thanks for your answer,i will try

ADD REPLY
1
Entering edit mode

You are probably experiencing non-deterministic outputs. I am kind of surprised with the wide variation though. As suggested by @cpad0112 you can try setting a seed.

ADD REPLY
0
Entering edit mode

thanks for reply! So,can i run untill i get ideal numbers of DEGs?

ADD REPLY
1
Entering edit mode

There is no ideal number of DEG's. Since you need to validate the hypotheses you are generating (list of DE genes) by independent means, you probably don't want hundreds anyway.

BTW: Please use ADD REPLY/ADD COMMENT when responding to existing posts to keep the thread logically organized.

ADD REPLY
0
Entering edit mode

I appreciate your help very much, thanks a lot!

ADD REPLY

Login before adding your answer.

Traffic: 1870 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