Question: Same data for the same code, why do I get different numbers of DEGs?
0
gravatar for a511512345
8 months ago by
a51151234570
China guangxi nanning
a51151234570 wrote:

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 • 339 views
ADD COMMENTlink modified 8 months ago • written 8 months ago by a51151234570
1

set a seed and try

ADD REPLYlink written 8 months ago by cpad011211k

thanks for your answer,i will try

ADD REPLYlink written 8 months ago by a51151234570
1

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 REPLYlink written 8 months ago by genomax62k

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

ADD REPLYlink written 8 months ago by a51151234570
1

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 REPLYlink modified 8 months ago • written 8 months ago by genomax62k

I appreciate your help very much, thanks a lot!

ADD REPLYlink written 8 months ago by a51151234570
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2224 users visited in the last hour