augur.export_v1 module

Export version 1 JSON schema (separate meta and tree JSONs) for visualization with Auspice

augur.export_v1.add_core_args(parser)
augur.export_v1.add_option_args(parser)
augur.export_v1.add_tsv_metadata_to_nodes(nodes, meta_tsv, meta_json, extra_fields=['authors', 'url', 'accession'])

Only used for v1 schema compatability

Add the relevent fields from meta_tsv to the nodes (both are dictionaries keyed off of strain names) * the relevent fields are found by scanning the meta json together with the extra_fields param

augur.export_v1.construct_author_info_v1(metadata, tree, nodes)

author info maps the “authors” property present on tree nodes to further information about the paper etc

augur.export_v1.convert_tree_to_json_structure(node, metadata, div=0, strains=None)

converts the Biopython tree structure to a dictionary that can be written to file as a json. This is called recursively. Creates the strain property & divergence on each node

input

node – node for which top level dict is produced. div – cumulative divergence (root = 0)

returns

tree in JSON structure list of strains

augur.export_v1.ensure_config_is_v1(config)

Check the provided config file is intended for augur export v1 (not v2, v3 etc) Side effects: may print a warning & exit

augur.export_v1.get_root_sequence(root_node, ref=None, translations=None)

create a json structure that contains the sequence of the root, both as nucleotide and as translations. This allows look-up of the sequence for all states, including those that are not variable.

Parameters:
  • root_node (dict) – data associated with the node

  • ref (str, optional) – filename of the root sequence

  • translations (str, optional) – file name of translations

Returns:

dict of nucleotide sequence and translations

Return type:

dict

augur.export_v1.process_annotations(node_data)
augur.export_v1.process_colorings(jsn, color_mapping, nodes=None, node_metadata=None)
augur.export_v1.process_geographic_info(jsn, lat_long_mapping, node_metadata=None, nodes=None)
augur.export_v1.process_panels(user_panels, meta_json)
augur.export_v1.recursively_decorate_tree_json_v1_schema(node, node_metadata, decorations)

This function is deprecated and is used to produce the v1-compatable JSON format

For given decorations, add information from node_metadata to each node in the tree. * decorations must have property “key” which is the key used to insert into the node and the default key used to access node_metadata * if decorations has property “lookup_key”, this is used to access node meta_data instead * if decorations has property “is_attr” (and it’s value is True) then the result is inserted into node[“attr”]

returns Null

augur.export_v1.register_parser(parent_subparsers)
augur.export_v1.run(args)
augur.export_v1.tree_layout(T)

calculate tree layout. This function is deprecated, and only used for the v1 JSON format