<div dir="ltr">Hi there, <div><br></div><div>yep. To add to this: you can increase the number of random starting points e.g. n.start = 50 to smooth the results.</div><div><br></div><div>Best</div><div>Thibaut<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br><font face="arial, helvetica, sans-serif">--<br>Dr Thibaut Jombart<br>Associate Professor in Outbreak Analytics, London School of Hygiene and Tropical Medicine<br>Senior Lecturer in Genetic Analysis, Imperial College London</font></div><div><font face="arial, helvetica, sans-serif">President of RECON: <a href="http://repidemicsconsortium.org" target="_blank">repidemicsconsortium.org</a></font></div><div><font face="arial, helvetica, sans-serif"><a href="https://thibautjombart.netlify.com" style="letter-spacing:0.2px" target="_blank">https://thibautjombart.netlify.com</a><br></font></div><div><font face="arial, helvetica, sans-serif">Twitter: @TeebzR</font><br></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 24 Jan 2019 at 12:44, Cathy Bouffartigue <<a href="mailto:cathy.bouffartigue@inra.fr">cathy.bouffartigue@inra.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="FR">
<div class="gmail-m_-6176685330583439101WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Helena,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">This is due to the k-means algorithm used in the find.cluster function which use a different seed for its initialization
each time you’re running your code. You have to set the seed before running your find.cluster function to ensure the reproducibility of your results.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">set.seeds(24012019)<u></u><u></u></span></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif">perca_grp6 <-find.clusters(perca, max.n.clust = 10)<u></u><u></u></span></strong></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif"><u></u> <u></u></span></strong></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif"><u></u> <u></u></span></strong></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif;color:rgb(68,84,106);font-weight:normal">Good luck with your analyses!<u></u><u></u></span></strong></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif"><u></u> <u></u></span></strong></p>
<p class="MsoNormal"><strong><span lang="EN-US" style="font-size:10.5pt;font-family:Calibri,sans-serif">Cathy<u></u><u></u></span></strong></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Times,serif;color:black"><img width="107" height="44" style="width: 1.1145in; height: 0.4583in;" id="gmail-m_-6176685330583439101Image_x0020_2" src="cid:16880e8e5ff4ce8e91" alt="Description : cid:43BA2359-25C8-49EA-9D28-BCFD56FD115B@toulouse.inra.fr"></span><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><br>
</span><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(139,172,33)">_____________________________<br>
<br>
</span></b><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)">Cathy Bouffartigue</span></b><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(139,172,33)"><br>
</span></b><span style="font-size:8pt;font-family:Arial,sans-serif;color:black">Doctorante/ PhD student<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><a href="mailto:cathy.bouffartigue@inra.fr" target="_blank"><span style="font-family:Arial,sans-serif">cathy.bouffartigue@inra.fr</span></a></span><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)"><u></u><u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)"><u></u> <u></u></span></b></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)">Centre Inra Occitanie-Toulouse<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Arial,sans-serif;color:black">Fixe : +33 (0)5 61 28 57 74</span><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)">
<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:8pt;font-family:Arial,sans-serif;color:black">Mobile : +33 (0)6 14 57 34 55<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(139,172,33)">_____________________________<br>
</span></b><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)"><br>
</span></b><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black">Chemin de Borde Rouge CS 52627<br>
31326 Castanet Tolosan cedex<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black"><br>
</span><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><a href="http://www.toulouse.inra.fr/" target="_blank"><b><span style="font-size:10pt;color:rgb(166,205,57)">www.toulouse.inra.fr</span></b></a></span><b><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(166,205,57)"><u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">De :</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> adegenet-forum <<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a>>
<b>De la part de</b> HELENA IBANEZ MARTINEZ<br>
<b>Envoyé :</b> jeudi 24 janvier 2019 12:58<br>
<b>À :</b> <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<b>Objet :</b> Re: [adegenet-forum] Doubt with DAPC without prior K (find.clusters)<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p><span style="font-size:10.5pt;font-family:Arial,sans-serif">HELENA IBANEZ MARTINEZ <<a href="mailto:him21024@um.es" target="_blank">him21024@um.es</a>> escribió:<u></u><u></u></span></p>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 9pt;margin-left:1.5pt;margin-top:5pt;margin-bottom:5pt">
<p><span style="font-size:10.5pt;font-family:Arial,sans-serif">HELENA IBANEZ MARTINEZ <<a href="mailto:him21024@um.es" target="_blank">him21024@um.es</a>> escribió:<u></u><u></u></span></p>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 9pt;margin-left:1.5pt;margin-top:5pt;margin-bottom:5pt">
<p class="MsoNormal"><span class="gmail-m_-6176685330583439101tlid-translation"><b><span style="font-size:10.5pt;font-family:Arial,sans-serif">Hello, my name is Helena,</span></b></span><b><span style="font-size:10.5pt;font-family:Arial,sans-serif"><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">I have a question about my DAPC analayses.</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">I'm following the tutorial step by step and I get the DAPC graph of my data very well, but my problem is when I repeat the process my graphic results come out completely different every time...</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">My question is, why do such different results come out if I'm repeating exactly the same (same data and same parameters)? It happens to me every time I do it. What can I be doing wrong?</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">Here I leave the example of my code: 135 individuals with 8 loci sampled in 6 different locations</span></span></b><span style="font-size:10.5pt;font-family:Arial,sans-serif"><br>
<br>
<strong><span style="font-family:Arial,sans-serif">perca <-read.structure("PercaPopName.str",</span></strong><b><br>
<strong><span style="font-family:Arial,sans-serif"> onerowperind=TRUE,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> n.ind=135,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> n.loc=8,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> col.lab=1,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> col.pop=2,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> row.marknames=1,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> ask=FALSE)</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">perca_grp6 <-find.clusters(perca, max.n.clust = 10)</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">200</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">6</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">dapc6 <-dapc(perca, perca_grp6$grp)</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">200</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">5</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">scatter(dapc6)</span></strong></b><br>
<br>
<strong><span style="font-family:Arial,sans-serif">Thank you.</span></strong><br>
<br>
<br>
<br>
<br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">Hi, my name is Helena,</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">I have a question about my DAPC analayses.</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">I'm following the tutorial step by step and well, I get the DAPC graph of my data, but the problem is that when I repeat this my graphic results come out completely different, therefore they are not reliable...</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation">My question is, why do such different results come out if I'm repeating exactly the same? It happens to me every time I do it. What can I be doing wrong?</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">Here my code:</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">perca <-read.structure("PercaPopName.str",</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> onerowperind=TRUE,</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> n.ind=135,</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> n.loc=8,</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> col.lab=1,</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> col.pop=2,</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> row.marknames=1,</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation"> ask=FALSE)</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">dapc1 <-dapc(perca, perca_grp$grp)</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">200</span><br>
<span class="gmail-m_-6176685330583439101tlid-translation">6</span><br>
<br>
<span class="gmail-m_-6176685330583439101tlid-translation">scatter(dapc1)</span><br>
<br>
<br>
<strong><span style="font-family:Arial,sans-serif">Hello again, I`m Helena, sorry but I introduced my code wrong yesterday:</span></strong><b><br>
<br>
<strong><span style="font-family:Arial,sans-serif">This is my code: </span></strong></b><br>
<br>
<strong><span style="font-family:Arial,sans-serif">perca <-read.structure("PercaPopName.str",</span></strong><b><br>
<strong><span style="font-family:Arial,sans-serif"> onerowperind=TRUE,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> n.ind=135,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> n.loc=8,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> col.lab=1,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> col.pop=2,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> row.marknames=1,</span></strong><br>
<strong><span style="font-family:Arial,sans-serif"> ask=FALSE)</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">perca_grp6 <-find.clusters(perca, max.n.clust = 10)</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">200</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">6</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">dapc6 <-dapc(perca, perca_grp6$grp)</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">200</span></strong><br>
<strong><span style="font-family:Arial,sans-serif">5</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">scatter(dapc6)</span></strong><br>
<br>
<strong><span style="font-family:Arial,sans-serif">Thank you </span></strong></b><br>
<u></u><u></u></span></p>
</blockquote>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Arial,sans-serif"><br>
<br>
<u></u><u></u></span></p>
</blockquote>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-size:10.5pt;font-family:Arial,sans-serif"><u></u> <u></u></span></p>
</div>
</div>
_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.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-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a></blockquote></div>