<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#339999">
Dear adegenet users, <br>
<br>
I have a problem when plotting supplementary individuals on DAPC
scatterplot. <br>
<br>
I defined two datasets: 1 to perform DAPC and another of
supplementary individuals<br>
<br>
<font color="#3366ff">x.sup_80<-Ge_atp_gcp_80[c(1:nrow(Ge_atp@tab)),]
# supplementary individuals<br>
<br>
x_80<-Ge_atp_gcp_80[-c(1:nrow(Ge_atp@tab)),] # Individuals on
which performing DAPC</font><br>
<br>
Then I performed DAPC on X_80, specifying a-priori groups<br>
<br>
<font color="#3366ff">dapc_GCP_14ssr_STRk5_b<- dapc(x_80,
pop(x_80), n.pca=30,n.da=4) #perform DAPC</font><br>
<br>
I assigned supplementary individuals to DAPC groups<br>
<font color="#3366ff"><br>
predict_atp_strk5<-predict.dapc(dapc_GCP_14ssr_STRk5_b,newdata=x.sup_80</font><br>
<br>
The predicted group memberships of supplementary individuals based
on DAPC results is high, so I expect that supplementary individuals
would be located in the DAPC groups ... <br>
<br>
But it is not the case, as on the scatterplot, supplementary
individuals mostly appear outside from the groups to which they are
assigned !! <br>
<br>
<pre class="r" style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 13px; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 1.42857143; color: rgb(51, 51, 51); word-break: break-all; word-wrap: break-word; background-color: rgb(245, 245, 245); border: 1px solid rgb(204, 204, 204); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><code class="r" style="box-sizing: border-box; font-family: monospace; font-size: inherit; padding: 0px; color: inherit; background-color: transparent; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; white-space: pre-wrap;"><span c
lass="i
dentifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);"><-</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">c</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"#F8766D"</span>, <span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"#A3A500"</span>, <span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"#00BF7D"</span>, <span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"#00B0F6"</span>, <span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"#E76BF3"</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span> <span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); fon
t-style:
italic;"># colors for African collection individuals</span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">colb</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);"><-</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">c</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"darkblue"</span>,<span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"dodgerblue"</span>,<span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"darkorange2"</span>,<span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"red"</span>,<span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"gold"</span>,<span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"grey"</span><span class="paren" style="box-sizing: border-box; color: rgb(104,
118, 13
5);">)</span> <span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;"># colors for supplementary Mount Kenya individuals (according to their STRUCTURE group)</span>
<span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;">#axes 1 and 2</span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col.points_80</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);"><-</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">transp</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">[</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">as.integer</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">pop</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">x_80</span
><span
class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">]</span>,<span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">.2</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span> <span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;"># define the color of African individuals as transparent</span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">scatter</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">dapc_GCP_14ssr_STRk5_b</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">bg</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"white"</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">scree.da</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118
, 135);
">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">0</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">pch</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="string" style="box-sizing: border-box; color: rgb(221, 17, 68);">""</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">cstar</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">0</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">clab</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">0</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">xlim</span><span
class="
operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">c</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">-</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">10</span>,<span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">10</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">legend</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="literal" style="box-sizing: border-box; color: rgb(153, 0, 115);">F</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span><span class="comment" style="box
-sizing:
border-box; color: rgb(153, 153, 136); font-style: italic;"># </span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">par</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">xpd</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="literal" style="box-sizing: border-box; color: rgb(153, 0, 115);">TRUE</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">points</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">dapc_GCP_14ssr_STRk5_b</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">$</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">ind.coord</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">[</span>,<span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">1</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">]</span>, <span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">dapc_GCP_14ssr_STRk5_b</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">$</span><span class="identifier" style="box-sizing: border-box; color
: rgb(0
, 0, 0);">ind.coord</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">[</span>,<span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">2</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">]</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">pch</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">20</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col.points_80</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">cex</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 1
18, 135)
;">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">1</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span> <span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;">## scatter DAPC groups / African GCP dataset</span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col.sup_80</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);"><-</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">colb</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">[</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">as.integer</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">pop</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">x.sup_80</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span><
span cl
ass="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">]</span> <span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;">## Define supplementary individuals color</span>
<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">points</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">predict_atp_strk5</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">$</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">ind.scores</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">[</span>,<span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">1</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">]</span>, <span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">predict_atp_strk5</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">$</span><span class="identifier" style="box-sizing: border-box; color: rgb(0,
0, 0);"
>ind.scores</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">[</span>,<span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">2</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">]</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">pch</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">8</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">transp</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">(</span><span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">col.sup_80<
/span>,<
span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">.7</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span>,<span class="identifier" style="box-sizing: border-box; color: rgb(0, 0, 0);">cex</span><span class="operator" style="box-sizing: border-box; color: rgb(104, 118, 135);">=</span><span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">1</span><span class="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">)</span> <span class="comment" style="box-sizing: border-box; color: rgb(153, 153, 136); font-style: italic;"># plot supplementary individuals</span></code></pre>
<br>
With a previous version of adegenet, this problem did not appear as
supplementary individuals were located within the DAPC groups, and
this problem appeared while running my script with the new adegenet
version ... <br>
<br>
Does someone have an idea of what the problem is ? I can provide the
full script and data if needed<br>
<br>
<br>
<br>
<img src="cid:part1.06040904.09060101@cirad.fr" alt="" height="309"
width="434"><br>
<br>
Thank you for your help !<br>
<pre class="moz-signature" cols="72">--
Vanesse Labeyrie
</pre>
</body>
</html>