Closed xuechunxu closed 1 year ago
ace
is not a phytools function -- it's a function of the ape package by Emmanuel Paradis; however, it is possible to do marginal ancestral state reconstruction using phytools and that's what I'd probably recommend. In that case, you workflow would look roughly as follows:
fitER<-fitMk(tree,x,model="ER")
marginal_ER<-ancr(fitER)
Please try that & let me know what you discover.
Thanks for your reply.
I ran the command, but got the error:
marginal_ER<-ancr(fitER) Error in ancr(fitER) : could not find function "ancr"
Is my phytools need to be updated?
This is my phytools version:
Thank you again!
Chun Xu
Yes, you should install the remotes package from CRAN and then run
remotes::install_github("liamrevell/phytools")
to update phytools from GitHub.
(Although I see some problem with your data based on the output from fitMk
so you try to get that sorted out first.)
Thanks for your reply.
I was so confused about the error. Is there a problem with my input file? Could you check it for me? Attach please find the tree and niche annotation.
Thank you very much.
Chun Xu 发件人: Liam J. @.> 发送时间: 2023年4月27日 10:13 收件人: @.> 抄送: chunxu @.>; @.> 主题: Re: [liamrevell/phytools] Error in matexpo(Q * EL[i]) : NA/NaN/Inf in foreign function call (arg 1) (Issue #132)
(Although I see some problem with your data based on the output from fitMk so you try to get that sorted out first.)
― Reply to this email directly, view it on GitHubhttps://github.com/liamrevell/phytools/issues/132#issuecomment-1524469195, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFUHDPDE5D6GYWPAB3DM6ATXDHI4BANCNFSM6AAAAAAXMGBIFA. You are receiving this because you authored the thread.Message ID: @.***>
Hi,
I estimated ancestral character states for discretely valued traits. But got the error:
Error in matexpo(Q * EL[i]) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning messages: 1: In log(comp[-TIPS]) : NaNs produced 2: In ace(x, tree, model = "ER", type = "discrete") : model fit suspicious: gradients apparently non-finite
Here is my command line:
![image](https://user-images.githubusercontent.com/23622076/234539471-0e4abe08-04da-4bf2-8f33-3d7f95d185a3.png)
This is my niche file, these are five niche types![image](https://user-images.githubusercontent.com/23622076/234540225-be0f704c-1b0d-42eb-ac4d-88cf34a7b4ae.png)
Looking forward to your reply!
Chun Xu