[adegenet-forum] [adegenet forum] hw.test on genind object
Paolo Momigliano
paolo.momigliano at gmail.com
Thu Aug 6 09:31:20 CEST 2015
Thanks for the tip,
unfortunately using the genind2loci function to convert does not help (i
guess that does the same as as.loci?). i used the HWE.test function in
adegenet too before, yet i understand that this function is not present
anymore in the new adegenet and its functionality is supposed to be
replaced by pegas hwe.test?
If i try to run HWE.est from adegenet i get this
> HWE.test(neu)
Error: could not find function "HWE.test"
or
> HWE.test.genind(neu)
As of adegenet_1.5-0, this function has been removed and is replaced by
'hw.test' in the package 'pegas'
Did anyone have the same problem?
Cheers
Paolo
On Thu, Aug 6, 2015 at 5:18 PM, Vojtěch Zeisek <vojta at trapa.cz> wrote:
> Hi
>
> Dne Čt 6. srpna 2015 17:00:53, Paolo Momigliano napsal(a):
> > 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)
>
> I use to use this function only with loci object (I use to start with
> pegas'
> read.loci function to import data), although man page says it should work
> also
> with genind. Might be You could try to convert Your genind object into
> loci by
> genind2loci function.
>
> > # 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?
>
> Adegenet also has function HWE.test.genind. It works fine for me on genind
> objects.
> There is also function HWE.test in package genetics, but I haven't used it
> myself.
>
> > Thanks so much!
> >
> > Paolo
>
> HTH,
> Vojtěch
>
> --
> Vojtěch Zeisek
> http://trapa.cz/en/
>
> Department of Botany, Faculty of Science
> Charles University in Prague
> Benátská 2, Prague, 12801, CZ
> http://botany.natur.cuni.cz/en/
>
> Institute of Botany, Academy of Science
> Zámek 1, Průhonice, 25243, CZ
> http://www.ibot.cas.cz/en/
>
> Czech Republic
>
> _______________________________________________
> 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/20150806/ccfaf2d8/attachment-0001.html>
More information about the adegenet-forum
mailing list