Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measurements command #879

Merged
merged 21 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
89156a7
Add "measurements" to list of valid panels
huddlej Mar 15, 2022
ee56099
Add JSON schema for measurements collection config
joverlee521 Mar 24, 2022
90688e3
augur validate: add measurements-collection-config subcommand
joverlee521 Mar 24, 2022
32db8dc
validate measurements: add validations not checked by schema
joverlee521 Mar 29, 2022
a1c2c03
Add augur measurements export subcommand
joverlee521 Mar 30, 2022
b62477b
augur measurements export: add advanced options
joverlee521 Mar 31, 2022
3eccec4
Add augur measurements concat subcommand
joverlee521 Mar 31, 2022
2a8c0d9
Add autogenerated API documentation for augur.measurements
joverlee521 Apr 7, 2022
8ea76a6
measurements: fix docstring for override_config_with_args
joverlee521 Apr 20, 2022
4551c44
measurements/validate: standardize print messages
joverlee521 Apr 30, 2022
2e6095d
measurements: edit help messages
joverlee521 Apr 30, 2022
cd6241c
measurements: use global dict to hold default args
joverlee521 May 4, 2022
5cbb89c
move `HideAsFalseAction` to shared utils module
joverlee521 May 5, 2022
e6a4a3f
tests: measurements concat keep stderr output
joverlee521 May 6, 2022
d8272f4
measurements: remove function `column_exists`
joverlee521 May 6, 2022
3796b4a
measurements export: exit with error if any groupings invalid
joverlee521 May 6, 2022
dd841fc
measurements: rename `validate_*` as `read_*`
joverlee521 May 6, 2022
8fe026a
measurements: add argument groups to concat
joverlee521 May 6, 2022
cbace7c
measurements: use argparse.Namespace object
joverlee521 May 6, 2022
b510e7a
measurements export: add `--include-columns` option
joverlee521 May 7, 2022
8fbdc82
measurements: overhaul to single "main" function
joverlee521 May 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion augur/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"export",
"validate",
"version",
"import"
"import",
"measurements",
]

COMMANDS = [importlib.import_module('augur.' + c) for c in command_strings]
Expand Down
2 changes: 1 addition & 1 deletion augur/data/schema-auspice-config-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
"minItems": 1,
"items": {
"type": "string",
"enum": ["tree", "map", "frequencies", "entropy"]
"enum": ["tree", "map", "frequencies", "entropy", "measurements"]
}
},
"vaccine_choices": {
Expand Down
2 changes: 1 addition & 1 deletion augur/data/schema-export-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"type": "array",
"items": {
"type": "string",
"enum": ["tree", "map", "frequencies", "entropy"]
"enum": ["tree", "map", "frequencies", "entropy", "measurements"]
},
"uniqueItems": true,
"minItems": 1
Expand Down
107 changes: 107 additions & 0 deletions augur/data/schema-measurements-collection-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://nextstrain.org/schemas/dataset/measurements/collection/config",
"title": "Collection config file to be supplied to `augur measurements export`",
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"key": {
"description": "The short name of the collection that is only used internally within Auspice. Each collection is expected to have a unique key.",
"type": "string"
},
"title": {
"description": "The title to display in the collections dropdown and panel title. Optional -- if not provided, then `key` will be used",
"type": "string"
},
"fields": {
"description": "Custom field order and display titles. Order of the fields determines the order they are shown in the measurement hover display. Optional -- if not provided, then the key of the field will be displayed in alphabetical order.",
"type": "array",
"minItems": 1,
"items": {
"description": "A single field of the measurements",
"type": "object",
"additionalProperties": false,
"required": ["key"],
"properties": {
"key": {
"description": "The property name of the field within the measurement object",
"type": "string"
},
"title": {
"description": "The display title for the field. Optional -- if not provided, then `key` will be used",
"type": "string"
}
}
}
},
"groupings": {
"description": "The available group by fields for measurements. Order of the group by fields determines the order they are shown in the group by dropdown.",
"type": "array",
"minItems": 1,
"items": {
"description": "A single group by field for measurements",
"type": "object",
"additionalProperties": false,
"required": ["key"],
"properties": {
"key": {
"description": "The property name of the group by field within the measurement object",
"type": "string"
},
"order": {
"description": "A custom order of group by values to customize the display order of the subplots when using group by field",
"type": "array",
"minItems": 1,
"items": {
"description": "A single value of the group by field present in measurements",
"type": ["string", "number", "boolean"]
}
}
}
}
},
"filters": {
"description": "The available filter options for measurements. Order of the filter options determines the order they are shown in the filter dropdown. Optional -- if not provided, then all fields will be available as filters.",
"type": "array",
"minItems": 1,
"items": {
"description": "The property name of the filter field within the measurement object",
"type": "string"
}
},
"x_axis_label": {
"description": "The short label to display for the x-axis that describes the `value` of the measurements in a collection",
"type": "string"
},
"threshold": {
"description": "A numeric measurement threshold to be displayed as a single grey line shared across subplots. Optional -- if not provided, no threshold will be displayed",
"type": "number"
},
"display_defaults": {
"description": "Default display options of the collection",
"type": "object",
"additionalProperties": false,
"minProperty": 1,
"properties": {
"group_by": {
"description": "Default group by field name that must be included as a group by option in the groupings array. Optional -- if not provided, first group by option will be used",
"type": "string"
},
"measurements_display": {
"description": "Dictates how the measurements are displayed, either as the raw data points or as the means of values grouped by the tree color-by attribute",
"type": "string",
"enum": ["raw", "mean"]
},
"show_overall_mean": {
"description": "Should the overall mean per group be displayed by default?",
"type": "boolean"
},
"show_threshold": {
"description": "Should the threshold line be displayed by default? Ignored if no threshold has been provided for collection",
"type": "boolean"
}
}
}
}
}
2 changes: 1 addition & 1 deletion augur/export_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ def register_arguments_v2(subparsers):
config.add_argument('--description', metavar="description.md", help="Markdown file with description of build and/or acknowledgements to be displayed by Auspice")
config.add_argument('--geo-resolutions', metavar="trait", nargs='+', help="Geographic traits to be displayed on map")
config.add_argument('--color-by-metadata', metavar="trait", nargs='+', help="Metadata columns to include as coloring options")
config.add_argument('--panels', metavar="panels", nargs='+', choices=['tree', 'map', 'entropy', 'frequencies'], help="Restrict panel display in auspice. Options are %(choices)s. Ignore this option to display all available panels.")
config.add_argument('--panels', metavar="panels", nargs='+', choices=['tree', 'map', 'entropy', 'frequencies', 'measurements'], help="Restrict panel display in auspice. Options are %(choices)s. Ignore this option to display all available panels.")

optional_inputs = v2.add_argument_group(
title="OPTIONAL INPUT FILES"
Expand Down
Loading