[adegenet-forum] interpolation in contour plots of spca

Colin Garroway colin.garroway at gmail.com
Tue Jul 7 17:34:50 CEST 2009


Hello Thibaut and List,

I have a few questions regarding plotting and interpreting an spca.  Our
data set consists of georeferenced individuals unevenly sampled in space and
genotyped at nuclear microsatellite loci.  Because the samples are unevenly
distributed I chose the inverse distance connection network (option 7).   We
have a few interpretable global axes and for our situation the contour plot
with s.image seems to be a nice display.  The code I have used for the
following questions is pasted below the main body of the text.

My main question is how is empty space interpolated in this plot (s.image)
and can I alter the method if needed?  I am getting some peripheral contours
where there is no data which may be expected depending on how the data are
being interpolated.  I can "fix" this by increasing the value for the "span"
argument (degree of smoothing) from the default of 0.5 but I am not entirely
clear what the "span" argument is actually altering.  Would increasing span
be generally appropriate given that I have unevenly distributed samples and
I am looking at global axes of variation?  As I alter span the plot
certainly changes.  For a given sample size and scheme, is there a rule of
thumb to choose the most 'honest' span value for this type of plot with
genetic data?

My next question involves adding individual samples to the plot.  I suspect
this is easy but I'm stuck.  I have plotted the figure on a map outline of
the area (using the area argument) but can't seem to plot individuals on the
map.

I understand that all of my questions can be handled in a GIS but I am
interested in learning the R way.

Thanks very much for any help.

Colin


library(adegenet)
library(ade4)
library(adehabitat)
library(rgdal)

##Reads genetic and location data
ds1<-read.structure("APPHybridFinalJune2009sPCAInput.stru", n.ind=217,
n.loc=12,  onerowperind=T, col.lab=1, col.pop=2, col.others=0,
row.marknames=0, NA.char="-9", missing=NA, ask=TRUE, quiet=FALSE)

xy<-read.table("xy.txt", header = T)

##Reads in shape file and converts it to area object
ont<-readOGR("C:\\Documents and Settings\\Colin\\Desktop\\Wolf", "ONTARIO")

areaont<-spol2area(ont)

##Performs and plots spca on shape file

mySpca2 <- spca(ds1, type = 7, ask = FALSE, scannf = FALSE, xy = xy, nfposi
= 8, nfnega = 8)

s.image(xy,mySpca2$li[,1], include.ori = FALSE, grid = F, kgrid = 30, cgrid
= 0, sub = "1st global axis", csub = 1.25, possub = "topleft", area =
areaont)






-- 
Colin Garroway (PhD candidate)
Wildlife Research and Development Section
Ontario Ministry of Natural Resources
Trent University, DNA Building
2140 East Bank Drive
Peterborough, ON, K9J 7B8
Canada

http://colin.garroway.googlepages.com/home
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20090707/9a4c9b0e/attachment.htm 


More information about the adegenet-forum mailing list