<div dir="ltr">Hi there, <div><br></div><div>it could be 2 things: a normal behaviour, or a bug. For the first, the result could make sense: individuals will be assigned to their closest group, even if they fall outside the group's cloud of point. So the result in itself may not be too surprising.</div><div><br></div><div>The fact that the result changed with the version of adegenet is more concerning at it suggests a bug. However, the DAPC itself hasn't changed much. Can you provide a reproducible example showing the change?</div><div><br></div><div>Best</div><div>Thibaut</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><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><br>--<br>Dr Thibaut Jombart<br>Lecturer, Department of Infectious Disease Epidemiology<br></div></div>Imperial College London<br><a href="https://sites.google.com/site/thibautjombart/" 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></div></div></div></div>
<br><div class="gmail_quote">On 1 September 2016 at 14:07, 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>
    <div lang="x-unicode"> <br>
      I have a problem when plotting supplementary individuals on DAPC
      scatterplot: while they are clearly assigned to a group (with a
      very high probability), they are displayed outside of this group
      on the scatterplot.<br>
      <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>
      <font color="#3333ff">col<-c("#F8766D", "#A3A500", "#00BF7D",
        "#00B0F6", "#E76BF3") # colors for DAPC individuals<br>
        colb<-c("darkblue","<wbr>dodgerblue","darkorange2","<wbr>red","gold","grey")
        # colors for supplementary  individuals <br>
        <br>
        #axes 1 and 2<br>
        col.points_80<-transp(col[as.<wbr>integer(pop(x_80))],.2) # define
        the color of DAPC individuals as transparent<br>
        scatter(dapc_GCP_14ssr_STRk5_<wbr>b,col=col,bg="white",scree.da=<wbr>0,pch="",cstar=0,clab=0,xlim=<wbr>c(-10,10),legend=F)#
        <br>
        par(xpd=TRUE)<br>
        points(dapc_GCP_14ssr_STRk5_b$<wbr>ind.coord[,1],
        dapc_GCP_14ssr_STRk5_b$ind.<wbr>coord[,2],pch=20,col=col.<wbr>points_80,cex=1)
        ## scatter DAPC groups <br>
        <br>
        col.sup_80<-colb[as.integer(<wbr>pop(x.sup_80))] ## Define
        supplementary individuals color<br>
        points(predict_atp_strk5$ind.<wbr>scores[,1],
        predict_atp_strk5$ind.scores[,<wbr>2],pch=8,col=transp(col.sup_<wbr>80,<<br>
        span class="number" style="box-sizing: border-box; color: rgb(0,
        153, 153);">.7),cex=1) # plot supplementary individuals<br>
      </font><br>
      <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
      picture of the scatterplot, full script and data if needed<br>
      <br>
      <br>
      Thank you for your help !<span class="HOEnZb"><font color="#888888"><br>
      <pre cols="72">-- 
Vanesse Labeyrie

</pre>
    </font></span></div>
    <br>
  </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>