augur.validate_export

Functions that are from earlier versions of augur validate and haven’t yet been moved into validate.py. There’s a lot of duplication here which can be abstracted and refactored over time.

augur.validate_export.collectAAMutationGenesV1(root)

Returns a set of all genes specified in the tree in the “aa_muts” objects

augur.validate_export.collectBranchLabels(root)
augur.validate_export.collectMutationGenes(root)

Returns a set of all genes specified in the tree in the “aa_muts” objects

augur.validate_export.collectTreeAttrsV1(root)

Collect all keys specified on node->attr (or node->traits) throughout the tree If the values of these keys are strings, then also collect the values

augur.validate_export.collectTreeAttrsV2(root, warn)

Collect all keys specified on node[“node_attrs”] throughout the tree and the values associated with them. Note that this will only look at attributes which are themselves objects with a value property. I.e. a node attribute node[“node_attrs”][“div”] -> numeric will not be collected. Returns a tuple. return[0]: dict of node_attr_property -> x, where x is a dict with keys count -> INT, values -> SET, onAllNodes -> BOOL. return[1]: INT of number of terminal nodes in tree

augur.validate_export.ensure_no_duplicate_names(root, ValidateError)

Check that all node names are identical, which is required for auspice (v2) JSONs.

augur.validate_export.verifyMainJSONIsInternallyConsistent(data, ValidateError)

Check possible sources of conflict within the main (unified) JSON This function is only used for schema v2.0 In an ideal world, the JSON schema would be able to validate this, however this function performs tests which are not possible to define in the schema (as of JSON schema v6).

augur.validate_export.verifyMetaAndOrTreeJSONsAreInternallyConsistent(meta_json, tree_json, ValidateError)

Check all possible sources of conflict internally & between the metadata & tree JSONs This is only that which cannot be checked by the schemas