[adegenet-forum] Dots in the DAPC graphic

Thibaut Jombart thibautjombart at gmail.com
Fri Oct 13 12:28:36 CEST 2017


Hello,

The function 'scatter' is meant for general purposes, but fine
customisation of the graph like you suggest goes beyond this function.
I would recommend having a look at adegraphics, which has plenty of
options for this kind of graphics:
https://cran.r-project.org/web/packages/adegraphics/vignettes/adegraphics.html

Here, I think you want to create the first layer using s.class (with
no color) and then add color points using s.value

Best
Thibaut

--
Dr Thibaut Jombart
Lecturer, Department of Infectious Disease Epidemiology, Imperial College London
Head of RECON: repidemicsconsortium.org
WHO Consultant - outbreak analysis
sites.google.com/site/thibautjombart/
Twitter: @TeebzR
+44(0)20 7594 3658


On 13 October 2017 at 09:38, Roman Luštrik <roman.lustrik at biolitika.si> wrote:
> A-ha, I think I see where you're getting at. Right now I'm not sure it's
> possible to have DAPC groups with samples colored by some specific variable.
> Perhaps Thibaut will be able to chime in. If I'm right, this is something we
> could think about in the upcoming releases.
>
> In the mean time, you can construct your own plot, taking bits and pieces
> from https://github.com/thibautjombart/adegenet/blob/master/R/dapc.R#L539
>
>
>
> Cheers,
> Roman
>
> ----
> In god we trust, all others bring data.
>> Zahtevaj IJZ na https://kurc.biolitika.si
>
> ________________________________
> From: "Lucas Veiga" <lucasfip at yahoo.com.br>
> To: "Roman Luštrik" <roman.lustrik at biolitika.si>
> Cc: adegenet-forum at lists.r-forge.r-project.org
> Sent: Thursday, October 12, 2017 2:03:35 PM
> Subject: Re: [adegenet-forum] Dots in the DAPC graphic
>
> Dear Roman,
> First, thank you for the help. Unfortunaly, apparently your command not
> worked for me. I will try explain better my situation. I work with
> phytopathology and the fungus that I work affects different crops (I have
> put in my input file .csv the crops as my populations, different crops are
> different populations). Due the migration of genotypes of the fungus between
> the crops, inside of one group formed by DAPC there are genotypes obtained
> of different crops (populations) and for better viewing of this migration I
> want to plot the dots according of the hosts and not according of the groups
> formed by DAPC analysis. So, inside of one group there will are dots of
> different colors.
> I hope have explain better my situation and that you can help me.
>
> Best regards,
> Lucas Veiga Ayres pimenta
>
>
> Em Quinta-feira, 12 de Outubro de 2017 5:49, Roman Luštrik
> <roman.lustrik at biolitika.si> escreveu:
>
>
> Map `grp` argument to your desired grouping. Make sure that you pass `col`
> the correct number of colors which should match the number of groups you are
> specifying.
> By default, coloring is done on grouping (see here). See this example:
>
> library(adegenet)
>
> data(H3N2)
> pop(H3N2) <- factor(H3N2$other$epid)
> dapc1 <- dapc(H3N2, var.contrib=FALSE, scale=FALSE, n.pca=150, n.da=5)
>
> data.frame(dapc1$grp, pop(H3N2)) # they are matching
>
> Cheers,
> Roman
>
>
>
> ----
> In god we trust, all others bring data.
>> Zahtevaj IJZ na https://kurc.biolitika.si
>
> ________________________________
> From: "Lucas Veiga" <lucasfip at yahoo.com.br>
> To: adegenet-forum at lists.r-forge.r-project.org
> Sent: Thursday, October 12, 2017 1:34:19 AM
> Subject: [adegenet-forum] Dots in the DAPC graphic
>
> Dear all,
> I would like to know what I can do for the dots in DAPC graph to be colored
> according to the populations and not according to the DAPC analysis groups?
>
> Best regards,
> Lucas Veiga Ayres Pimenta
>
> _______________________________________________
> adegenet-forum mailing list
> 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
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum


More information about the adegenet-forum mailing list