augur.import_.beast moduleο
Parse a BEAST MCC tree for further analysis in augur or export for auspice v2+ (using augur export v2 or greater).
- augur.import_.beast.calc_tree_dates(tree, most_recent_tip_date, tip_date_regex, tip_date_format, tip_date_delimeter)ο
Extract date information from the tree
- augur.import_.beast.collect_node_data(tree, root_date_offset, most_recent_tip_date)ο
Collect & summarise the BEAST traits included on the tree in a format applicable for augur to use (i.e. the βnode_data.jsonβ file).
- Parameters:
tree (
Bio.Phylo.BaseTree.Tree
)root_date_offset (float)
most_recent_tip_date (float)
- Returns:
the keys are dependent on the content of the BEAST input
- Return type:
- augur.import_.beast.compute_entropies_for_discrete_traits(tree)ο
Computes entropies for discrete traits. Discrete traits are assumed to be those where the value is a dictionary. This will set a βentropyβ value for each identified discrete trait on all applicable nodes in the tree.
Propertiesο
- tree
Bio.Phylo.BaseTree.Tree
BEAST traits are set as key-value pairs on node.attrs
- tree
- augur.import_.beast.fake_alignment(T)ο
Fake alignment to appease treetime when only using it for naming nodes⦠This is lifted from refine.py and ideally could be imported
- Parameters:
- Return type:
- augur.import_.beast.find_most_recent_tip(tree, tip_date_regex, tip_date_format, tip_date_delimeter)ο
Find the most recent tip in the tree
- Parameters:
tree (
Bio.Phylo.BaseTree.Tree
)tip_date_regex (str) β The regex used to extract the date (e.g. isolate collection date from each tip in the string. default: hyphen delimited numbers at the end of tip name
tip_date_format (str) β The format of the extracted date. (e.g. β%Y-%m-%dβ goes with β2012-10-30β)
tip_date_delimeter (str) β The delimeter in
tip_date_format
- Raises:
AssertionError β If any tips were not matched by the regex
- Returns:
The date of the most recent tip in the tree in decimal format
- Return type:
- augur.import_.beast.get_root_date_offset(tree)ο
years from most recent tip of the root
- augur.import_.beast.parse_beast_tree(data, tipMap, verbose=False)ο
Parses the BEAST tree (and attributes etc) as encoded in NEXUS.
- Parameters:
- Return type:
- augur.import_.beast.parse_nexus(tree_path, treestring_regex='tree [A-Za-z\\_]+([0-9]+)', verbose=False)ο
Parses the BEAST MCC tree (NEXUS format)
- Parameters:
- Raises:
AssertionError β If the tree was not correctly parsed
- Returns:
A tree with BEAST attrs set on each node (as applicable)
- Return type:
- augur.import_.beast.print_what_to_do_next(nodes, mcc_path, tree_path, node_data_path)ο
Print a suggested
auspice_config.json
file, which the user will have to configure and provide toaugur export
. There is not enough information in a MCC tree to do this automatically.
- augur.import_.beast.register_parser(parent_subparsers)ο
Arguments available to
augur import beast
- augur.import_.beast.run(args)ο
BEAST MCC tree to newick and node-data JSON for further augur processing / export
- augur.import_.beast.summarise_parsed_traits(tree)ο
- Parameters:
tree (
Bio.Phylo.BaseTree.Tree
)