[adegenet-forum] Discrepancy in NA counts

Roman Luštrik roman.lustrik at biolitika.si
Mon Nov 28 08:31:07 CET 2016


can you share a (subset) of the dataset? It's hard to pinpoint where things might be going wrong without some data in hand. 


In god we trust, all others bring data. 

From: "Biz Sheedy" <biz.sheedy at gmail.com> 
To: adegenet-forum at lists.r-forge.r-project.org 
Sent: Friday, November 25, 2016 10:44:16 AM 
Subject: [adegenet-forum] Discrepancy in NA counts 

Dear All, 

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. 

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. 

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! 

Thank you, 

R version 3.3.2 
adegenet version 2.0.1 

Data: 44 individuals, diploid, 4279 loci. 

all<-read.structure("all_batch_1.stru", NA.char="0") 

Total cells in excel: 376552 
After read.structure/genepop: 44*8558=376552 

0s in excel: 3952 
0s after read.table; length(which(X==0)): 3952 
NA after read.structure/genepop; sum( is.na (all$tab)): 4008 
Difference: 56 

Subset Chichi 
Total cells: 77022 
After read.structure/genepop: 9*8558=77022 

0s in excel: 742 
NA after read.structure/genepop; sum( is.na (chi$tab)): 756 
Difference: 14 

4-1-1 Amakubo 
Department of Botany 
National Museum of Nature and Science 
Tsukuba, Ibaraki 305-0005 

biz.sheedy at gmail.com 

adegenet-forum mailing list 
adegenet-forum at lists.r-forge.r-project.org 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20161128/c1272c36/attachment.html>

More information about the adegenet-forum mailing list