<div dir="ltr">Thanks for the tip, <div><br></div><div>unfortunately using the <span style="font-size:12.8000001907349px">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 </span><span style="font-size:12.8000001907349px">is not present anymore in the new adegenet and its functionality is supposed to be replaced by pegas hwe.test?</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">If i try to run HWE.est from adegenet i get this</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><div><span style="font-size:12.8000001907349px">> HWE.test(neu)</span></div><div><span style="font-size:12.8000001907349px">Error: could not find function "HWE.test"</span></div></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">or </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><div><span style="font-size:12.8000001907349px">> HWE.test.genind(neu)</span></div><div><span style="font-size:12.8000001907349px">As of adegenet_1.5-0, this function has been removed and is replaced by 'hw.test' in the package 'pegas'</span></div></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Did anyone have the same problem?</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Cheers</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Paolo</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 5:18 PM, Vojtěch Zeisek <span dir="ltr"><<a href="mailto:vojta@trapa.cz" target="_blank">vojta@trapa.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
Dne Čt 6. srpna 2015 17:00:53, Paolo Momigliano napsal(a):<br>
<span class="">> Hi all,<br>
><br>
> i am having some real trouble with a very simple task: running hw.test from<br>
> pegas which is supposed to work with adegenet.<br>
><br>
> i tried importing my files both from genepop and fstat using the<br>
> read.genepop and read.fstat functions:<br>
><br>
> below an example code<br>
><br>
> # load libraries<br>
> library(adegenet)<br>
> library(pegas)<br>
><br>
> # import data<br>
> neu<-read.genepop("snp1.gen", ncode = 3L)<br>
<br>
</span>I use to use this function only with loci object (I use to start with pegas'<br>
read.loci function to import data), although man page says it should work also<br>
with genind. Might be You could try to convert Your genind object into loci by<br>
genind2loci function.<br>
<div><div class="h5"><br>
> # Calculate HWE for first pop<br>
> HWE_Ning<-hw.test(neu[1:23,], B=100)<br>
><br>
> at which point, i get warnings:<br>
> >There were 50 or more warnings (use warnings() to see the first 50)<br>
> ><br>
> > warnings()<br>
><br>
> Warning messages:<br>
> 1: In O - E : longer object length is not a multiple of shorter object<br>
> length<br>
> 2: In (O - E)^2/E :<br>
> longer object length is not a multiple of shorter object length<br>
> 3: In O - E : longer object length is not a multiple of shorter object<br>
> length<br>
> 4: In (O - E)^2/E :<br>
> longer object length is not a multiple of shorter object length<br>
> 5: In O - E : longer object length is not a multiple of shorter object<br>
> length<br>
> 6: In (O - E)^2/E :<br>
> longer object length is not a multiple of shorter object length<br>
> 7: In O - E : longer object length is not a multiple of shorter object<br>
> length<br>
><br>
> etc....<br>
><br>
> The hw.test function works just fine on the "nancycat" dataset from<br>
> Adegenet . But it doesn't whenever i import a dataset. I know the datasets<br>
> are not corrupted, as i have carried out a lot of other analyses in<br>
> adegenet and diveRsity and never had a problem...<br>
><br>
> This problem persists if i try to convert the genind object using the<br>
> as.loci function before running hw.test.<br>
><br>
> Do you have any suggestion?<br>
<br>
</div></div>Adegenet also has function HWE.test.genind. It works fine for me on genind<br>
objects.<br>
There is also function HWE.test in package genetics, but I haven't used it<br>
myself.<br>
<br>
> Thanks so much!<br>
><br>
> Paolo<br>
<br>
HTH,<br>
Vojtěch<br>
<br>
--<br>
Vojtěch Zeisek<br>
<a href="http://trapa.cz/en/" rel="noreferrer" target="_blank">http://trapa.cz/en/</a><br>
<br>
Department of Botany, Faculty of Science<br>
Charles University in Prague<br>
Benátská 2, Prague, 12801, CZ<br>
<a href="http://botany.natur.cuni.cz/en/" rel="noreferrer" target="_blank">http://botany.natur.cuni.cz/en/</a><br>
<br>
Institute of Botany, Academy of Science<br>
Zámek 1, Průhonice, 25243, CZ<br>
<a href="http://www.ibot.cas.cz/en/" rel="noreferrer" target="_blank">http://www.ibot.cas.cz/en/</a><br>
<br>
Czech Republic<br>
<br>_______________________________________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum" rel="noreferrer" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum</a><br></blockquote></div><br></div>