[adegenet-forum] DAPC scatter plot patterns

Jombart, Thibaut t.jombart at imperial.ac.uk
Fri Jul 8 10:24:26 CEST 2011


Dear Nikki,

I admit I have not yet considered adding an argument "smile=TRUE" to the scatter.dapc!

Your question illustrates an important point though: the orientation of the axes. In all single-table multivariate analyses (PCA, MDS, DAPC, ...), the orientation of the axes is perfectly arbitrary. It has no meaning, and will change from one computer to another even if exactly the same data are used.

Therefore, you can always multiply the discriminant function of your choice, and the corresponding loadings, by -1.
For instance:
####
library(adegenet)
data(dapcIllus)
dapc1 <- dapc(dapcIllus$c, n.pca=10,n.da=2)
scatter(dapc1) # 'arches' one way

## change direction of 2nd axis:
dapc1$ind.coord[,2] <- -dapc1$ind.coord[,2]
dapc1$loadings[,2] <- -dapc1$loadings[,2]
scatter(dapc1) # arches the other way
####

Cheers

Thibaut

________________________________
From: adegenet-forum-bounces at r-forge.wu-wien.ac.at [adegenet-forum-bounces at r-forge.wu-wien.ac.at] on behalf of Nikki Vollmer [nlv209 at hotmail.com]
Sent: 07 July 2011 18:34
To: adegenet-forum at r-forge.wu-wien.ac.at
Subject: [adegenet-forum] DAPC scatter plot patterns

Hi,

I have been using adegenet to run DAPC analyses and then plot out the results using the scatter function.  For the same dataset and parameters, when running and re-running the DAPC/scatter I get 6-7 clusters that plot out over the DAPC space in an arch pattern, however sometimes they plot in the shape of a arch like a smile, and other times in the exact same pattern except in an arch like a frown.  For publication purposes I would like all scatter plots to be arranged in the same way (I am comparing 3 different datasets) but I don't see a code in the scatter function to change how the clusters are plotted (ie. in the smile vs. frown pattern) after the fact.  I don't want to change what PCs are being plotted, just how the clusters are arranged around the axes.  Is there some code to fix this?  What I have been doing is just re-running the DAPC from the beginning and then using the scatter function over and over until I get the arch pattern that I want.  This is kinda a pain.

If I am not being clear what my issue is I can try to provide more information.  Thanks for any help offered, I appreciate it!

Nikki


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20110708/97baf35d/attachment.htm>


More information about the adegenet-forum mailing list