[adegenet-forum] [adegenet forum] hw.test on genind object
Paolo Momigliano
paolo.momigliano at gmail.com
Thu Aug 6 09:00:53 CEST 2015
Hi all,
i am having some real trouble with a very simple task: running hw.test from
pegas which is supposed to work with adegenet.
i tried importing my files both from genepop and fstat using the
read.genepop and read.fstat functions:
below an example code
# load libraries
library(adegenet)
library(pegas)
# import data
neu<-read.genepop("snp1.gen", ncode = 3L)
# Calculate HWE for first pop
HWE_Ning<-hw.test(neu[1:23,], B=100)
at which point, i get warnings:
>There were 50 or more warnings (use warnings() to see the first 50)
> warnings()
Warning messages:
1: In O - E : longer object length is not a multiple of shorter object
length
2: In (O - E)^2/E :
longer object length is not a multiple of shorter object length
3: In O - E : longer object length is not a multiple of shorter object
length
4: In (O - E)^2/E :
longer object length is not a multiple of shorter object length
5: In O - E : longer object length is not a multiple of shorter object
length
6: In (O - E)^2/E :
longer object length is not a multiple of shorter object length
7: In O - E : longer object length is not a multiple of shorter object
length
etc....
The hw.test function works just fine on the "nancycat" dataset from
Adegenet . But it doesn't whenever i import a dataset. I know the datasets
are not corrupted, as i have carried out a lot of other analyses in
adegenet and diveRsity and never had a problem...
This problem persists if i try to convert the genind object using the
as.loci function before running hw.test.
Do you have any suggestion?
Thanks so much!
Paolo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20150806/48889b16/attachment.html>
More information about the adegenet-forum
mailing list