EricArcher / strataG

strataG is a toolkit for haploid sequence and multilocus genetic data summaries, and analyses of population structure.
25 stars 12 forks source link

incorrect result for gtypes2genind #3

Closed zkamvar closed 8 years ago

zkamvar commented 8 years ago

I noticed a bug in gtypes2genind where the ids and strata columns are being incorporated as loci in the genind object:

library('strataG')
library('magrittr')
data(msats.g)
msats.g %>% gtypes2genind() %>% locNames()
## [1] "ids"    "strata" "D11t"   "EV37"   "EV94"   "Ttr11"  "Ttr34" 

Here's my session info:

Session info -------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.3.0 (2016-05-03)
 system   x86_64, darwin13.4.0        
 ui       RStudio (0.99.1172)         
 language (EN)                        
 collate  en_US.UTF-8                 
 tz       America/Los_Angeles         
 date     2016-05-06                  

Packages -----------------------------------------------------------------------------------
 package      * version     date       source                                  
 abind          1.4-3       2015-03-13 CRAN (R 3.2.0)                          
 acepack        1.3-3.3     2014-11-24 CRAN (R 3.2.0)                          
 ade4         * 1.7-4       2016-03-01 CRAN (R 3.2.3)                          
 adegenet     * 2.0.2       2016-04-29 Github (thibautjombart/adegenet@e61bc06)
 ADGofTest      0.3         2011-12-28 CRAN (R 3.2.0)                          
 ape          * 3.4-0.3     2016-02-23 local                                   
 apex         * 1.0.2       2016-03-31 CRAN (R 3.2.4)                          
 assertthat     0.1         2013-12-06 CRAN (R 3.2.0)                          
 boot           1.3-18      2016-02-23 CRAN (R 3.2.3)                          
 chron          2.3-47      2015-06-24 CRAN (R 3.2.0)                          
 cluster        2.0.4       2016-04-18 CRAN (R 3.3.0)                          
 coda           0.18-1      2015-10-16 CRAN (R 3.2.0)                          
 colorspace     1.2-6       2015-03-11 CRAN (R 3.2.0)                          
 copula         0.999-14    2015-10-26 CRAN (R 3.2.0)                          
 data.table     1.9.6       2015-09-19 CRAN (R 3.2.0)                          
 DBI            0.4         2016-05-02 CRAN (R 3.2.5)                          
 deldir         0.1-12      2016-03-06 CRAN (R 3.2.4)                          
 devtools       1.11.1      2016-04-21 CRAN (R 3.3.0)                          
 digest         0.6.9       2016-01-08 CRAN (R 3.2.3)                          
 dplyr          0.4.3       2015-09-01 CRAN (R 3.2.0)                          
 fastmatch      1.0-4       2012-01-21 CRAN (R 3.2.0)                          
 foreign        0.8-66      2015-08-19 CRAN (R 3.2.0)                          
 Formula        1.2-1       2015-04-07 CRAN (R 3.2.0)                          
 gdata          2.17.0      2015-07-04 CRAN (R 3.2.0)                          
 ggplot2        2.1.0       2016-03-01 CRAN (R 3.2.3)                          
 gmodels        2.16.2      2015-07-22 CRAN (R 3.2.0)                          
 goftest        1.0-3       2015-07-03 CRAN (R 3.2.0)                          
 gridExtra      2.2.1       2016-02-29 CRAN (R 3.2.4)                          
 gsl            1.9-10.1    2015-12-02 CRAN (R 3.2.3)                          
 gtable         0.2.0       2016-02-26 CRAN (R 3.2.3)                          
 gtools         3.5.0       2015-05-29 CRAN (R 3.2.0)                          
 Hmisc          3.17-4      2016-05-02 CRAN (R 3.3.0)                          
 htmltools      0.3.5       2016-03-21 CRAN (R 3.2.4)                          
 httpuv         1.3.3       2015-08-04 CRAN (R 3.2.0)                          
 igraph         1.0.1       2015-06-26 CRAN (R 3.2.0)                          
 lattice        0.20-33     2015-07-14 CRAN (R 3.2.0)                          
 latticeExtra   0.6-28      2016-02-09 CRAN (R 3.2.3)                          
 LearnBayes     2.15        2014-05-29 CRAN (R 3.2.0)                          
 magrittr       1.5         2014-11-22 CRAN (R 3.2.0)                          
 mapdata        2.2-6       2016-01-14 CRAN (R 3.2.3)                          
 maps           3.1.0       2016-02-13 CRAN (R 3.2.3)                          
 MASS           7.3-45      2015-11-10 CRAN (R 3.2.2)                          
 Matrix         1.2-6       2016-05-02 CRAN (R 3.3.0)                          
 memoise        1.0.0       2016-01-29 CRAN (R 3.2.3)                          
 mgcv           1.8-12      2016-03-03 CRAN (R 3.2.4)                          
 mime           0.4         2015-09-03 CRAN (R 3.2.0)                          
 munsell        0.4.3       2016-02-13 CRAN (R 3.2.3)                          
 mvtnorm        1.0-5       2016-02-02 CRAN (R 3.2.3)                          
 nlme           3.1-127     2016-04-16 CRAN (R 3.3.0)                          
 nnet           7.3-12      2016-02-02 CRAN (R 3.2.3)                          
 nnls           1.4         2012-03-19 CRAN (R 3.2.0)                          
 pegas          0.9         2016-04-16 CRAN (R 3.2.5)                          
 permute        0.9-0       2016-01-24 CRAN (R 3.2.3)                          
 phangorn     * 2.0.3       2016-05-01 CRAN (R 3.2.5)                          
 plyr           1.8.3       2015-06-12 CRAN (R 3.2.0)                          
 polyclip       1.5-6       2016-04-03 CRAN (R 3.2.4)                          
 poppr        * 2.1.1.99-47 2016-05-05 local                                   
 pspline        1.0-17      2015-06-29 CRAN (R 3.2.0)                          
 quadprog       1.5-5       2013-04-17 CRAN (R 3.2.0)                          
 R6             2.1.2       2016-01-26 CRAN (R 3.2.3)                          
 RColorBrewer   1.1-2       2014-12-07 CRAN (R 3.2.0)                          
 Rcpp           0.12.4      2016-03-26 CRAN (R 3.2.4)                          
 reshape2       1.4.1       2014-12-06 CRAN (R 3.2.0)                          
 rpart          4.1-10      2015-06-29 CRAN (R 3.2.0)                          
 rsconnect      0.4.3       2016-05-02 CRAN (R 3.3.0)                          
 scales         0.4.0       2016-02-26 CRAN (R 3.2.3)                          
 seqinr         3.1-3       2014-12-17 CRAN (R 3.2.0)                          
 shiny          0.13.2      2016-03-28 CRAN (R 3.2.4)                          
 sp             1.2-3       2016-04-14 CRAN (R 3.3.0)                          
 spatstat       1.45-0      2016-03-10 CRAN (R 3.2.4)                          
 spdep          0.6-4       2016-04-12 CRAN (R 3.2.4)                          
 stabledist     0.7-0       2015-05-04 CRAN (R 3.2.0)                          
 strataG      * 1.0.5       2016-05-06 Github (ericarcher/strataG@c29d1fc)     
 stringi        1.0-1       2015-10-22 CRAN (R 3.2.0)                          
 stringr        1.0.0       2015-04-30 CRAN (R 3.2.0)                          
 survival       2.39-2      2016-04-16 CRAN (R 3.3.0)                          
 swfscMisc      1.1         2016-03-03 CRAN (R 3.2.4)                          
 tensor         1.5         2012-05-05 CRAN (R 3.2.0)                          
 vegan          2.3-5       2016-04-09 CRAN (R 3.2.4)                          
 withr          1.0.1       2016-02-04 CRAN (R 3.2.3)                          
 xtable         1.8-2       2016-02-05 CRAN (R 3.2.3)                          
EricArcher commented 8 years ago

Good catch! Caused by a recent addition I made to as.matrix.gtypes. Should be fixed now.