<div dir="ltr">Hi Melanie, <div><br></div><div>it's quite hard to tell without seeing the data, but yes, my suspicion is the same as yours, NAs are the culprits. Entirely non-typed loci are normally removed from genind objects during their construction, but it is still possible that for some groups in your data, some loci are entirely missing. </div><div><br></div><div>Given how many SNPs you have, you can probably afford to remove loci with many missing data (just make sure you don't end up throwing too much away). propTyped(..., by = "loc") may be your friend here. Here's an example using microbov:</div><div><br></div><div><br></div><div><div>> data(microbov)</div><div><br></div><div>> propTyped(microbov, by = "loc")</div><div> INRA63 INRA5 ETH225 ILSTS5 HEL5 HEL1 INRA35 ETH152 </div><div>0.9914773 0.9786932 0.9914773 0.9673295 0.9786932 0.9914773 0.9829545 0.9573864 </div><div> INRA23 ETH10 HEL9 CSSM66 INRA32 ETH3 BM2113 BM1824 </div><div>0.9644886 0.9943182 0.9701705 0.9886364 0.9687500 0.9829545 0.9914773 0.9900568 </div><div> HEL13 INRA37 BM1818 ILSTS6 MM12 CSRM60 ETH185 HAUT24 </div><div>0.9772727 0.9815341 0.9588068 0.9446023 0.9744318 0.9730114 0.9275568 0.9872159 </div><div> HAUT27 TGLA227 TGLA126 TGLA122 TGLA53 SPS115 </div><div>0.9914773 0.9914773 0.9914773 0.9914773 0.9531250 0.9701705 </div><div><br></div><div>> to_keep <- propTyped(microbov, by = "loc") > .99 # i.e. less 1% missing data </div><div><br></div><div>> to_keep<br></div><div> INRA63 INRA5 ETH225 ILSTS5 HEL5 HEL1 INRA35 ETH152 INRA23 ETH10 </div><div> TRUE FALSE TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE </div><div> HEL9 CSSM66 INRA32 ETH3 BM2113 BM1824 HEL13 INRA37 BM1818 ILSTS6 </div><div> FALSE FALSE FALSE FALSE TRUE TRUE FALSE FALSE FALSE FALSE </div><div> MM12 CSRM60 ETH185 HAUT24 HAUT27 TGLA227 TGLA126 TGLA122 TGLA53 SPS115 </div><div> FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE FALSE </div><div><br></div><div>> x <- microbov[loc = to_keep]</div><div><br></div><div>> nLoc(x)</div><div>[1] 10</div><div><br></div><div>> nLoc(microbov)</div><div>[1] 30</div><div><br></div></div><div><br></div><div>This is just an illustration - this dataset actually has little in terms of missing data. In your case you probably want to play with the threshold (99% non-NA is likely an overkill). </div><div><br></div><div>Cheers</div><div>Thibaut</div><div> </div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div><div><br>--<br>Dr Thibaut Jombart</div><div style="font-size:small">Lecturer, Department of Infectious Disease Epidemiology, Imperial College London</div></div><div><span style="font-size:12.8px">Head of RECON: </span><span style="font-size:12.8px"><a href="http://repidemicsconsortium.org" target="_blank">repidemicsconsortium.org</a></span><br></div></div><div><a href="http://sites.google.com/site/thibautjombart/" style="font-size:12.8px" target="_blank">sites.google.com/site/thibautjombart/</a><br></div><div><a href="http://github.com/thibautjombart" target="_blank">github.com/thibautjombart</a></div>Twitter: <a href="http://twitter.com/TeebzR" target="_blank">@TeebzR</a><br></div><div dir="ltr">+44(0)20 7594 3658</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 8 February 2017 at 11:14, Melanie Montes <span dir="ltr"><<a href="mailto:melaniesmontes@gmail.com" target="_blank">melaniesmontes@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px">Hello all, </div><div style="font-size:12.8px">I recently finished running fstat on my dataset of about 50 000 snps / 56 individuals, and successfully got f-statistics in return. However, when I tried to run gstat.randtest to see if the structure was significant:</div><div style="font-size:12.8px"><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">fstat.sig <-gstat.randtest(nr2014, nsim=1000)</font></span></p></div><div style="font-size:12.8px">...I got 50+ warnings like this:</div><div style="font-size:12.8px"><font face="monospace, monospace"><br></font></div><div style="font-size:12.8px"><font face="monospace, monospace">50: In max(y, na.rm = TRUE) : no non-missing arguments to max; returning -Inf</font><br></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">and my results file looked like this:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">> fstat.sig </font></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">Monte-Carlo test</font></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">Call: gstat.randtest(x = nr2014, nsim = 1000)</font></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">Observation: 0 </font></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">Based on 1000 replicates</font></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><font face="monospace, monospace">Simulated p-value: 1 </font></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1"><br></span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1">which leads me to suspect that it did not work. Does this have something to do with the missing data in my dataset? Sorry if this is a naive question, I am an R novice. </span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1">Thanks for your time and the awesome package, I've been using it a lot! </span></p><p class="m_-628742087000702720gmail-m_-6642637731580746140gmail-p1"><span class="m_-628742087000702720gmail-m_-6642637731580746140gmail-s1">Sincerely, </span></p></div><span class="HOEnZb"><font color="#888888"><div><div class="m_-628742087000702720gmail_signature"><div dir="ltr"><span style="font-size:12.8px">Melanie</span></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
adegenet-forum mailing list<br>
<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.<wbr>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-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/adegenet-forum</a><br></blockquote></div><br></div>