[adegenet-forum] Dealing with "Duplicate" Locations

Maile C Neel mneel at umd.edu
Sat Oct 22 20:29:03 CEST 2016


I am having the same problem described in the link below in which duplicate
locations are erroneously identified when I try to create a CN object using
chooseCN in adegenet 2.0.1 to implement Monomonier's algorithm.

http://lists.r-forge.r-project.org/pipermail/adegenet-forum/
2011-October/000427.html

I could not find how the previous thread was resolved despite extensive
searching. Apologies if it was in the archives and I missed it.

I call chooseCN using the following command for which my genind object
holds genetic and spatial data for 374 unique genotypes at unique
locations.  The minimum distance between nearest neighbors is 5 m. The
(admittedly non-reproducible) code I use is

hudnet <- chooseCN(hudson_noreps.ind$other$latlong, ask=FALSE, type=1)

Although all my locations are in fact unique, checking my data with tableXY
and sunflowerplot as suggested in the old thread show me that many unique
locations are being pooled due to rounding.  Even with jittering with
default settings (which I don't really want to do) duplicates remain. I do
not want to delete the close individuals because they contribute to the
local estimates of genetic diversity.

The thread indicates it is possible to alter the function chooseCN to force
it to pass the proper argument to tableXY.  The minimum distances appear to
be adjusted in lines 91 & 92 in the code for the chooseCN function at GitHub
<https://github.com/cran/adegenet/blob/master/R/chooseCN.R>:

91 d2min <- max(apply(tempmat, 1, function(r) min(r[r>1e-12])))
92 d2min <- d2min * 1.0001 # to avoid exact number problem

Rounding to 1.0001 is collapsing samples that are 7-10 m apart given my
latitude, which makes many of my samples ~5 m apart appear to be
identical. Is there some way for me to modify this code in chooseCN to
prevent the rounding of my spatial coordinates? I think it is not something
I can modify on my own.  Are there other workarounds or solutions?

I understand the problem with duplicate locations, but is there a minimum
distance that is acceptable for the algorithms that based on connection
networks?

Thanks in advance,

Maile Neel
Associate Professor; Director of the Norton-Brown Herbarium
University of Maryland
Department of Plant Science and Landscape Architecture &
Department of Entomology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20161022/d0b8e25f/attachment.html>


More information about the adegenet-forum mailing list