<div dir="ltr">Hello, <div><br></div><div>the K-means algorithm, used in find.clusters, uses random initial conditions which may lead to converging to different solutions. This can be the case if the data is noisy, and typically is the case when there are no clusters. </div><div><br></div><div>The usual way to stabilise the results is increase the number of starting points, which I think defaults to 10. Try setting n.start = 50 - that may help.</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 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</div><div style="font-size:small">Lecturer, Department of Infectious Disease Epidemiology, Imperial College London</div></div><div><span style="font-size:12.8px">Head of RECON: </span><span style="font-size:12.8px"><a href="http://repidemicsconsortium.org" target="_blank">repidemicsconsortium.org</a></span><br></div></div><div><a href="http://sites.google.com/site/thibautjombart/" style="font-size:12.8px" target="_blank">sites.google.com/site/thibautjombart/</a><br></div><div><a href="http://github.com/thibautjombart" target="_blank">github.com/thibautjombart</a></div>Twitter: <a href="http://twitter.com/TeebzR" target="_blank">@TeebzR</a><br></div><div dir="ltr">+44(0)20 7594 3658</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 11 January 2017 at 09:52, Markus Ruhsam <span dir="ltr"><<a href="mailto:M.Ruhsam@rbge.ac.uk" target="_blank">M.Ruhsam@rbge.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div class="m_-4303397002921982059WordSection1"><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa">Hello,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa">I want to do a DAPC on a dataset containing 1548 SNPs starting with the find.clusters command but get wildly different numbers in each group when I repeat the command using exactly the same parameters. Does anybody have an explanation for this?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa">Thank you<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa">Markus<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0053fa"><u></u> <u></u></span></p><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdabb"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">> </span></span><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">grp <- find.clusters(rul, max.n.clust=10)<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">Choose the number PCs to retain (>=1): <u></u><u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">400<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">Choose the number of clusters (>=2: <u></u><u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">3<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdabb"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">> </span></span><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">table(pop(rul), grp$grp)<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">            <u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">               1   2   3<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  native       2 131  52<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  non-native  67   3   1<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  hispanica    5   0   0<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  odd         12 113  41<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5"><u></u> <u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdabb"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">> </span></span><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">grp <- find.clusters(rul, max.n.clust=10)<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">Choose the number PCs to retain (>=1): <u></u><u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">400<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">Choose the number of clusters (>=2: <u></u><u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">3<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdabb"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">> </span></span><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">table(pop(rul), grp$grp)<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">            <u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">               1   2   3<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  native       1   1 183<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  non-native  15  51   5<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  hispanica    0   5   0<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  odd          0  12 154<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5"><u></u> <u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdabb"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">> </span></span><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">grp <- find.clusters(rul, max.n.clust=10)<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">Choose the number PCs to retain (>=1): <u></u><u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">400<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">Choose the number of clusters (>=2: <u></u><u></u></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">3<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span class="m_-4303397002921982059gcg2ujhdabb"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">> </span></span><span class="m_-4303397002921982059gcg2ujhdeab"><span style="font-family:"Lucida Console";color:blue;background:#e1e2e5">table(pop(rul), grp$grp)<u></u><u></u></span></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">            <u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">               1   2   3<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  native      49 134   2<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  non-native   1   3  67<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  hispanica    0   0   5<u></u><u></u></span></pre><pre style="word-break:break-all"><span style="font-family:"Lucida Console";color:black;background:#e1e2e5">  odd         41 113  12<u></u><u></u></span></pre><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1631f6"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">Dr Markus Ruhsam<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">Molecular Plant Ecologist<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">Royal Botanic Garden Edinburgh<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">20A Inverleith Row<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">Edinburgh <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">EH3 5LR<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">United Kingdom<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">Tel: <a href="tel:+44%20131%20248%202859" value="+441312482859" target="_blank">+44 (0) 131 248 2859</a><br>Fax: <a href="tel:+44%20131%20248%202901" value="+441312482901" target="_blank">+44 (0) 131 248 2901</a> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6"><a href="http://www.rbge.org.uk/science/genetics-and-conservation/markus-ruhsam-homepage" target="_blank"><span style="color:#1616f6;text-decoration:none">http://www.rbge.org.uk/<wbr>science/genetics-and-<wbr>conservation/markus-ruhsam-<wbr>homepage</span></a>   <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#1616f6">The mission of the Royal Botanic Garden Edinburgh is to “<b>To explore, conserve and explain the world of plants for a better future</b>”<u></u><u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:#0070c0"><u></u> <u></u></span></b></p><p class="MsoNormal"><span style="color:#0053fa"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d"><img border="0" width="325" height="105" id="m_-4303397002921982059Picture_x0020_2" src="cid:image001.png@01D26BEF.A833AB80" alt="cid:image002.png@01D09F78.9DFBA130"></span><span style="color:#0053fa"><u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div>
<br>
<br>
<p style="font-family:Verdana;font-size:8pt;color:#666666">The <a href="http://www.rbge.org.uk/" target="_blank">Royal Botanic Garden Edinburgh</a> is a charity registered in Scotland (No SC007983)</p><p></p>
</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>