[adegenet-forum] PCA and DAPC

Jombart, Thibaut t.jombart at imperial.ac.uk
Tue Nov 23 16:17:31 CET 2010


Dear Roy, 

No, basically s.class does not allow for specifying different pch. Here is a workaround:
###
data(sim2pop)
pca1=dudi.pca(sim2pop,scannf=FALSE)
f=pop(sim2pop)
mypch <- mycol <- f
levels(mypch)=c(18,1)
levels(mycol)=c("blue","red")
mypch=as.integer(as.character(mypch))
mycol=as.character(mycol)
s.class(pca1$li,f, cpoint=0, col=c("blue","red"))
par(xpd=TRUE)
points(pca1$li, pch=mypch, col=mycol)
### 

I have just implemented this feature along with others in the DAPC scatterplot. There is now a pch argument, taking one value per group (recycled if necessary). It will be part of the devel version in a few hours, and a patch will also be available at about the same time.

As for hiding some populations, I really encourage you to avoid doing so. Hiding some observations that participate to the analysis is basically twisting the results of the analysis. Moreover, it is easy to remove some unwanted populations beforehand.

For now there is no tutorial on DAPC, but please look at the help pages of the functions dapc and find.clusters. All illustrations from the DAPC paper are basically reproduced in adegenet. See also datasets dapcIllus, H3N2 and eHGDP.

Best regards

Thibaut


--
######################################
Dr Thibaut JOMBART
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - Faculty of Medicine
St Mary’s Campus
Norfolk Place
London W2 1PG
United Kingdom
Tel. : 0044 (0)20 7594 3658
t.jombart at imperial.ac.uk
http://sites.google.com/site/thibautjombart/
http://adegenet.r-forge.r-project.org/

________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] On Behalf Of Roy Francis Mathew [RoyFrancis.Mathew at agrsci.dk]
Sent: 23 November 2010 11:02
To: adegenet-forum at lists.r-forge.r-project.org
Subject: Re: [adegenet-forum] PCA and DAPC

Hi,
I work with diploid microsatellite data. The PCA on this data works fine.
The different populations can be given different colours.
I was wondering if the different populations could be given different pch values. I tried to work this out, but doesn’t work.
It would also be nice if some populations could be hidden for better clarity.
I have sort of succeeded at this by giving colour value 0 for the populations that I want hidden, but its not the best idea.

I have tried to use plot3d from rgl package for PCA and it gives out 3d result, but I cannot color code different populations or pch differentiate pops.

Finally I was wondering if a tutorial was made on DAPC analysis and find.clusters/assign.plot etc.
I am currently using structure, but wish to move to DAPC on R.


Kind regards
Roy Mathew Francis

Dept. of Integrated Pest Management
Faculty of Agricultural Sciences
Aarhus University
Forsøgsvej 1
DK-4200 Slagelse


Tel.: +45
Email: RoyFrancis.Mathew at agrsci.dk


Tel.: +45 8999 1900
Web: www.agrsci.au.dk

[cid:image001.jpg at 01CB8B06.4C57ACB0]


More information about the adegenet-forum mailing list