[adegenet-forum] DAPC a priori grouping and find.clusters
Rita Castilho
rita.castil at gmail.com
Sat Dec 21 19:07:44 CET 2013
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>>>>>>>>>>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20131221/914f465d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Forum.png
Type: image/png
Size: 31783 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20131221/914f465d/attachment-0001.png>
More information about the adegenet-forum
mailing list