augur.validate_export module

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.

class augur.validate_export.AttrInfo

Bases: TypedDict

count: int
onAllNodes: bool
augur.validate_export.TreeAttrs

Mapping from attribute name to object with values and statistics.

alias of DefaultDict[str, AttrInfo]

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

Return type:

Tuple[DefaultDict[str, AttrInfo], int]

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.

Return type:

Tuple[DefaultDict[str, AttrInfo], int]

Returns:

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