xavierdidelot / BactDating

Bayesian inference of ancestral dates on bacterial phylogenetic trees
https://xavierdidelot.github.io/BactDating
MIT License
80 stars 15 forks source link

error after updating to 1.0.9 #28

Closed fengyuchengdu closed 4 years ago

fengyuchengdu commented 4 years ago

library(BactDating) library(ape) library(coda) gubbins_tree=loadGubbins(prefix = 'kl47_for_gubbins') dates_table=read.csv("dates.csv",header = F) View(dates_table) dates=dates_table$V2 names(dates)=(dates_table$V1) result=bactdate(gubbins_tree,dates,nbIts=1e7,showProgress=T,useRec=T) Error in if (var(date, na.rm = T) == 0 && is.na(rate)) { : missing value where TRUE/FALSE needed

after updating to 1.0.9, this message popped out.

Thanks !

xavierdidelot commented 4 years ago

What is the output of summary(dates) ? Do you also get the error with useRec=F ? Did you not have an error before updating on exactly the same data ?

fengyuchengdu commented 4 years ago
  1. summary(dates) Min. 1st Qu. Median Mean 3rd Qu. Max. 2017 2019 2019 2019 2019 2019

  2. yes

  3. not exactly the same data but never saw this issue before

xavierdidelot commented 4 years ago

Ok, just a couple more questions: Ntip(gubbins_tree) length(dates) length(intersect(gubbins_tree$tip.label,names(dates)))

fengyuchengdu commented 4 years ago

Sorry for all of this and thank you very much for the help. I noticed that I made a typo in the strain names and it's working now.

xavierdidelot commented 4 years ago

Ok, thanks!