plotMDS axis labels for limma/EdgeR: PCA or PCoA
1
0
Entering edit mode
@andrewlonsdale-13890
Last seen 8.2 years ago

Hi,

I have a question about the MDS plot provided by limma, via the plotMDS() function, and the axis labels. I am a little confused by the axis labels on the output from plotMDS compared to A: edgeR MDS, as I've been consistently getting "Principal Component" axis which suggests PCA (as in principal component analysis) rather than a variant of principal coordinate analysis (PCoA).

Briefly, I'm unsure if I'm misinterpreting what is being plotted, or if there is a subtle bug with the axis labels.

If it is the later, I think this is due to the chain of method handlers. The handlers for plotMDS are (from the source code): default, MDS.For default, if the selection method is pairwise then the axis label is "Leading logFC dim". However for other methods (.e.g common), it is set to:

axislabel <- "Principal Component"

which could lead to confusion as to what is being plotted. The default method creates an MDS object and can either return it, or further call plotMDS on it, which will trigger the MDS handler of plotMDS. This handler seems to set the correct axis label

if(is.null(x$axislabel)) x$axislabel <- "Principal Coordinate"

but only if it is not yet set. Since the default handler has already set the axis label, this will not be modified in the typical workflow and so goes unmodified.

An alternate entry point to this is via EdgeR for DGE objects, via a plotMDS.DGElist handler. From the source code a redirect back to plotMDS.default after a logCPM conversion is called, which goes back to the plotMDS.default handler and the axis label issues above will occur again.

If it is correct that plotMDS plots shouldn't be labelled as Principal Components, then the only workaround I could see is to initially set plot to FALSE, then force an overwrite of the axis label. For example with a DGE object:

mds_object <- plotMDS.DGEList(dge,gene.selection = "common",plot=FALSE)
mds_object$axislabel <- "Principal Coordinate"
plotMDS(mds_object)

Are there any situations where plotMDS.default should use the labels "Principal Component" over 'Principal Coordinate', or is this just a label error.

Thanks

Andrew Lonsdale

limma edgeR • 3.7k views
ADD COMMENT
2
Entering edit mode
@gordon-smyth
Last seen 14 hours ago
WEHI, Melbourne, Australia

The axis labels returned by plotMDS() are correct. Note that PCoA is more general than PCA and includes PCA as a special case.

There are three scenarios:

1. plotMDS is called on an expression object with gene.selection="pairwise".

In this case distances on the plot are leading log-fold-changes and are labelled as such.

2. plotMDS is called on an expression object with gene.selection="common".

In this case, the principle coordinates are the same as principal components, so either label would be correct. In this case, we label the axes as "Principal Component" because that is the more specific of the two possibilities and hence the more informative.

The axis labels thereby allow people to infer how the gene selection was done, which is useful information.

3. plotMDS is called on an MDS object.

MDS objects are almost always created by the default plotMDS() function, in which case the axis labels are preset as part of the object. If they're not preset, however, then they default to "Principal Coordinate". The general label is used here because plotMDS() can't tell how the distances were computed.

 

Anyway, even if you didn't like the default axis labels, you can easily supply your own via the xlab and ylab arguments, as can been seen from the documentation pages. There's no need for a "workaround". The moral here is: read the documentation, not the code!

ADD COMMENT
0
Entering edit mode

Thanks Gordon! That really helps my understanding. 

ADD REPLY
0
Entering edit mode

Actually I forgot part of my own reasoning and have had to edit my answer above. I forgot that numeric matrices are assumed to be expression objects by plotMDS(), so a numeric matrix with gene.selection="pairwise" will lead to a "Leading logFC" axis label.

ADD REPLY

Login before adding your answer.

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