[adegenet-forum] 'removing loci with a logical' & 'n.pca for DAPC'

Frederik Van den Broeck Frederik.VandenBroeck at bio.kuleuven.be
Wed Mar 21 10:57:26 CET 2012


I'm using Adegenet to do some population genomic analyses on a dataset of around 30.000 SNPs. I've read the data into a genind object from a genepop file. For get a first idea of the data, I used the function summary and compared Hobs with Hexp

d.genind <- read.genepop("filt.popgen.gen")

summary <- summary(d.genind)

barplot(summary$Hexp - summary$Hobs)

Here I see that some loci have much higher Hobs than Hexp; so I plotted a qqplot to get a better picture:


Here I see that I have loci for which Hobs is larger than 0.5, which is not possible. In the next step, I would therefore like to remove loci that have a Hobs larger than 0.5, but I don't know how. The most easy would be to state a logical, something that states 'remove all loci that have Hobs larger then 0.5'. But I don't know how to do this. Is this possible for genind objects? And if so, how?

I know that keeping loci into the genind object can be done by (if you have a list of loci names):


But how can one easily remove loci from a genind object? Putting a minus '-' before c() returns an error.

Finally I had a question about DAPC. It is possible to state the number of axis for PCA (n.pca). However, adding more and more axis increases the power to discriminate the populations. How can one know how many axis to add? If you add not enough axis, than you will see no structure. If you add to much, then it looks like you have been overseperating the populations.

Thank you very much for your answers.


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

More information about the adegenet-forum mailing list