different number of DEGS between edger, deseq2, limma voom
Is it possible to find with DESEQ2 750 differentially expressed genes between 2 conditions (total number of samples 10), and only 40 DEGS with EDGER and LIMMA VOOM? FDR the same 0.05. Thank you!
• 755 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Would you mind to post the exact command lines from filtering low count genes to the differential gene expression analysis?
Thanks!
DESEQ2:
keep <- rowSums(counts(dds)) >= 10 dds <- dds[keep,]EDGER:keep <- rowSums ( cpm ( edgeR.DGElist ) >= 1) >= 5 edgeR.DGElist <- edgeR.DGElist [ keep ,]LIMMA VOOM:keep.exprs <- filterByExpr(dge, group=group) dge <- dge[keep.exprs,, keep.lib.sizes=FALSE]Thank you!That is only the filtering, please show all code and background on what the data are plus preprocessing.
I will try to correct my code again, and I will post it afterwards.
Your filtering criteria are already vastly different
Not only is it possible, it should be expected.
Ok thank you. So I should have the same filtering strategy for all the methods? The fact that DESEQ2 does independent filtering does not affect the filtering strategy?
If you want to try the exact same pre-filtering for all the methods, I think the
DESeq2independent filtering can be turned off with theindependentFilteringargument in theresultsfunction (I have never used it). However, I would stress that all of these methods apply different statistical approaches and assumptions about the data in order to discover what they consider to be changes between the expression of genes. So do not expect to always obtain the same results, especially for borderline cases (genes with low changes or high variance or overall low counts). And that does not imply that any one of the methods is right or wrong. Although it is possible that sometimes you could make an statistically-informed decision on whether one or another suits your data better (and one should try to gather the knowledge to be able to make these kinds of decisions), in my opinion the safest path to go is to always treat the results of any of these methods (or any statistical method) as a description of your data from a certain point of view, not as the uncovering of truth.But I am not sure if I should trust DESEQ2 that gives results and GO terms or EDGER that gives nothing..Thank you again for your time!
Apart from the mentioned issues, when looking at the agreement between different tools, instead of checking only the significant FDR genes, sort your tables by p-value and check, say, the 1-10% top results (100-1000 genes), and look at how many you get in common among the tools (intersections). That will most probably give you a general sense of the concordance among the results.
Ok, so I have tried what you suggested. There are no matches in the first 1000 genes sorted by pvalue or fdr.however, all the genes produced by edger exist also in deseq2 table. I have observed that deseq2 produced much more DEGS than edgeR.
I would say that not having any overlap is unusual, especially when DESeq2 gives you 750 genes. Are you using any other cutoff (such as fold change?). I would suggest directly looking at the top results (using boxplots, etc.) to see if the results you are getting really show changes. And re-check you are inputting the same matrices of counts to both methods, and specifying the same comparison. That all the genes produced in edgeR also exist in the DESeq2 table should be expected because the matrices of genes which you input to both should be the same.
Thank you for your help! I am posting the scripts used, as well. DESEQ2
ff<-list.files(path="/readspergene/", pattern = "*ReadsPerGene.out.tab$", full.names = TRUE ) counts.files <-lapply(ff, read.table, skip=4) counts <- as.data.frame( sapply( counts.files, function(x) x[ , 3 ] ) ) samples<-c("1","2","3","4","5","6","7","8","9","10","11","12") colnames(counts) <- samples library(DESeq2) group<-factor(x=c("A","A","A","B","B","B","B","A","A","B","A", "B"), levels=c("A","B")) colData<-as.data.frame(group) rownames(colData)<-samples countData<-counts colnames(countData)<-samples rownames(countData)<-counts.files[[1]][["V1"]] countData<-as.matrix(countData) dds <- DESeqDataSetFromMatrix(countData=countData, colData=colData, design=~group) keep <- rowSums(counts(dds)) >= 10 dds <- dds[keep,] plotMA(res, ylim=c(-2,2)) resLFC <- lfcShrink(dds, coef="group_B_vs_A", type="apeglm") plotMA(resLFC, ylim=c(-2,2)) dds <- DESeq(dds) res2 <- results( dds, contrast = c("group", "A", "B") ) summary(res2) res2Sig<- subset(res2, padj < 0.05) res2Sig_fold<-subset(res2Sig, abs(log2FoldChange)>1LIMMAVOOMff<-list.files(path=="/readspergene/", pattern = "*ReadsPerGene.out.tab", full.names = TRUE ) files<-as.character(list.files(path="/readspergene/")) dge<-readDGE(files, path="/readspergene/", columns=c(1,3), skip=4) colnames(dge)<-c("1","2","3","4","5","6","7","8","9","10","11","12") group<-as.factor(c("A","A","A","B","B","B","B","A","A","B","A", "B")) geneid<-rownames(dge$counts) library(AnnotationDbi) library(org.Hs.eg.db) library(Homo.sapiens) genes<-select(Homo.sapiens,keys=geneid, keytype="ENSEMBL",columns=c("SYMBOL","GENENAME")) genes <- genes[!duplicated(genes$GENENAME),] dge$genes<-genes cpm <- cpm(dge) lcpm <- cpm(dge, log=TRUE) summary(lcpm) group<-as.factor(group) group <- relevel(group, "B") design<-model.matrix(~group) keep.exprs <- filterByExpr(dge,design ) rownames(design)<-colnames(dge) colnames(design)<-gsub("group","",colnames(design)) dge <- dge[keep.exprs,, keep.lib.sizes=FALSE] dge <- calcNormFactors(dge, method = "TMM") plotMDS(lcpm, col= as.numeric(group)) v<-voom(dge, design, plot=TRUE) vfit <- lmFit(v, design) efit <- eBayes(vfit, robust=TRUE) plotSA(efit, main="Final model: Mean-variance trend") summary(decideTests(efit)) DGE.results_limma <- topTable (efit, number = Inf , adjust.method = "BH", sort.by = "P")EDGERff<-list.files(path="/home/readspergene/", pattern = "*ReadsPerGene.out.tab", full.names = TRUE ) counts.files <-lapply(ff, read.table, skip=4) counts <- as.data.frame( sapply( counts.files, function(x) x[ , 3 ] ) ) samples<-c("1","2","3","4","5","6","7","8","9","10","11","12") colnames(counts) <- samples group<-factor(x=c("A","A","A","B","B","B","B","A","A","B","A","B"), levels=c("A","B")) colData<-as.data.frame(group) rownames(colData)<-samples countData<-counts colnames(countData)<-samples rownames(countData)<-counts.files[[1]][["V1"]] countData<-as.matrix(countData) edgeR.DGElist <- DGEList (counts = countData , group = group) design <- model.matrix(~group) keep <- filterByExpr(edgeR.DGElist, design) edgeR.DGElist <- edgeR.DGElist [ keep ,,keep.lib.sizes=FALSE] edgeR.DGElist <- calcNormFactors ( edgeR.DGElist , method = "TMM" ) plotMDS(edgeR.DGElist) edgeR.DGElist <- estimateDisp ( edgeR.DGElist,design ) edger_fit <- glmFit ( edgeR.DGElist , design ) edger_lrt <- glmLRT (edger_fit) DGE.results_edgeR <- topTags ( edger_lrt , n = Inf, sort.by = "PValue" , adjust.method = "BH") DGE.results_edgeR<-as.data.frame(DGE.results_edgeR) signgenes<-subset(DGE.results_edgeR,FDR<0.05)Hello eridanus!
We believe that this post does not fit the main topic of this site.
Please comment if still of interest. If so, please add relevant code to toplevel question.
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!