[adegenet-forum] DAPC scatter plot and individual colour by population

Rita Castilho rita.castil at gmail.com
Fri Aug 8 12:11:33 CEST 2014


Ah, yes that makes sense! And I guess it will also work the other way around…. clusters first, pop after…
Thanks




On 8 Aug, 2014, at 10:54, Jombart, Thibaut <t.jombart at imperial.ac.uk> wrote:

> 
> Hi, 
> 
> 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.
> 
> In case this is still unclear, an example:
> 
> ## load data
> data(microbov)
> 
> ## make a DAPC - this uses by default pop(microbov)
> dapc1 <- dapc(microbov, n.pca=10, n.da=2)
> 
> ## plot with groups used in DAPC
> scatter(dapc1)
> 
> ## plot with another group - the species
> scatter(dapc1, grp=microbov$other$spe)
> 
> Makes sense?
> 
> Cheers
> 
> Thibaut
> 
> 
> ________________________________________
> From: Nicolas Dussex [nicolas.dussex at gmail.com]
> Sent: 07 August 2014 22:27
> To: Jombart, Thibaut
> Cc: Rita Castilho; adegenet-forum at lists.r-forge.r-project.org
> Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by population
> 
> Hi everyone,
> 
> Thanks for your help. Emrah is sort of right. I also  tried this command:
> 
> dapc1 <- dapc(data, grp$pop)
> 
> 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:
> 
> http://figshare.com/articles/_Genetic_structure_of_the_PWN_field_samples_from_the_USA_/653650
> 
> but didn't find the information to do that sort of scatter plot in the manual.
> 
> Hope it makes sense.
> 
> Cheers
> Nic
> 
> 
> On 8 August 2014 04:10, Jombart, Thibaut <t.jombart at imperial.ac.uk<mailto:t.jombart at imperial.ac.uk>> wrote:
> 
> You run an analysis using group 'yyy'. The analysis provides an optimum discrimination for group 'yyy'.
> 
> 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'.
> 
> Cheers
> Thibaut
> 
> ________________________________________
> From: adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org> [adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org>] on behalf of Rita Castilho [rita.castil at gmail.com<mailto:rita.castil at gmail.com>]
> Sent: 07 August 2014 16:27
> To: adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>
> Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by        population
> 
> So, why the warning: "the analysis is no longer optimal in terms of group discrimination”, if it is the same analysis...
> 
> Cheers
> Rita
> 
> On 7 Aug, 2014, at 12:08, Jombart, Thibaut <t.jombart at imperial.ac.uk<mailto:t.jombart at imperial.ac.uk><mailto:t.jombart at imperial.ac.uk<mailto:t.jombart at imperial.ac.uk>>> wrote:
> 
> 
> Hi
> 
> this is what I understood too. And my answer does exactly that - see the grp argument in ?scatter.dapc.
> 
> Cheers
> Thibaut
> ________________________________________
> From: Emrah Coraman [coramane at gmail.com<mailto:coramane at gmail.com><mailto:coramane at gmail.com<mailto:coramane at gmail.com>>]
> Sent: 07 August 2014 12:01
> To: Jombart, Thibaut
> Cc: Nicolas Dussex; adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org><mailto:adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>>
> Subject: Re: [adegenet-forum] DAPC scatter plot and individual colour by population
> 
> Hi,
> 
> I think Nic just wants to color the DAPC scatter plot  not with the identified DAPC groups but with their respective population information.
> So I guess he doesn't want to change the group discrimination method.
> 
> Did I get it right?
> 
> Best wishes,
> Emrah
> 
> 
> On 7 August 2014 13:53, Jombart, Thibaut <t.jombart at imperial.ac.uk<mailto:t.jombart at imperial.ac.uk><mailto:t.jombart at imperial.ac.uk<mailto:t.jombart at imperial.ac.uk>><mailto:t.jombart at imperial.ac.uk<mailto:t.jombart at imperial.ac.uk>>> wrote:
> Hi there,
> 
> simple, just replace grp$grp with the grouping of individuals you want to use for the plot.
> 
> This said, be aware that the analysis is no longer optimal in terms of group discrimination.
> 
> Best
> Thibaut
> 
> 
> ==============================
> Dr Thibaut Jombart
> MRC Centre for Outbreak Analysis and Modelling
> Department of Infectious Disease Epidemiology
> Imperial College - School of Public Health
> Norfolk Place, London W2 1PG, UK
> Tel. : 0044 (0)20 7594 3658
> http://sites.google.com/site/thibautjombart/
> http://sites.google.com/site/therepiproject/
> http://adegenet.r-forge.r-project.org/
> Twitter: @thibautjombart
> ________________________________________
> From: adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org><mailto:adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org>> [adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org><mailto:adegenet-forum-bounces at lists.r-forge.r-project.org<mailto:adegenet-forum-bounces at lists.r-forge.r-project.org>>] on behalf of Nicolas Dussex [nicolas.dussex at gmail.com<mailto:nicolas.dussex at gmail.com><mailto:nicolas.dussex at gmail.com<mailto:nicolas.dussex at gmail.com>>]
> Sent: 07 August 2014 02:15
> To: adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org><mailto:adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>>
> Subject: [adegenet-forum] DAPC scatter plot and individual colour by    population
> 
> Hi,
> 
> 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).
> 
> 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.
> 
> I couldn't find this information on the manual and was hoping I could get some advice on that.
> 
> Thanks for your help!
> Nic
> --
> Nic Dussex PhD
> Department of Zoology
> University of Otago
> 340 Great King Street
> P.O.Box 56
> Dunedin 9054
> New Zealand
> 
> Mobile: 021 02790938
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org><mailto:adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
> 
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
> 
> _______________________________________________
> adegenet-forum mailing list
> adegenet-forum at lists.r-forge.r-project.org<mailto:adegenet-forum at lists.r-forge.r-project.org>
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum
> 
> 
> 
> --
> Nic Dussex PhD
> Department of Zoology
> University of Otago
> 340 Great King Street
> P.O.Box 56
> Dunedin 9054
> New Zealand
> 
> Mobile: 021 02790938

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20140808/5a63d3b4/attachment.html>


More information about the adegenet-forum mailing list