[adegenet-forum] DAPC a priori grouping and find.clusters

Jombart, Thibaut t.jombart at imperial.ac.uk
Mon Dec 23 04:10:23 CET 2013


Hello, 

the discrimination of groups is always better on axes of lower rank, and by default the lower ranks are always represented on the x-axis. So in this case, the better differentiation is actually on your x-axis for graph #1. 

Graph #2 puzzles me a little. There is always at maximum K-1 discriminant axes, so when K=2 there is only one axis to be plotted. I'm not sure how you got two axes there... Plus the ellipses are missing, suggesting this is not the basic graph. 

Cheers
Thibaut
________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Rita Castilho [rita.castil at gmail.com]
Sent: 21 December 2013 18:07
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] DAPC a priori grouping and find.clusters

Hi,

I am trying to get two DAPCs done:
1. a DAPC1 that displays the a priori established groups (in this case a complex of 5 nominal species) and
2. a DAPC2 that displays the genetic gorups, with no a priori determination= K clusters

I have produced two scatter plots for these two DAPCs which are attached. The first graph (DAPC1) seems to have a y-axis clear division, and I was expecting that DAPC2 would display that. But DAPC2 shows a horizontal grouping.

Maybe my scripts are not correct. Does anyone can comment if the code is correct, or am I making some very basic mistakes?

Many thanks,
Rita



The coding I am using is the following:

data.gp <- read.genepop('infile.gen')
#perform temporary DAPC
dapc <- dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL)
a=optim.a.score(dapc, n.pca = 1:ncol(dapc$tab), smart=TRUE, n=10, plot=TRUE, n.sim=100, n.da=length(levels(dapc$grp)))
##perform DAPC based on species
dapc.species <- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, scale=FALSE, truenames=FALSE, all.contrib=TRUE)
<<<<<<<<<<<<GRAPH ON THE LEFT>>>>>>>>>>>>>>

#FIND CLUSTERS##################################
clusters <-  find.clusters(data.gp, choose.n.clust=TRUE,criterion=c("diffNgroup"), n.pca=a$best,n.clust=NULL, stat='BIC', max.n.clust=10)
dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best)
<<<<<<<<<<<<GRAPH ON THE RIGHT>>>>>>>>>>>>>>




More information about the adegenet-forum mailing list