Error in poppr(): cannot coerce class ""ialist"" to a data.frame

14 views
Skip to first unread message

zei...@natur.cuni.cz

unread,
Apr 3, 2017, 6:32:14 AM4/3/17
to poppr
Hello,
I run poppr() like this:
poppr(dat=genind, total=TRUE, sample=10000, method=4, missing="geno", cutoff=0.15, quiet=FALSE, clonecorrect=FALSE, plot=TRUE, index="rbarD", minsamp=1, legend=TRUE)
and I get an error:
...
| Total
|============================================================================================= |100% ~0 s remaining
Error in as.data.frame.default(t(IaList)) :
 
cannot coerce class ""ialist"" to a data.frame
and no table with results is plotted. Removing missing data with missingno() doesn't help.
The data looks like this:
genind
/// GENIND OBJECT /////////
 
// 32 individuals; 13 loci; 91 alleles; size: 32.4 Kb
 
// Basic content
   
@tab:  32 x 91 matrix of allele counts
   
@loc.n.all: number of alleles per locus (range: 2-12)
   
@loc.fac: locus factor for the 91 columns of @tab
   
@all.names: list of allele names for each locus
   
@ploidy: ploidy of each individual  (range: 2-2)
   
@type:  codom
   
@call: df2genind(X = as.matrix(x[, attr(x, "locicol")]), sep = "[/\\|]",
    pop
= pop, NA.char = ".")
 
// Optional content
   
- empty -
The workspace looks like this:
sessionInfo()
R version
3.3.3 (2017-03-06)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE Tumbleweed
locale
:
 
[1] LC_CTYPE=cs_CZ.UTF-8          LC_NUMERIC=C                  LC_TIME=cs_CZ.UTF-8          
 
[4] LC_COLLATE=cs_CZ.UTF-8        LC_MONETARY=cs_CZ.UTF-8       LC_MESSAGES=cs_CZ.UTF-8      
 
[7] LC_PAPER=cs_CZ.UTF-8          LC_NAME=cs_CZ.UTF-8           LC_ADDRESS=cs_CZ.UTF-8      
[10] LC_TELEPHONE=cs_CZ.UTF-8      LC_MEASUREMENT=cs_CZ.UTF-8    LC_IDENTIFICATION=cs_CZ.UTF-8
attached
base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    
other attached packages
:
[1] poppr_2.3.0    adegenet_2.0.1 ade4_1.7-6     rkward_0.6.5  
loaded via a
namespace (and not attached):
 
[1] Rcpp_0.12.10     spdep_0.6-11     plyr_1.8.4       pegas_0.9        LearnBayes_2.15  tools_3.3.3    
 
[7] boot_1.3-18      digest_0.6.12    tibble_1.3.0     gtable_0.2.0     nlme_3.1-131     lattice_0.20-35
[13] mgcv_1.8-17      fastmatch_1.1-1  Matrix_1.2-9     igraph_1.0.1     shiny_1.0.1      DBI_0.6-1      
[19] parallel_3.3.3   expm_0.999-2     coda_0.19-1      cluster_2.0.6    dplyr_0.5.0      stringr_1.2.0  
[25] gtools_3.5.0     grid_3.3.3       R6_2.2.0         phangorn_2.1.1   sp_1.2-4         gdata_2.17.0    
[31] ggplot2_2.2.1    reshape2_1.4.2   seqinr_3.3-4     deldir_0.1-12    magrittr_1.5     scales_0.4.1    
[37] htmltools_0.3.5  MASS_7.3-45      splines_3.3.3    gmodels_2.16.2   assertthat_0.1   permute_0.9-4  
[43] mime_0.5         ape_4.1          colorspace_1.3-3 xtable_1.8-3     httpuv_1.3.3     labeling_0.3    
[49] quadprog_1.5-5   stringi_1.1.3    lazyeval_0.2.0   munsell_0.4.3    vegan_2.4-2
Any idea what could be wrong?
Yours,
Vojtěch

Zhian Kamvar

unread,
Apr 3, 2017, 11:00:15 AM4/3/17
to poppr
Hi,

This looks to be a bug in poppr. I've flagged it as an issue on poppr's GitHub page [0] and it will be fixed in the next release. 
In the meantime, a workaround would be to set a population for your data:

pop(genind) <- rep("A", nInd(genind))

Unrelated, but I additionally recommend to not use function names ("genind") as variable names. 

Hope that helps,
Zhian

Vojtěch Zeisek

unread,
Apr 3, 2017, 11:14:57 AM4/3/17
to po...@googlegroups.com
Hello,
thank You, the workaround fixed the issue.
I named the data "genind" just for the posting.
Sincerely,
Vojtěch

Dne pondělí 3. dubna 2017 17:00:15 CEST, Zhian Kamvar napsal(a):
--
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
http://www.ibot.cas.cz/en/
signature.asc
Reply all
Reply to author
Forward
0 new messages