[adegenet-forum] combining data

Jombart, Thibaut t.jombart at imperial.ac.uk
Wed Jun 13 17:30:27 CEST 2012


Hi there, 

it seems you have merged the data correctly together. So your results indicate that the marker 'ret' does contain some group structure as you mentioned. 

You could cross-validate these results using different approaches. One is using an AMOVA using 'ret' as a factor, I expect that the group differentiation will be significant. See function 'amova' in pegas (if I remember well).

Another option (not as satisfying, but quick) is to look for two clusters using find.clusters, and compare the obtained clusters to 'ret' (as a factor). This can be done using 'table( first_group, secondgroup).

Cheers

Thibaut


________________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Vinson Doyle [sonofvin at gmail.com]
Sent: 12 June 2012 19:28
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] combining data

Dear Thibaut,

I have a situation with which I am bit confused.  I have 8 microsatellite loci
typed for a haploid organism.  I also have a retrotransposon-based marker
allowing me to recognize two different types of individuals in the populations.
If I code these two states with 3-digit codes "100" and "200" so as to combine them
with the microsatellite alleles, I use read.table to import the data:

>A<-read.table("populations.tab")
>A[1:5]
            Ret L10D10 L14F4 L2C1 LB5B4 LC192 LC2090 LC4168 LF9 Pop
103-M   200    278   325  217   366   305    349    220 284   M
105-M    100    276   321  217   366   286    349    220 284   M
108-M    200    278   321  215   366   286    349    220 284   M
1414-M   200    276   321  215   366   311    366    220 284   M
540-M    100    278   321  215   366   305    349    220 286   M


I convert this to a genind object and perform a PCA:

>NineLocusRegion<-df2genind(A[,-10], sep=NULL, ncode=3, pop=as.factor(A[,10]),ploidy=1, type="codom")

>obj <- na.replace(NineLocusRegion, method = "mean")
>pca1<-dudi.pca(obj$tab,cent=TRUE,scale=FALSE,scannf=FALSE, nf=3)
>barplot(pca1$eig[1:50],main="Eigenvalues")
>s.class(pca1$li,obj$pop,lab=obj$pop.names,sub="PCA1-2", csub=2)
>title("PCA of Regional Data\naxes 1-2")
>add.scatter.eig(pca1$eig[1:20],nf=3,xax=1,yax=2,posi="bottom")

> truenames(obj)$tab[1:5,1:10]
               Ret.100   Ret.200 L10D10.233 L10D10.235 L10D10.241 L10D10.243 L10D10.249 L10D10.251 L10D10.274 L10D10.276
103-M                 0         1          0          0          0          0          0          0          0          0
105-M                1         0          0          0          0          0          0          0          0          1
108-M                 0         1          0          0          0          0          0          0          0          0
1414-M                0         1          0          0          0          0          0          0          0          1
540-M                 1         0          0          0          0          0          0          0          0          0


The points on the plot do not cluster by population as expected.  However, they do seem to cluster on the plot by 1st column; the retrotransposon marker.  I figured this out using locator().  Confirmed by the fact that there is no clustering when this marker is removed.

Is there a problem with combining these data  in adegenet for PCA or any other analyses?

Thanks,
V


More information about the adegenet-forum mailing list