Question: Deseq's plotMA color-coding at random?
1
gravatar for Tyr Wiesner-Hanks
4.8 years ago by
United States
Tyr Wiesner-Hanks40 wrote:

EDIT: Just had to order the data frame by adjusted p-value before plotting! I'm leaving this up in case someone runs into a similar problem.

 

I'm using DESeq to analyze count data from RNASeq of maize and fungus during pathogenesis. I've done pairwise comparisons between all of the timepoints and their control counterparts to analyze differential expression. However, the MA plots don't look quite right. Genes with significantly differential expression with FDR < 0.10 are color coded red, but the points appear to be color coded at random, rather than on the margins of the point cloud:

These graphs show plenty of counts with a log2 fold change close to 0 and FDR < 0.10, but subsetting the count data frame by these conditions returns 0 rows:

corn3[which(abs(corn3$log2FoldChange) < .5 & corn3$padj < 0.10),]
<0 rows> (or 0-length row.names)

The same happens with every pairwise comparison (four time points, maize counts compared to water inoculation, fungal counts compared to a single axenic sample). I'm trying again in DESeq2, but I'd like to know what's going on, if anyone has any pointers.

 

Below is a sample of code used to generate the binomial test data frames:

meta <- metadata[row.names(metadata) %in% names(counts),]
cds = newCountDataSet(counts, meta$condition)
cds = estimateSizeFactors(cds)
cornmodel = estimateDispersions(cds)
corn3 = nbinomTest(cornmodel, "3day control", "3day")
plotMA(corn3)

 

rna-seq deseq R • 4.6k views
ADD COMMENTlink modified 4.8 years ago • written 4.8 years ago by Tyr Wiesner-Hanks40
2

I wonder if the problem is that the color and dataset are subset differently. What happens if you do:

x=subset(corn3, corn3$baseMean!=0)
col=ifelse(x$padj>=0.1, "gray32", "red3")
plot(x$baseMean, x$log2FoldChange, col=col, log="x", ylim=c(-5,5))
ADD REPLYlink written 4.8 years ago by Devon Ryan89k

It ended up just being something similar- the data had to be ordered by p-value before the color scheme worked out. Thank you for the advice!

ADD REPLYlink written 4.8 years ago by Tyr Wiesner-Hanks40
1

it looks like there's a single line in the plotMA function which puts the col and x,y out of order. I've emailed the maintainer.

subsetting res[res$baseMean > 1,] should be a fix for now.

ADD REPLYlink written 4.8 years ago by Michael Love1.8k

I have the same question that "Genes with significantly differential expression with FDR < 0.10 are color coded red, but the points appear to be color coded at random, rather than on the margins of the point cloud". Anyone has an answer? Thank you

ADD REPLYlink written 4.8 years ago by Ming Tang2.4k

As mentioned above, this is likely due to a bug in how subsetting is performed.

ADD REPLYlink written 4.8 years ago by Devon Ryan89k
3
gravatar for Tyr Wiesner-Hanks
4.8 years ago by
United States
Tyr Wiesner-Hanks40 wrote:

Try subsetting or ordering your results:

plotMA(res[res$baseMean >1 ,])
plotMA(res[order(res$padj),])

Both of these solutions worked for me.

ADD COMMENTlink written 4.8 years ago by Tyr Wiesner-Hanks40

Thank you, it worked for me.

ADD REPLYlink written 4.8 years ago by Ming Tang2.4k
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: 835 users visited in the last hour