Best Method to Edit BEAST XML using Python?

44 views
Skip to first unread message

Pavel Rinkman

unread,
Aug 30, 2023, 8:29:41 AM8/30/23
to beast-users

Hello, everyone

I have been exploring various tools and methods to edit BEAST XML models using Python, and I need some guidance.

I have come across “10+ ways to generate BEAST XML. While the article is informative, it left me uncertain about the optimal approach for my specific needs about editing already prepared XML: adding new datasets & operators, modifying their weights, scale factors, and other parameters. I would appreciate insights from those who have tackled this before with Python or similar scripting tools.

MiXeL allows to create pattern templates but looks like more XML to XML fans. I am afraid to mix code, model description, and data in one thing.

BEASTLing looks like a very convenient and descriptive way to generate stable and reproducible XMLs, but it is created only for linguistic tasks. I do like its option to generate a config file based on the provided XML.

BEAST2XML is primarily about generating XMLs, not so much about editing them.

Finally, here is only beasy left that appeals to me the most. It is imperative and interacts directly with BEAUti. Unfortunatelly, it is incompatible with BEAST 2.7 as it requires the BEAST package that was split into .app & .base.

So I am left only with pure Python and lxml package to achieve the necessary goals.
I am eager to hear any recommendations or alternatives.

Warm regards,
Pavel

Reply all
Reply to author
Forward
0 new messages