[adegenet-forum] define population level for PCA analysis in adegenet

Didier Aurelle aurelle.didier at gmail.com
Wed Oct 11 12:08:05 CEST 2017


Dear all

I want to perform a PCA analysis in adegenet starting from a genepop file
without defined populations. I imported the data like this: datapop <-
read.genepop('tous.gen', ncode=3, quiet = FALSE)

it works, and I can perform a PCA after scaling the data. But I would like
to plot the results / individuals on the PCA axis according to their
population of origin using s.class. I have a vcf file with a three lettre
code for each individual. I imported it in R: pops_list <-
read.csv('liste_pops.csv', header=FALSE)

but now how can I use it to define population levels in the genind object
'datapop'? I tried something likes this: setPop(datapop, formula = NULL)

setPop(datapop) <- pops_list but it doesn't work; even the first line
doesn't work: I get this message: "Erreur : formula must be a valid formula
object."

And then how should I use it in s.class?

thanks

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


More information about the adegenet-forum mailing list