[adegenet-forum] Distance patches in data

Peter peter.rooney at blueyonder.co.uk
Mon Feb 3 02:50:13 CET 2014


Hi,

 

I'm very new to adegenet, and trying to determine if it is sensible to
create a distance matrix from a neighbour joining tree (njt) for
correspondence analysis with a genetic matrix.  I couldn't find any
information on this from a search of the archives.  

 

I have created a neighbour joining tree and then used it in an sPCA as
follows:

 

njt <- chooseCN(myind at other$xy,ask=FALSE,type=4) #create njt from xy

njt_ed<-edit.nb(njt,myind at other$xy,polys=rb_polys) #edit njt to insert
"barriers", creates a "forest"

myspca<-spca(myind, cn=njt_ed, scale=TRUE, type=1, plot.nb=TRUE, nfposi=40,
nfnega=40, ask=FALSE, scannf=FALSE)

 

I can now create a genetic distance matrix from the microsatellite data:

dg<-dist(myind$tab)

 

However, I don't know how to create a distance matrix for the individuals
based on the edited neighbour joining tree, rather than the xy coordinates
(as in the tutorial) or the results of the sPCA which also represent genetic
variation.  I want to compare distances for individuals based on the njt
"forest", so that I can compare them, e.g.:

 

plot(dg,?? geographic distance matrix using njt ??)

 

Perhaps it would be more sensible to use a different type of connection
network?

 

If anyone can help I'd be very grateful, thanks.

 

Peter

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20140203/31756b70/attachment.html>


More information about the adegenet-forum mailing list