<div dir="ltr"><div><div><div><div><div>Dear All,<br><br></div>I am trying to read SNP data from Stacks into adegenet. I have tried read.structure and read.genepop but they both give (the same) NA counts that are higher than expected. Using read.table on the structure-formatted file (with "ind" and "pop" inserted into the first two columns of row one) gave the expected number of missing data. <br><br>I looked at a single population subset (both the original and the converted data) in excel and found a locus where in the original data, all nine individuals were "3", but in the converted data one individual was "NA". The loci before and after this one both matched/were correct.<br><br>I am not sure what I have missed for this to happen, my R skills are beginner at best. Any help with reading the data in correctly would be greatly appreciated!<br></div><div><br>Thank you,<br></div><div>Elizabeth<br></div><div><br><br></div>R version 3.3.2<br>adegenet version 2.0.1<br><br></div><div>Data: 44 individuals, diploid, 4279 loci.<br></div><div><br></div>all<-read.structure("all_batch_1.stru", NA.char="0")<br><br>Total cells in excel: 376552<br></div><div>After read.structure/genepop: 44*8558=376552<br></div><div><br></div><div>0s in excel: 3952<br></div><div>0s after read.table; length(which(X==0)): 3952<br></div><div>NA after read.structure/genepop; sum(<a href="http://is.na">is.na</a>(all$tab)): 4008<br></div><div>Difference: 56<br></div><div><br></div><div>Subset Chichi<br></div><div>Total cells: 77022<br></div><div>After read.structure/genepop: 9*8558=77022<br></div><div><br></div><div>0s in excel: 742<br></div>NA after read.structure/genepop; sum(<a href="http://is.na">is.na</a>(chi$tab)): 756<br></div>Difference: 14<br><div><div><div><span style="color:rgb(0,153,0);font-weight:bold"></span><br><br><br><span style="color:rgb(0,153,0);font-weight:bold"></span><div><div><div><div><div>-- <br><div class="gmail_signature"><div dir="ltr"><div>4-1-1 Amakubo<br></div><div>Department of Botany<br></div><div>National Museum of Nature and Science<br></div><div>Tsukuba, Ibaraki 305-0005<br></div><div>Japan<br><br></div><div><a href="mailto:biz.sheedy@gmail.com" target="_blank">biz.sheedy@gmail.com</a><br></div></div></div>
</div></div></div></div></div></div></div></div></div>