[adegenet-forum] Warning Messages when plotting spca and editing Connection Networks

Kimani Kitson-Walters kimash21 at gmail.com
Wed Feb 10 22:18:43 CET 2016


Hello All,

I'm pretty new to R and this forum. I've spent the last 2 days searching
through the archive but to no avail.

I've run an spca on my data which includes 5 populations with fragment
sizes for 9 microsatellite loci. Each population has between 22 and 39
individuals. The xy coordinates for the 5 populations has been loaded to
the "other" slot the genepop file containing my data. I however keep
getting warning messages and I haven't been able to figure out why. I've
been trying to wrap my head around statistics and R for a while now and I'm
making some improvements but this one has me stumped. There are two issues:

1. I'm trying to edit the connection network using edit.nb but R keeps
aborting and restarts the session when I begin to interact with the graph
to select the connection I want to delete.

spca<- spca(obj, edit.nb=TRUE)

2.The spca runs without a hitch when I use spca(). The problem is that I
get the warning messages when I plot it using plot (spca). I have also run
the Global and Local tests as well before I plot the spca the result.
Below is the script I use and the resulting errors:

> spca <- spca(obj)

Choose a connection network:
Delaunay triangulation (type 1)
Gabriel graph (type 2)
Relative neighbours (type 3)
Minimum spanning tree (type 4)
Neighbourhood by distance (type 5)
K nearest neighbours (type 6)
Inverse distances (type 7)
Answer:
2 - Gabriel graph

Keep this graph (y/n)?
y
Select the first number of axes (>=1):
1
Select the second number of axes (>=0):
2

[image: pasted1]

> X<- scaleGen(obj)###Gets rid of missing data
>
> myGtest <- global.rtest(X,spca$lw,nperm=50000)###Runs global stats
> myGtest
Monte-Carlo test
Call: global.rtest(X = X, listw = spca$lw, nperm = 50000)

Observation: 0.2588172

Based on 50000 replicates
Simulated p-value: 0.647667
Alternative hypothesis: greater

     Std.Obs  Expectation     Variance
-0.445824651  0.266881510  0.000327198
> plot(myGtest)
> myLtest <- local.rtest(X,spca$lw,nperm=50000)###Runs local Stats
> myLtest
Monte-Carlo test
Call: local.rtest(X = X, listw = spca$lw, nperm = 50000)

Observation: 0.2573817

Based on 50000 replicates
Simulated p-value: 0.7091858
Alternative hypothesis: greater

      Std.Obs   Expectation      Variance
-0.6498182785  0.2675756071  0.0002460908

plot(spca)
[image: pasted2]
Warning messages:
1: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  span too small.   fewer data values than degrees of freedom.
2: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  pseudoinverse used at -151.9 50.468
3: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  neighborhood radius 3.8482
4: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  reciprocal condition number  0
5: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  There are other near singularities as well. 14.477
6: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  Chernobyl! trL>n 3.5458
7: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,
 :
  Chernobyl! trL>n 3.5458

I hope you'll be able to help me or direct me to some help. I'm a strict
biologist and this is my first plunge into spatial genetic analysis.

Thanks
-- 


Mr. Kimani Kitson-Walters BSc (Hons)
Smithsonian Link Fellow 2015
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160210/14f807c0/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pasted1
Type: image/png
Size: 8694 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160210/14f807c0/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pasted2
Type: image/png
Size: 24145 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160210/14f807c0/attachment-0003.png>


More information about the adegenet-forum mailing list