<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body wsmode="reply" style="color: rgb(0, 0, 0);
background-color: rgb(255, 255, 255); font-family: Arial; font-size:
14pt;" bgcolor="#FFFFFF" text="#000000"><div style="font-size:
14pt;font-family: Arial;"><span style="font-family: Arial;">Hi!<br>
Here are the the scatter commands too. If I ask for ellipses, I get 5
(species) ellipses. But then, what is the meaning of the two colors
(light blue and red)? And for two groups, what is the graphic solution?<br>Thanks<br>Rita<br><br><br>
</span><br>
<small>#DAPC Analysis#<br>
#perform temporary DAPC<br>
dapc <- dapc(infile, pop=NULL, n.pca=NULL, n.da=NULL)<br>
###evaluate number of PCAs to retain<br>
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)))<br>
##perform DAPC based on species<br>
dapc.species <- dapc(infile, pop=NULL, n.pca=a$best, n.da=NULL,
scale=FALSE, truenames=FALSE, all.contrib=TRUE)<br>
scatter(dapc.species, xax=1,
yax=2,col=rainbow(length(levels(dapc.species$grp))), clabel=0.8,
bg="white", csub=0.5, pch=19, solid=1) </small><big><br>
</big><span><small><<<<<<<<<<<<GRAPH
ON THE LEFT>>>>>>>>>>>>>> <br>
</small><br>
<small>#FIND CLUSTERS<br>
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, n.iter=1e5,
n.start=100)<br>
#data.clust<- find.clusters(data.gp, n.pca=a$best, choose=TRUE,
stat="BIC",
choose.n.clust=TRUE,criterion=c("diffNgroup"),max.n.clust=10)<br>
dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best)<br>
scatter(dapc.clusters, xax=1,
yax=2,col=rainbow(length(levels(clusters$grp))), clabel=0, bg="white",
csub=0.5, pch=19, solid=1,cstar=0) <br>
</small></span><small><span><<<<<<<<<<<<GRAPH
ON THE RIGHT>>>>>>>>>>>>>> </span></small><br>
<blockquote style="border: 0px none;"
cite="mid:2CB2DA8E426F3541AB1907F98ABA657075F367F9@icexch-m1.ic.ac.uk"
type="cite"><div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="t.jombart@imperial.ac.uk" photoname="Jombart, Thibaut"
src="cid:part1.03060503.05020805@gmail.com"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:t.jombart@imperial.ac.uk"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Jombart, Thibaut</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">December 23, 2013
3:10 AM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody"><div>Hello, <br><br>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. <br><br>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. <br><br>Cheers<br>Thibaut<br>________________________________________<br>From:
<a class="moz-txt-link-abbreviated"
href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>
[<a class="moz-txt-link-abbreviated"
href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>]
on behalf of Rita
Castilho [<a class="moz-txt-link-abbreviated"
href="mailto:rita.castil@gmail.com">rita.castil@gmail.com</a>]<br>Sent:
21 December 2013 18:07<br>To:
<a class="moz-txt-link-abbreviated"
href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>Subject:
[adegenet-forum]
DAPC a priori grouping and find.clusters<br><br>Hi,<br><br>I am trying
to get two DAPCs done:<br>1. a DAPC1 that displays the a priori
established groups (in this case a complex of 5 nominal species) and<br>2.
a DAPC2 that displays the genetic gorups, with no a priori
determination= K clusters<br><br>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.<br><br>Maybe my
scripts are not correct. Does anyone can comment if the code is correct,
or am I making some very basic mistakes?<br><br>Many thanks,<br>Rita<br><br><br><br>The
coding I am using is the following:<br><br>data.gp <-
read.genepop('infile.gen')<br>#perform temporary DAPC<br>dapc <-
dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL)<br>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)))<br>##perform DAPC based on species<br>dapc.species
<- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, scale=FALSE,
truenames=FALSE, all.contrib=TRUE)<br><<<<<<<<<<<<GRAPH
ON THE LEFT>>>>>>>>>>>>>><br><br>#FIND
CLUSTERS##################################<br>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)<br>dapc.clusters<-
dapc(data.gp, grp=clusters$grp, n.pca=a$best)<br><<<<<<<<<<<<GRAPH
ON THE RIGHT>>>>>>>>>>>>>><br><br><br><br></div></div>
<div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div
style="display:table;width:100%;border-top:1px solid
#EDEEF0;padding-top:5px"> <div
style="display:table-cell;vertical-align:middle;padding-right:6px;"><img
photoaddress="rita.castil@gmail.com" photoname="Rita Castilho"
src="cid:part1.03060503.05020805@gmail.com"
name="compose-unknown-contact.jpg" height="25px" width="25px"></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;width:100%">
<a moz-do-not-send="true" href="mailto:rita.castil@gmail.com"
style="color:#737F92
!important;padding-right:6px;font-weight:bold;text-decoration:none
!important;">Rita Castilho</a></div> <div
style="display:table-cell;white-space:nowrap;vertical-align:middle;">
<font color="#9FA2A5"><span style="padding-left:6px">December 21, 2013
6:07 PM</span></font></div></div></div>
<div style="color:#888888;margin-left:24px;margin-right:24px;"
__pbrmquotes="true" class="__pbConvBody">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<div style="font-size: 14pt;font-family: Arial;"><small><small><span
style="font-family: Arial;">Hi,<br><br>I am trying to get two DAPCs
done:<br>1. a DAPC1 that displays the a priori established groups (in
this case a complex of 5 nominal species) and <br></span></small></small><span><small><small><span
style="font-family: Arial;">2. a DAPC2 that displays the genetic
gorups, with no a priori determination= K clusters<br><br>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.<br><br>Maybe my scripts are not correct. Does anyone can
comment if the code is correct, or am I making some very basic mistakes?<br><br>Many
thanks,<br>Rita<br><br><br><br>The coding I am using is the following:<br></span></small></small></span><small><small><span
style="font-family: Arial;"><br>data.gp <-
read.genepop('infile.gen')<br>#perform temporary DAPC<br>dapc <-
dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL)<br>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)))<br>##perform DAPC based on species<br>dapc.species
<- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, scale=FALSE,
truenames=FALSE, all.contrib=TRUE)<br><<<<<<<<<<<<GRAPH
ON THE LEFT>>>>>>>>>>>>>><br><br>#FIND
CLUSTERS##################################<br>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)<br>dapc.clusters<-
dapc(data.gp, grp=clusters$grp, n.pca=a$best)<br><<<<<<<<<<<<GRAPH
ON THE RIGHT>>>>>>>>>>>>>><br><br><br></span></small></small></div>
</div></blockquote>
</div></body></html>