thej022214 / corHMM

Fits a generalized form of the covarion model that allows different transition rate classes on different portions of a phylogeny by treating rate classes as “hidden” states in a Markov process.
11 stars 13 forks source link

corHMM producing error #34

Closed dasyuridae closed 2 years ago

dasyuridae commented 2 years ago

Hi! I'm relatively new to working with phylogenetic data, and am getting the following error when I try to run corHMM with my tree and data:

corHMM(phy = dogtree, data=dogsjoin, rate.cat = 2)

"State distribution in data: States: 1 2 3 4 5 6 7 8 9
Counts: 5 1 2 2 1 2 1 1 3
Beginning thorough optimization search -- performing 0 random restarts Finished. Inferring ancestral states using marginal reconstruction. Error in liks.down[root, ] <- liks.down[root, ] * root.p : number of items to replace is not a multiple of replacement length"

The tree was produced with MrBayes and exported into Nexus format through FigTree, then into phylo format through the ape package, and all of the terminal node labels are present in the dataset (which has three trait columns). I tried using an unrooted tree and got the same error. I'm struggling to figure out what is causing the error or if I've missed something obvious and would love any insight!

Thanks, Daisy

jboyko commented 2 years ago

Hi Daisy,

Is the tree time calibrated with all tips at the present? I believe the function is.ultrametric could help.

Best, James

dasyuridae commented 2 years ago

That worked, thank you!