[adegenet-forum] 'removing loci with a logical' & 'n.pca for DAPC'
Jombart, Thibaut
t.jombart at imperial.ac.uk
Thu Mar 22 11:47:47 CET 2012
Hello,
sorry, why is it impossible to get observed heterozygosity greater than 0.5?
http://en.wikipedia.org/wiki/Zygosity
I don't understand the following:
"
I know that keeping loci into the *genind* object can be done by (if you have a list of loci names):
d.genind[loc=c("x1","x2",etc.)]
But how can one easily remove loci from a *genind* object? Putting a minus '-' before c() returns an error.
"
Do you mean "genlight"? If so I believe this is explained in the vignette "adegenet-genomics". As for the DAPC, this is a documented topic in the vignette "adegenet-dapc".
All the best
Thibaut
________________________________________
From: adegenet-forum-bounces at r-forge.wu-wien.ac.at [adegenet-forum-bounces at r-forge.wu-wien.ac.at] on behalf of Frederik Van den Broeck [Frederik.VandenBroeck at bio.kuleuven.be]
Sent: 21 March 2012 09:57
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] 'removing loci with a logical' & 'n.pca for DAPC'
Dear,
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:
qqplot(summary$Hobs,summary$Hexp)
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):
d.genind[loc=c("x1","x2",etc.)]
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.
Sincerely,
Frederik
More information about the adegenet-forum
mailing list