Deseq's plotMA color-coding at random?
1
1
Entering edit mode
7.5 years ago

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)
R DESeq RNA-Seq • 6.1k views
ADD COMMENT
2
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode
7.4 years ago

Try subsetting or ordering your results:

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

Both of these solutions worked for me.

ADD COMMENT
0
Entering edit mode

Thank you, it worked for me.

ADD REPLY

Login before adding your answer.

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