[adegenet-forum] Any suggestions about conducting a 3-D sPCA?

Kelvin Gorospe kgorospe at hawaii.edu
Tue Jan 15 22:21:48 CET 2013


Hi Thibaut,

Thanks for the insight and also for authoring adegenet! I'm wondering,
however, if Euclidean distances between x,y,z coordinates will solve the
problem of depth and space being confounded. I'm mainly interested to see
whether or not there is a genetic cline with regards to depth after
controlling for (or filtering out?) the autocorrelation due to spatial
distances. Due to the geometry of my reef (i.e., a symmetrical, underwater
mound), corals on opposite sides of the reef (diameter of 40m) have the
same depth (depth only ranges between about 1 and 4m) but based on a
Connectivity Network of Euclidean distances, would still be highly
separated... I wonder if there is a way to give extra weight to depth
distances without being too arbitrary about it... Or am I thinking about
this the wrong way?

Nevertheless, I will certainly try your suggestion. And if there are any
other suggestions out there, I'd be happy to hear about them...

Thanks again!
-Kelvin


On Tue, Jan 15, 2013 at 8:29 AM, Jombart, Thibaut
<t.jombart at imperial.ac.uk>wrote:

>
> Hello,
>
> theoretically yes, it is perfectly possible to perform a sPCA in 3D. In
> practice, the issue will be getting a matrix of connectivity between
> locations. The general approach is
>
> 1) compute Euclidean distances between locations in the 3D space
> 2) use these distances to define a graph of neighbouring sites (such as
> options 5 or 7 in chooseCN)
> 3) use this graph as input in the sPCA
>
> Step 1 is easy. Just load a x,y,z matrix in R (with x,y,z in column), say
> in an object matXYZ, and then:
> ##
> D <- dist(matXYZ)
> ##
>
> Step 2 is not implemented in chooseCN, or the subroutines it calls from.
> One can do this manually. If you want to define neighbours based on
> distances in the 3d space (neighbours are distant by less than dMax):
> ##
> dMax=quantile(D, .25) # 25% quantile is perfectly arbitrary
> M <- 1* (as.matrix(D) < dMax) # non-standardized matrix of connectivity
> (1:neighbours; 0: otherwise)
> W <- prop.table(M,1) # this is your spatial weighting matrix
> ##
>
> Then you can use sPCA with the argument matWeight=W, and here you go.
>
> Cheers
>
> Thibaut
>
> ps: if anyone has any knowledge of 3D-based connectivity graphs, that'd
> still be useful
>
>
> ________________________________________
> From: adegenet-forum-bounces at lists.r-forge.r-project.org [
> adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Kelvin
> Gorospe [kgorospe at hawaii.edu]
> Sent: 15 January 2013 17:54
> To: adegenet-forum at lists.r-forge.r-project.org
> Subject: [adegenet-forum] Any suggestions about conducting a 3-D sPCA?
>
> Hi everyone,
>
> For my PhD dissertation, I have sampled and mapped (x,y coordinate) every
> individual coral (n=2352) of one species within a single, circular coral
> reef. They are all genotyped at 6 micro satellite loci. I also have depth
> information for each individual coral.
>
> I did some analyses previously and found spatial autocorrelation in the
> genetic data. Furthermore, I found that in addition to this x,y spatial
> autocorrelation, there is also spatial autocorrelation with regards to
> depth (using just a single z coordinate) in the genetic data.
>
> Originally, I was conducting sPCA in R to do some exploratory analysis on
> the genetic data vs the x,y coordinates, in hopes of visualizing how
> genetic diversity was spatially structured and then comparing this to my
> maps of depth for the reef. However, I am wondering if I am approaching
> this the wrong way. Instead of treating depth as an environmental variable,
> is it better to conduct an sPCA using depth as a single spatial coordinate?
> And then look to see if there is a genetic cline along this
> single-coordinate system?
>
> Or is it better (or even possible) to do a 3-dimensional sPCA using all
> three coordinates together (x,y, depth)? Has anyone ever attempted this?
> The reef is essentially shaped like an underwater hill or mound, such that
> the shallow sites are in the middle of the reef, and deeper sites are on
> the outer slopes or edges. Thus, some corals with similar depths are found
> on opposite sides of the reef, while others are found next to each other on
> the same side of the reef. If I am interested in exploring a genetic cline
> that is partitioned by both space (x,y) and depth (z), then corals on
> opposite sides of the reef are "connected" in terms of their depth, while
> those on the same side of the reef are "connected" by both space and depth.
> Given that, does anyone have any suggestions regarding what connection
> network would be best?
>
> Any thoughts you might have would be greatly appreciated!
>
> Thanks for your time and I look forward to hearing from you soon.
>
> -Kelvin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20130115/a8476829/attachment.html>


More information about the adegenet-forum mailing list