[adegenet-forum] adegenet-forum Digest, Vol 76, Issue 7

Zhian Kamvar zkamvar at gmail.com
Fri Dec 12 17:09:14 CET 2014


Hello,

To run a mantel test, the matrices need to be the same size. Dgen in this case, is the distance between populations (not samples). If you have an xy coordinate for each sample, then Dgeo will be much larger than Dgen. If you want to do a mantel test utilizing these distances, you have two options:

1. Calculate Dgen as an individual-based distance.
2. Find the average geographic coordinate for each population and construct Dgeo from those coordinates.

Hope that helps,
Zhian


> Date: Fri, 12 Dec 2014 05:16:01 +0000
> From: "Yadav-Pauletti, Sunita (yadavps)" <yadavps at mail.uc.edu>
> To: "adegenet-forum at lists.r-forge.r-project.org"
> 	<adegenet-forum at lists.r-forge.r-project.org>
> Subject: [adegenet-forum] question regarding error for mantel.randtest
> Message-ID:
> 	<DM2PR01MB495FAB95BF97211709422BAF9600 at DM2PR01MB495.prod.exchangelabs.com>
> 	
> Content-Type: text/plain; charset="us-ascii"
> 
> Hello,
> 
> I would like to test isolation by distance in my dataset and have tried the following code:
> 
> genfile <- read.genalex(filepath, ploidy=2, geo=TRUE, region=FALSE)   #read file
> toto <- genind2genpop(genfile,miss="0")
> Dgen <- dist.genpop(toto,method=2)
> Dgeo <- dist(genfile$other$xy, method="euclidean")
> object.size(Dgen)
> object.size(Dgeo)
> ibd <- mantel.randtest(Dgen,Dgeo)
> ibd
> 
> The data file (genfile) is in a GenAlEx format. However, I get the following error; I think it is related to the size of matrices for Dgen and Dgeo but I am unsure why the sizes would be off, is there something wrong with the code above (I got it from the adegenet tutorials)?
> 
>> Error in mantel.rtest(Dgen, Dgeo) : Non convenient dimension
> 
> Thank you for your help.
> 
> Sunita Y.
> Ph.D. Student
> Univ. of Cincinnati, OH
> 
> 
> ------------------------------
> 
> _______________________________________________
> 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
> 
> End of adegenet-forum Digest, Vol 76, Issue 7
> *********************************************



More information about the adegenet-forum mailing list