[adegenet-forum] combining data

Vinson Doyle sonofvin at gmail.com
Tue Jun 12 20:28:42 CEST 2012


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20120612/f976e414/attachment.html>


More information about the adegenet-forum mailing list