probelm with missing data when using the function read.genalex

389 views
Skip to first unread message

Luigi Pontieri

unread,
Jul 13, 2015, 4:48:01 PM7/13/15
to po...@googlegroups.com
Dear poppr users,

I recently start to use the poppr package as I found very appealing the possibility to create genind objects by using as input files .csv created in genAlex.
I created a .csv file (attached) consisting of microsatellites data on 95 populations surveyed at 4 loci. Alleles have 3-digit code. Missing data are scored as "0" (as genAlex tutorial suggest to score missing data).

The problem arise when I try to load the input file in poppr using the line DATA=read.genalex (filename, quiet=T)
When I run the function info_table(DATA) to check for number of missing data, the function reports that there are none (indeed, after checking, the zero values are replaced with "NA" when the file is imported).

I don't know where the problem lies. I checked whether the file was properly comma delimited and it looks like. I also tried to export the "nancycats" dataset included in the package adegenet as genAlex using the function genind2genalex, and then importing this newly created .cvs files back into R with the read.genalex function. Well..the missing data present in the nancycats genind object are not there anymore if I import it with the read.genalex function. 
It appears there is something wrong in the way the genind object code the missing data when the input file is loaded with the read.genalex function.
Or it might be a more trivial problem, due to my incapability of seeing a very simple mistake in my file.

I would be really glad if someone could help me with this issue.

Thanks in advance for your time  
New combined data.csv

Zhian Kamvar

unread,
Jul 13, 2015, 4:54:13 PM7/13/15
to po...@googlegroups.com, luigi.po...@gmail.com
Hello,

We caught the bug at the same time, it appears. I have fixed it on the master branch of the github repository. I have also posted a patch at https://gist.github.com/zkamvar/b64078a0d04d2452c905

You can either download it and use source("poppr_patches.R") or you can use devtools to install directly from the internet:

devtools::source_gist("https://gist.github.com/zkamvar/b64078a0d04d2452c905", 
                      
sha1 = "74ff482c9832237092ffb29a5955ee68b255005f")

You can also install the development version if you have a C compiler:

devtools::install_github("grunwaldlab/poppr")

I'm sorry for the inconvenience. Hope that helps!

Cheers,
Zhian
Reply all
Reply to author
Forward
0 new messages