Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bayou2OUwie error #16

Closed
coyotree opened this issue May 20, 2019 · 2 comments
Closed

bayou2OUwie error #16

coyotree opened this issue May 20, 2019 · 2 comments

Comments

@coyotree
Copy link

Hello,

I have successfully run bayou and now would like to export that information into an acceptable OUwie format. I am using the bayou2OUwie function. I have pars directed to the saved bayou run so that it can locate sb, loc and t2. I have the tree I used for the bayou run, and the tip data are in a named vector sorted in the same order at the tree labels.

I receive the following error:

> bayou2OUwie(chain.fit, fit.tree, fit.sorted2)
Error in table(pars$sb) : all arguments must have the same length

I have checked and all lists have 150001 items.

> length(chain.fit$sb)
[1] 150001
> length(chain.fit$loc)
[1] 150001
> length(chain.fit$t2)
[1] 150001

The number of tips in the tree match the number of rows for the tip data.

I cannot figure out why I am getting this error.

I am using bayou v2.1.1, R version 3.5.2.

Any advice appreciated. Thanks for this package!

Cody Coyotee

@uyedaj
Copy link
Owner

uyedaj commented May 20, 2019

Hi Cody,
bayou2OUwie requires that you only provide it a single set of parameters rather than the full posterior. For example, you could use the function pull.pars to pull out a particular generation of the MCMC and return a bayou parameter list. Alternatively, you could use the function shiftSummaries to return a bayou parameter list for all shifts above a certain posterior probability (pp.cutoff). For example:

pp <- pull.pars(150001, chain.fit) # Get the last generation of the MCMC parameters
 bayou2OUwie(pp, fit.tree, fit.sorted2)

#OR

pp <- shiftSummaries(chain.fit, mcmc=your.mcmc.object, pp.cutoff=0.3)$pars
bayou2OUwie(pp, fit.tree, fit.sorted2)

@uyedaj uyedaj closed this as completed May 20, 2019
@coyotree
Copy link
Author

Thank so much for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants