augur.export_v2 moduleο
Export JSON files suitable for visualization with auspice.
- exception augur.export_v2.InvalidOptionο
Bases:
Exception
- augur.export_v2.are_clades_defined(node_attrs)ο
- augur.export_v2.are_dates_defined(node_attrs)ο
- augur.export_v2.are_mutations_defined(node_attrs)ο
- augur.export_v2.configure_warnings()ο
- augur.export_v2.convert_tree_to_json_structure(node, metadata, div=0)ο
converts the Biopython tree structure to a dictionary that can be written to file as a json. This is called recursively. Creates the name property & divergence on each node
- input
node β node for which top level dict is produced. div β cumulative divergence (root = 0). False β divergence wonβt be exported.
- returns
tree in JSON structure list of strains
- augur.export_v2.counter_to_disambiguation_suffix(count)ο
Given a numeric count of author papers, return a distinct alphabetical disambiguation suffix.
>>> counter_to_disambiguation_suffix(0) 'A' >>> counter_to_disambiguation_suffix(25) 'Z' >>> counter_to_disambiguation_suffix(26) 'AA' >>> counter_to_disambiguation_suffix(51) 'AZ' >>> counter_to_disambiguation_suffix(52) 'BA'
- augur.export_v2.create_author_data(node_attrs)ο
Gather the authors which appear in the metadata and create the author info structure with unique keys
- augur.export_v2.deprecated(message)ο
- augur.export_v2.fatal(message)ο
- augur.export_v2.get_config(args)ο
- augur.export_v2.get_config_colorings_as_dict(config)ο
- augur.export_v2.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_v2.get_values_across_nodes(node_attrs, key)ο
- augur.export_v2.is_valid(value)ο
- augur.export_v2.node_data_prop_is_normal_trait(name)ο
- augur.export_v2.parse_node_data_and_metadata(T, node_data, metadata)ο
- augur.export_v2.register_arguments_v2(subparsers)ο
- augur.export_v2.run_v2(args)ο
- augur.export_v2.set_annotations(data_json, node_data)ο
- augur.export_v2.set_build_url(data_json, config, cmd_line_build_url)ο
- augur.export_v2.set_colorings(data_json, config, command_line_colorings, metadata_names, node_data_colorings, provided_colors, node_attrs)ο
- augur.export_v2.set_data_provenance(data_json, config)ο
Set the data provenance from the given config file to the given data JSON.
- Parameters
data_json (dict) β auspice JSON to be updated
config (dict) β config JSON with an expected
data_provenance
key{"data_provenance" (>>> config =) β
{"meta" (>>> data_json =) β
set_data_provenance(data_json (>>>) β
config) β
data_json["meta"]["data_provenance"][0]["name"] (>>>) β
'GISAID' β
- augur.export_v2.set_description(data_json, cmd_line_description_file)ο
Read Markdown file provided by cmd_line_description_file and set meta.description in data_json to the text provided.
- augur.export_v2.set_display_defaults(data_json, config)ο
- augur.export_v2.set_filters(data_json, config)ο
- augur.export_v2.set_geo_resolutions(data_json, config, command_line_traits, lat_long_mapping, node_attrs)ο
appropriately combine provided geo resolutions from command line & config files and associate with lat/longs.
- augur.export_v2.set_maintainers(data_json, config, cmd_line_maintainers)ο
- augur.export_v2.set_node_attrs_on_tree(data_json, node_attrs)ο
Assign desired colorings, metadata etc to the tree structure
- Parameters
data_json (dict) β
node_attrs (dict) β keys: strain names. values: dict with keys -> all available metadata (even βexcludedβ keys), values -> data (string / numeric / bool)
- augur.export_v2.set_panels(data_json, config, cmd_line_panels)ο
- augur.export_v2.set_title(data_json, config, cmd_line_title)ο
- augur.export_v2.update_deprecated_names(name)ο
- augur.export_v2.validate_data_json(filename)ο
- augur.export_v2.warning(message)ο