[adegenet-forum] Jitter & sPCA

Roman Luštrik roman.lustrik at biolitika.si
Fri Aug 4 00:53:13 CEST 2017


As the error is reporting, you should use jitter() on your coordinates. Either specify new jittered coordinates directly to xy argument of spca(), or, jitter your genind object which you can access using `other(x)$xy`. 

Here's an example of the former approach: 

> library(adegenet) 
> data(spcaIllus) 
> x <- spcaIllus[[1]] 
> out <- spca(x, ask = FALSE, type = 1, scannf = FALSE) 
> xy <- other(x)$xy 
> newxy <- xy[rep(1:(nrow(xy)/10), length.out = nrow(xy)), ] 
> out.clumped <- spca(x, ask = FALSE, type = 1, scannf = FALSE, xy = newxy) 
Error in chooseCN(xy = xy, ask = ask, type = type, plot.nb = plot.nb, : 
Duplicate locations detected and incompatible with graph type 1-4. 
Please choose another graph (5-7) or add random noise to locations (see ?jitter). 
> out.jittered <- spca(x, ask = FALSE, type = 1, scannf = FALSE, xy = jitter(newxy)) 
> 

Cheers, 
Roman 

---- 
In god we trust, all others bring data. 
> Zahtevaj IJZ na https://kurc.biolitika.si 


From: "Carol Ann Reeb" <creeb at stanford.edu> 
To: adegenet-forum at lists.r-forge.r-project.org 
Sent: Friday, August 4, 2017 12:14:01 AM 
Subject: [adegenet-forum] Jitter & sPCA 



I'm having trouble jittering x-coordinates in order to run sPCA. I'm still learning R so I don't know what code would work in adegent. I did find R usage: Jitter(x, factor=1, amount=NULL). But that does not tell me how to call the proper files. I did find code from a supplement from a manuscript comparing MENE to sPCA comparison. And although that routine ran, the program would still not allow me to choose a network to plot sPCA coordinates because it said they were still identical in the xy file. Any help, suggestions would be greatly appreciated. 




Carol 

_______________________________________________ 
adegenet-forum mailing list 
adegenet-forum at lists.r-forge.r-project.org 
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20170804/92c3ed93/attachment.html>


More information about the adegenet-forum mailing list