<div dir="ltr"><div><div><div>Hi Nic,<br><br></div>That's what I thought as well. <br>But indeed you have to change the argument when using the scatter.dapc argument as Thimbaut pointed.<br><br></div>Best wishes,<br></div>

Emrah<br><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 8 August 2014 00:27, Nicolas Dussex <span dir="ltr"><<a href="mailto:nicolas.dussex@gmail.com" target="_blank">nicolas.dussex@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi everyone,<br><br></div>Thanks for your help. Emrah is sort of right. I also  tried this command: <br>

<br>

















<span style="font-size:11pt;line-height:115%;font-family:Calibri" lang="EN-NZ">dapc1 <- dapc(data, <b>grp$pop</b>)</span>



<br><br></div>but the clustering seems a bit different from the grp$grp option. So I would like to keep the clusters identified with the group discrimination method but color my points according to their population of origin as in this example: <br>


<br><a href="http://figshare.com/articles/_Genetic_structure_of_the_PWN_field_samples_from_the_USA_/653650" target="_blank">http://figshare.com/articles/_Genetic_structure_of_the_PWN_field_samples_from_the_USA_/653650</a><br>

<br></div>but didn't find the information to do that sort of scatter plot in the manual.<br>
<br></div><div>Hope it makes sense.<br></div><div><br></div>Cheers<br></div>Nic<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On 8 August 2014 04:10, Jombart, Thibaut <span dir="ltr"><<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
You run an analysis using group 'yyy'. The analysis provides an optimum discrimination for group 'yyy'.<br>
<br>
Then if you plot the results using group 'zzz', the analysis is no longer optimum for this group. The analysis hasn't changed, and is still only optimal for 'yyy'.<br>
<br>
Cheers<br>
Thibaut<br>
<br>
________________________________________<br>
From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Rita Castilho [<a href="mailto:rita.castil@gmail.com" target="_blank">rita.castil@gmail.com</a>]<br>



Sent: 07 August 2014 16:27<br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><br>
<div>Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by        population<br>
<br>
</div><div>So, why the warning: "the analysis is no longer optimal in terms of group discrimination”, if it is the same analysis...<br>
<br>
Cheers<br>
Rita<br>
<br>
</div><div>On 7 Aug, 2014, at 12:08, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a><mailto:<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a>>> wrote:<br>



<br>
<br>
Hi<br>
<br>
this is what I understood too. And my answer does exactly that - see the grp argument in ?scatter.dapc.<br>
<br>
Cheers<br>
Thibaut<br>
________________________________________<br>
</div>From: Emrah Coraman [<a href="mailto:coramane@gmail.com" target="_blank">coramane@gmail.com</a><mailto:<a href="mailto:coramane@gmail.com" target="_blank">coramane@gmail.com</a>>]<br>
<div>Sent: 07 August 2014 12:01<br>
To: Jombart, Thibaut<br>
</div>Cc: Nicolas Dussex; <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a>><br>



<div>Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by population<br>
<br>
Hi,<br>
<br>
I think Nic just wants to color the DAPC scatter plot  not with the identified DAPC groups but with their respective population information.<br>
So I guess he doesn't want to change the group discrimination method.<br>
<br>
Did I get it right?<br>
<br>
Best wishes,<br>
Emrah<br>
<br>
<br>
</div><div><div>On 7 August 2014 13:53, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a><mailto:<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a>><mailto:<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a>>> wrote:<br>



Hi there,<br>
<br>
simple, just replace grp$grp with the grouping of individuals you want to use for the plot.<br>
<br>
This said, be aware that the analysis is no longer optimal in terms of group discrimination.<br>
<br>
Best<br>
Thibaut<br>
<br>
<br>
==============================<br>
Dr Thibaut Jombart<br>
MRC Centre for Outbreak Analysis and Modelling<br>
Department of Infectious Disease Epidemiology<br>
Imperial College - School of Public Health<br>
Norfolk Place, London W2 1PG, UK<br>
Tel. : 0044 (0)20 7594 3658<br>
<a href="http://sites.google.com/site/thibautjombart/" target="_blank">http://sites.google.com/site/thibautjombart/</a><br>
<a href="http://sites.google.com/site/therepiproject/" target="_blank">http://sites.google.com/site/therepiproject/</a><br>
<a href="http://adegenet.r-forge.r-project.org/" target="_blank">http://adegenet.r-forge.r-project.org/</a><br>
Twitter: @thibautjombart<br>
________________________________________<br>
From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a>> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</a>>] on behalf of Nicolas Dussex [<a href="mailto:nicolas.dussex@gmail.com" target="_blank">nicolas.dussex@gmail.com</a><mailto:<a href="mailto:nicolas.dussex@gmail.com" target="_blank">nicolas.dussex@gmail.com</a>>]<br>



Sent: 07 August 2014 02:15<br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</a>><br>



Subject: [adegenet-forum] DAPC scatter plot and individual colour by    population<br>
<br>
Hi,<br>
<br>
I built a DAPC scatter plot without using a priori grouping information (i.e. geographically distinct populations) using this simple command line: dapc1 <- dapc(data, grp$grp).<br>
<br>
I obtained three distinct cluster but now I was wondering how I could  represent each individual with a colour corresponding to their sampling origin rather than to their inferred cluster.<br>
<br>
I couldn't find this information on the manual and was hoping I could get some advice on that.<br>
<br>
Thanks for your help!<br>
Nic<br>
--<br>
Nic Dussex PhD<br>
Department of Zoology<br>
University of Otago<br>
340 Great King Street<br>
P.O.Box 56<br>
Dunedin 9054<br>
New Zealand<br>
<br>
Mobile: 021 02790938<br>
_______________________________________________<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><mailto:<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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br>
_______________________________________________<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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
<br>
_______________________________________________<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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Nic Dussex PhD<br>Department of Zoology<br>University of Otago<br>340 Great King Street<br>P.O.Box 56<br>Dunedin 9054<br>New Zealand<br><br>Mobile: 021 02790938<br>


</div>
</div>
</div></div><br>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">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" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></blockquote></div><br></div>