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

functions not found #28

Closed Victaphanta closed 3 years ago

Victaphanta commented 3 years ago

Hi, I just did a new install of the latest version. No issues were detected when installing the package. But for some reason certain functions are no longer working, in particular from rate.mat.maker.R such as rate.par.drop.

"Error in rate.par.drop(rate.mat.index = recon01b$index.mat, drop.par = c(3, : could not find function "rate.par.drop""

Went back to an older version and my syntax is fine and reproduced earlier results.

Hope you can help.

jboyko commented 3 years ago

I believe we had to change the function when we expanded the allowed number of observed character states. The new function is dropStateMatPars and the arguments should all be the same. Sorry, for the confusion.

Best, James

Victaphanta commented 3 years ago

Thank you. I am now getting this error:

Error in dropStateMatPars(rate.mat.index = recon01b$index.mat, drop.par = c(3, : unused arguments (rate.mat.index = recon01b$index.mat, drop.par = c(3, 4, 13, 14, 17, 18))

perhaps the syntax has changes since I last used it?

jboyko commented 3 years ago

Try dropStateMatPars(StateMat = recon01b$index.mat, Pars = c(3, 4, 13, 14, 17, 18))

Victaphanta commented 3 years ago

thank you :)

Victaphanta commented 3 years ago

Hi James, I am now observing odd behavior with this new syntax.

I essentially want to take this matrix and remove some of the rates (i.e. make N/A), specifically rates 3,4,13,14,17,18

This is the original matrix.

recon01b[["index.mat"]] 1 2 3 4 5 1 NA 5 9 13 17 2 1 NA 10 14 18 3 2 6 NA 15 19 4 3 7 11 NA 20 5 4 8 12 16 NA

Using this syntax

rate.matbr<-dropStateMatPars(StateMat = recon01b$index.mat, Pars = c(3,4,13,14,17,18))

I get this

rate.matbr 1 2 3 4 5 1 NA 4 8 3 3 2 1 NA 9 3 3 3 2 5 NA 12 14 4 3 6 10 NA 15 5 3 7 11 13 NA

Instead of changing to N/A they all get allocated “3”

Not sure what I am doing wrong.

Thanks for your help.

Adnan