<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div apple-content-edited="true"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="color: rgb(0, 0, 0); font-family: 'American Typewriter'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Ah, yes that makes sense! And I guess it will also work the other way around…. clusters first, pop after…</span></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="color: rgb(0, 0, 0); font-family: 'American Typewriter'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">Thanks</span></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="color: rgb(0, 0, 0); font-family: 'American Typewriter'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"><br></span></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><br style="color: rgb(0, 0, 0); font-family: 'American Typewriter'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></div>
</div>
<br><div><div>On 8 Aug, 2014, at 10:54, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>Hi,<span class="Apple-converted-space"> </span><br><br>so, err... ahem... how to say? Please check my previous answer(s). What you're looking for is changing the *grp* argument in the function *scatter.dapc*. It just changes the colors.<br><br>In case this is still unclear, an example:<br><br>## load data<br>data(microbov)<br><br>## make a DAPC - this uses by default pop(microbov)<br>dapc1 <- dapc(microbov, n.pca=10, n.da=2)<br><br>## plot with groups used in DAPC<br>scatter(dapc1)<br><br>## plot with another group - the species<br>scatter(dapc1, grp=microbov$other$spe)<br><br>Makes sense?<br><br>Cheers<br><br>Thibaut<br><br><br>________________________________________<br>From: Nicolas Dussex [<a href="mailto:nicolas.dussex@gmail.com">nicolas.dussex@gmail.com</a>]<br>Sent: 07 August 2014 22:27<br>To: Jombart, Thibaut<br>Cc: Rita Castilho;<span class="Apple-converted-space"> </span><a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by population<br><br>Hi everyone,<br><br>Thanks for your help. Emrah is sort of right. I also tried this command:<br><br>dapc1 <- dapc(data, grp$pop)<br><br>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">http://figshare.com/articles/_Genetic_structure_of_the_PWN_field_samples_from_the_USA_/653650</a><br><br>but didn't find the information to do that sort of scatter plot in the manual.<br><br>Hope it makes sense.<br><br>Cheers<br>Nic<br><br><br>On 8 August 2014 04:10, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a>>> wrote:<br><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:<span class="Apple-converted-space"> </span><a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a>> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a>>] on behalf of Rita Castilho [<a href="mailto:rita.castil@gmail.com">rita.castil@gmail.com</a><<a href="mailto:rita.castil@gmail.com">mailto:rita.castil@gmail.com</a>>]<br>Sent: 07 August 2014 16:27<br>To:<span class="Apple-converted-space"> </span><a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a>><br>Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by population<br><br>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>On 7 Aug, 2014, at 12:08, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a>><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a><<a href="mailto:t.jombart@imperial.ac.uk">mailto: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>From: Emrah Coraman [<a href="mailto:coramane@gmail.com">coramane@gmail.com</a><<a href="mailto:coramane@gmail.com">mailto:coramane@gmail.com</a>><<a href="mailto:coramane@gmail.com">mailto:coramane@gmail.com</a><<a href="mailto:coramane@gmail.com">mailto:coramane@gmail.com</a>>>]<br>Sent: 07 August 2014 12:01<br>To: Jombart, Thibaut<br>Cc: Nicolas Dussex;<span class="Apple-converted-space"> </span><a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a>><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a>>><br>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>On 7 August 2014 13:53, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a>><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a>>><<a href="mailto:t.jombart@imperial.ac.uk">mailto:t.jombart@imperial.ac.uk</a><<a href="mailto:t.jombart@imperial.ac.uk">mailto: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/">http://sites.google.com/site/thibautjombart/</a><br><a href="http://sites.google.com/site/therepiproject/">http://sites.google.com/site/therepiproject/</a><br><a href="http://adegenet.r-forge.r-project.org/">http://adegenet.r-forge.r-project.org/</a><br>Twitter: @thibautjombart<br>________________________________________<br>From:<span class="Apple-converted-space"> </span><a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a>><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a>>> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a>><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">mailto:adegenet-forum-bounces@lists.r-forge.r-project.org</a>>>] on behalf of Nicolas Dussex [<a href="mailto:nicolas.dussex@gmail.com">nicolas.dussex@gmail.com</a><<a href="mailto:nicolas.dussex@gmail.com">mailto:nicolas.dussex@gmail.com</a>><<a href="mailto:nicolas.dussex@gmail.com">mailto:nicolas.dussex@gmail.com</a><<a href="mailto:nicolas.dussex@gmail.com">mailto:nicolas.dussex@gmail.com</a>>>]<br>Sent: 07 August 2014 02:15<br>To:<span class="Apple-converted-space"> </span><a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a>><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto: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">adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a>><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto:adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto: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">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">adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto: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">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">adegenet-forum@lists.r-forge.r-project.org</a><<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">mailto: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">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br><br><br><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</div></blockquote></div><br></body></html>