<div dir="ltr">Hello, <div><br></div><div>this has been fixed in the devel version at revision a3498410e0097392fb86b44<br></div><div><br></div><div>Best</div><div>Thibaut</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><div><br>--<br>Dr Thibaut Jombart<br>Lecturer, Department of Infectious Disease Epidemiology, <span style="font-size:12.8px">Imperial College London</span></div></div><div><span style="font-size:12.8px">Head of RECON: </span><span style="font-size:12.8px"><a href="https://reconhub.github.io/" target="_blank">https://reconhub.github.io/</a></span><br></div></div><div><a href="https://sites.google.com/site/thibautjombart/" style="font-size:12.8px" target="_blank">https://sites.google.com/site/thibautjombart/</a><br></div><div><a href="https://github.com/thibautjombart" target="_blank">https://github.com/thibautjombart<br></a></div>Twitter: <a href="https://twitter.com/TeebzR" target="_blank">@TeebzR</a><br></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 18 August 2016 at 12:27, vlabeyrie <span dir="ltr"><<a href="mailto:vanesse.labeyrie@cirad.fr" target="_blank">vanesse.labeyrie@cirad.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div 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:<wbr>nrow(Ge_atp@tab)),]
      # supplementary individuals<br>
      <br>
      x_80<-Ge_atp_gcp_80[-c(1:nrow(<wbr>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.<wbr>dapc(dapc_GCP_14ssr_STRk5_b,<wbr>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 style="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;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px"><code style="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 style="color:rgb(0,0,0)">col</span><span style="color:rgb(104,118,135)"><-</span><span style="color:rgb(0,0,0)">c</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(221,17,68)">"#F8766D"</span>, <span style="color:rgb(221,17,68)">"#A3A500"</span>, <span style="color:rgb(221,17,68)">"#00BF7D"</span>, <span style="color:rgb(221,17,68)">"#00B0F6"</span>, <span style="color:rgb(221,17,68)">"#E76BF3"</span><span style="color:rgb(104,118,135)">)</span> <span># colors for African collection individuals</span>
<span style="color:rgb(0,0,0)">colb</span><span style="color:rgb(104,118,135)"><-</span><span style="color:rgb(0,0,0)">c</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(221,17,68)">"darkblue"</span>,<span style="color:rgb(221,17,68)">"<wbr>dodgerblue"</span>,<span style="color:rgb(221,17,68)">"darkorange2"</span>,<span style="color:rgb(221,17,68)">"<wbr>red"</span>,<span style="color:rgb(221,17,68)">"gold"</span>,<span style="color:rgb(221,17,68)">"grey"</span><span>)</span> <span style="color:rgb(153,153,136);font-style:italic"># colors for supplementary Mount Kenya individuals (according to their STRUCTURE group)</span>

<span style="color:rgb(153,153,136);font-style:italic">#axes 1 and 2</span>
<span style="color:rgb(0,0,0)">col.points_80</span><span style="color:rgb(104,118,135)"><-</span><span style="color:rgb(0,0,0)">transp</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">col</span><span style="color:rgb(104,118,135)">[</span><span style="color:rgb(0,0,0)">as.<wbr>integer</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">pop</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">x_80</span><span style="color:rgb(104,118,135)">)</span><span style="color:rgb(104,118,135)">)</span><span style="color:rgb(104,118,135)">]</span>,<span style="color:rgb(0,153,153)">.2</span><span style="color:rgb(104,118,135)">)</span> <span style="color:rgb(153,153,136);font-style:italic"># define the color of African individuals as transparent</span>
<span style="color:rgb(0,0,0)">scatter</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">dapc_GCP_14ssr_STRk5_b</span><wbr>,<span style="color:rgb(0,0,0)">col</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,0,0)">col</span>,<span style="color:rgb(0,0,0)">bg</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(221,17,68)">"white"</span>,<span style="color:rgb(0,0,0)">scree.da</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,153,153)">0</span><wbr>,<span style="color:rgb(0,0,0)">pch</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(221,17,68)">""</span>,<span style="color:rgb(0,0,0)">cstar</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,153,153)">0</span>,<span style="color:rgb(0,0,0)">clab</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,153,153)">0</span>,<span style="color:rgb(0,0,0)">xlim</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,0,0)">c</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(104,118,135)"><wbr>-</span><span style="color:rgb(0,153,153)">10</span>,<span style="color:rgb(0,153,153)">10</span><span style="color:rgb(104,118,135)">)</span>,<span style="color:rgb(0,0,0)">legend</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(153,0,115)">F</span><span style="color:rgb(104,118,135)">)</span><span># </span>
<span style="color:rgb(0,0,0)">par</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">xpd</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(153,0,115)">TRUE</span><span style="color:rgb(104,118,135)">)</span>
<span style="color:rgb(0,0,0)">points</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">dapc_GCP_14ssr_STRk5_b</span><span style="color:rgb(104,118,135)">$</span><span style="color:rgb(0,0,0)"><wbr>ind.coord</span><span style="color:rgb(104,118,135)">[</span>,<span style="color:rgb(0,153,153)">1</span><span style="color:rgb(104,118,135)">]</span>, <span style="color:rgb(0,0,0)">dapc_GCP_14ssr_STRk5_b</span><span style="color:rgb(104,118,135)">$</span><span style="color:rgb(0,0,0)">ind.<wbr>coord</span><span style="color:rgb(104,118,135)">[</span>,<span style="color:rgb(0,153,153)">2</span><span style="color:rgb(104,118,135)">]</span>,<span style="color:rgb(0,0,0)">pch</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,153,153)">20</span>,<span style="color:rgb(0,0,0)">col</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,0,0)">col.<wbr>points_80</span>,<span style="color:rgb(0,0,0)">cex</span><span>=</span><span style="color:rgb(0,153,153)">1</span><span style="color:rgb(104,118,135)">)</span> <span style="color:rgb(153,153,136);font-style:italic">## scatter DAPC groups / African GCP dataset</span>

