[adegenet-forum] Between group PCA with genlight object

Thiho Jules thjnant at gmail.com
Mon Jan 14 13:52:23 CET 2013


Hello,

I have a genlight object (the genlight object has been created with 
plink.raw file using the command "recodeA", I want to use the functions 
"dudi.pca" and "bca" to perform a between group PCA.

I have received this code from Valeria to replace the missing values with 0:

mydf<-lapply(your_genlight at gen, as.integer)
myrepl<-do.call(rbind, lapply(mydf, function(e) replace(e, is.na 
<http://is.na>(e), 0)))
dudi.pca(myrepl)

This code indeed works and I can perform dudi.pca and bca, but I was 
wondering whether this is correct to replace the missing values with 0 
as zero itself exists in the plink.raw for the markers with no second 
allele.

Thank you very much in advance,
Best,
Sara

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


More information about the adegenet-forum mailing list