nhanhocu / metamicrobiomeR

An R package for analysis of microbiome relative abundance data using zero inflated beta GAMLSS and meta-analysis across microbiome studies using random effects models
https://github.com/nhanhocu/metamicrobiomeR
33 stars 11 forks source link

Error in implementing function metatab.show #19

Open voyagant opened 2 years ago

voyagant commented 2 years ago

Hi, I've tried to import data from your github and run the code from this part of the manual:

# load saved results of four studies for the comparison of bacterial taxa relative abundance between genders adjusted for breastfeeding and infant age at sample collection 
data(taxacom.rm.sex.adjustbfage)
data(taxacom.ha.sex.adjustbfage)
data(taxacom6.zi.usbmk.sex.adjustbfage)
data(taxacom6.unc.sex.adjustedbfage)
taxacom6.zi.rm.sex.adjustbfage$study<-"Subramanian et al 2014 (Bangladesh)"
taxacom6.zi.rm.sex.adjustbfage$pop<-"Bangladesh"
taxacom.zi.ha.sex.adjustbfage$study<-"Bender et al 2016 (Haiti)"
taxacom.zi.ha.sex.adjustbfage$pop<-"Haiti"
taxacom6.zi.usbmk.sex.adjustbfage$study<-"Pannaraj et al 2017 (USA(CA_FL))"
taxacom6.zi.usbmk.sex.adjustbfage$pop<-"USA(CA_FL)"
taxacom6.zi.unc.sex.adjustedbfage$study<-"Thompson et al 2015 (USA(NC))"
taxacom6.zi.unc.sex.adjustedbfage$pop<-"USA(NC)"
tabsex4<-rbind.fill(taxacom6.zi.rm.sex.adjustbfage,taxacom.zi.ha.sex.adjustbfage,taxacom6.zi.usbmk.sex.adjustbfage,taxacom6.zi.unc.sex.adjustedbfage)
# meta-analysis (take some time to run)
#metab.sex<-meta.taxa(taxcomdat=tabsex4,summary.measure="RR",pool.var="id",studylab="study",backtransform=FALSE,percent.meta=0.5,p.adjust.method="fdr")
#load saved results 
data(metab.sex)
#phylum
kable(metatab.show(metatab=metab.sex$random,com.pooled.tab=tabsex4,tax.lev="l2",showvar="genderMale",p.cutoff.type="p", p.cutoff=0.05,display="table"))

And when it comes to implement the "metatab.show" on bottom line, an error msg pop up like that:

7c3d86c31c52b876cc0857ae55a5fe7

which claims that "undefined columns selected"

I was wondering how it comes since the data and code all from official manual example.

Is the R package incompitable with the latest R version?Mine is R 4.1.0

Thx a lot in advance for reply

nhanhocu commented 2 years ago

Hi, Thanks for trying the package metamicrobiomeR. Please try the current version in R cran and it associated examples and data. Many thanks,