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

Fix bug where processDefaultValues reads past the first '=' #991

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

Wytamma
Copy link
Contributor

@Wytamma Wytamma commented Jul 28, 2021

If traits defaults are specified by the user in the form value="$(dateTrait.value=68BO_2011.0=2011.0,65BO_2013.0=2013.0,97SGR_2012.0=2012.0..." BEAST would read past the first '=' to the last '='. This makes the parserDefinitions key equal "dateTrait.value=68BO_2011.0=2011.0,65BO_2013.0=2013.0,97SGR_2012.0" and value "2012.0". I fixed this by only setting k to the index of the first '='.

If traits defaults are specified by the user in the form `value="$(dateTrait.value=68BO_2011.0=2011.0,65BO_2013.0=2013.0,97SGR_2012.0=2012.0..."` BEAST would read past the first '=' to the last '='. This makes the parserDefinitions key equal "dateTrait.value=68BO_2011.0=2011.0,65BO_2013.0=2013.0,97SGR_2012.0" and value "2012.0". I fixed this by only setting k to the index of the first '='.
@Wytamma Wytamma changed the title Fix bug where processDefaultValues read past the first '=' Fix bug where processDefaultValues reads past the first '=' Jul 28, 2021
@Wytamma
Copy link
Contributor Author

Wytamma commented Jul 28, 2021

Sorry! I made a typo in the only change I made (facepalm). Have now fixed.

@rbouckaert
Copy link
Member

Interesting way to use defaults.

@rbouckaert rbouckaert merged commit 5599be4 into CompEvol:master Jul 28, 2021
@Wytamma
Copy link
Contributor Author

Wytamma commented Jul 29, 2021

Thanks for accepting my PR! I made a small library for creating dynamic BEAST XML files so that all parameters can be set at runtime https://github.com/Wytamma/dynamic-beast. Cheers!

@rbouckaert
Copy link
Member

Thanks for the link. Judging from the example (dynamic_BEAST.xml) I noticed that partition information gets removed (in order to prevent clutter in online defintiions?), and wonder how it works when there are multiple partitions. Say, there are two partitions, both with gammaCategoryCount=4 by default. Will running BEAST with -D SiteModel.gammaCategoryCount=8 change the category count of both partitions, or will partition information be added in this instance and category counts remain 4?

@Wytamma
Copy link
Contributor Author

Wytamma commented Jul 30, 2021

Ah! Yeah you're right! I've updated it now so that you have to specify the full path e.g. beast -D 'clockRate.c:hcv=7.9E-4' dynamic_hcv_coal.xml. No as clean of an interface but the only way it'll work I guess. Thanks for the input on yet another way to generate a BEAST XML file 😂

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

Successfully merging this pull request may close these issues.

None yet

2 participants