[adegenet-forum] Isolation by distance with adegenet

Zhian Kamvar kamvarz at science.oregonstate.edu
Mon Nov 25 13:11:29 CET 2019


Hi Serena,

The $other$xy syntax assumes that there is a data frame in the "other" slot
of your genpop object called "xy" that contains coordinates. If you have
the coordinates in a separate file, you don't have to put it in the genpop
object, but it helps with subsetting.

That being said, it looks like you are getting an error where the genetic
distance you are calculating isn't returning a distance object. If Dgeno is
a matrix, try converting it to a distance object with as.dist().

Best,
Zhian

Hello,
>
> I'am new to the mailing list. I hope I can find help here. I am trying to
> perform Isolation by Distance through mantel.randtest()  from adegenet
> package.I am working with this genepop dataset: /// GENPOP OBJECT /////////
>
>  // 1 population; 23 loci; 221 alleles; size: 41 Kb
>
>  // Basic content
>    @tab:  1 x 221 matrix of allele counts
>    @loc.n.all: number of alleles per locus (range: 4-16)
>    @loc.fac: locus factor for the 221 columns of @tab
>    @all.names: list of allele names for each locus
>    @ploidy: ploidy of each individual  (range: 2-2)
>    @type:  codom
>    @call: .local(x = x, i = i, j = j, drop = drop)
>
>  // Optional content
>    - empty -
>
> The problem is that I can't figure out how to incorporate my lat/long
> coordinates ($other$xy) in my dataset as shown in several tutorials. My
> coordinates are in a separate file and when I run the test using distances
> calculated from such dataset (e.g . dist(xy)) i get the following error: >
> #MANTEL TEST
> > ibd<-mantel.randtest(Dgen,Dgeo)
> Error in if (n != attr(m2, "Size")) stop("Non convenient dimension") :
> argument is of length zero.
>
> I am wandering whether it is possible to run this test having coordinates
> in a different files. I really hope you can hel me. Thanks in advice.
>
> Best,
> Serena
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20191125/3bee45e0/attachment.html>


More information about the adegenet-forum mailing list