[adegenet-forum] HWE calculation

Roman Luštrik roman.lustrik at biolitika.si
Fri Mar 3 11:21:55 CET 2017


Perhaps something like this? 

library(adegenet) 
library(pegas) 

data(nancycats) 

lvls <- levels(pop(nancycats)) 
out <- vector("list", length(lvls)) # prepare list for output 
names(out) <- lvls 

for (i in lvls) { 
out[[i]] <- hw.test(nancycats[pop(nancycats) == i]) 
} 

Cheers, 
Roman 

---- 
In god we trust, all others bring data. 


From: "Felipe Hernández" <fhernandeu at uc.cl> 
To: adegenet-forum at lists.r-forge.r-project.org 
Sent: Thursday, March 2, 2017 6:04:42 PM 
Subject: [adegenet-forum] HWE calculation 

Hi everyone, 

I have used the adegenet/pegas packages to estimate HWE using a genind object. I got the results from chi-squared and exact test based on Monte Carlo for my whole set of loci (52 loci) across all my 29 populations. I wonder if there is any option to calculate HWE and get exact test Monte Carlo results, but for each population separately. Sorry if the question is so basic, but I would appreciate any helpful advice! 

Best, 
Felipe 

-- 
Felipe Hernández 
Médico Veterinario (DVM), MSc. 
PhD. Candidate 
Interdisciplinary Ecology Program 
School of Natural Resources and Environment 
Wildlife Ecology and Conservation Department 
University of Florida 

_______________________________________________ 
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/20170303/3f7f124a/attachment.html>


More information about the adegenet-forum mailing list