<span style="color:rgb(0,0,0)">col.sup_80</span><span style="color:rgb(104,118,135)"><-</span><span style="color:rgb(0,0,0)">colb</span><span style="color:rgb(104,118,135)">[</span><span style="color:rgb(0,0,0)">as.integer</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">po<wbr>p</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">x.sup_80</span><span style="color:rgb(104,118,135)">)</span><span style="color:rgb(104,118,135)">)</span><
 span cl
ass="paren" style="box-sizing: border-box; color: rgb(104, 118, 135);">] <span style="color:rgb(153,153,136);font-style:italic">## Define supplementary individuals color</span>
<span style="color:rgb(0,0,0)">points</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">predict_atp_strk5</span><span style="color:rgb(104,118,135)">$</span><span style="color:rgb(0,0,0)">ind.<wbr>scores</span><span style="color:rgb(104,118,135)">[</span>,<span style="color:rgb(0,153,153)">1</span><span style="color:rgb(104,118,135)">]</span>, <span style="color:rgb(0,0,0)">predict_atp_strk5</span><span style="color:rgb(104,118,135)">$</span><span style="color:rgb(0,0,0)">ind.scores</span><span style="color:rgb(104,118,135)">[</span>,<span style="color:rgb(0,153,153)"><wbr>2</span><span style="color:rgb(104,118,135)">]</span>,<span style="color:rgb(0,0,0)">pch</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,153,153)">8</span>,<span style="color:rgb(0,0,0)">col</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,0,0)">transp</span><span style="color:rgb(104,118,135)">(</span><span style="color:rgb(0,0,0)">col.sup_<wbr>80<
 /span>,<
span class="number" style="box-sizing: border-box; color: rgb(0, 153, 153);">.7</span><span style="color:rgb(104,118,135)">)</span>,<span style="color:rgb(0,0,0)">cex</span><span style="color:rgb(104,118,135)">=</span><span style="color:rgb(0,153,153)">1</span><span style="color:rgb(104,118,135)">)</span> <span style="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 !<span class="HOEnZb"><font color="#888888"><br>
    <pre cols="72">-- 
Vanesse Labeyrie

</pre>
  </font></span></div>

<br>______________________________<wbr>_________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.<wbr>r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/adegenet-forum</a><br></blockquote></div><br></div>