Skip to content

Commit

Permalink
WIP export segment specific metadata
Browse files Browse the repository at this point in the history
This adds back in segment-specific metadata to the Auspice JSON. There
are multiple ways this can be done, each with trade-offs. The approach
employed here leaves the "_{segment}" suffix on the field names.
Alternatively we could remap the metadata file for each `export` call so
that (e.g.) "accession_S" becomes "accession".
  • Loading branch information
jameshadfield committed Sep 26, 2024
1 parent a5a10a2 commit 1883dbf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions phylogenetic/defaults/auspice_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,5 @@
"host",
"region",
"abbr_authors"
],
"metadata_columns": [
"accession"
]
}
6 changes: 6 additions & 0 deletions phylogenetic/defaults/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ traits:
export:
auspice_config: "defaults/auspice_config.json"
description: "defaults/description.md"
segment_metadata_columns:
- accession_{segment}
- qc_{segment}
- length_{segment}
- date_released_{segment}
- date_updated_{segment}
2 changes: 2 additions & 0 deletions phylogenetic/rules/export.smk
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ rule export:
auspice = "auspice/oropouche_{segment}.json",
params:
strain_id_field = config["strain_id_field"],
metadata_columns = lambda w: [name.format(segment=w.segment) for name in config["export"]["segment_metadata_columns"]]
shell:
"""
augur export v2 \
Expand All @@ -66,6 +67,7 @@ rule export:
--description {input.description} \
--colors {input.colors} \
--auspice-config {input.auspice_config} \
--metadata-columns {params.metadata_columns} \
--output {output.auspice} \
--include-root-sequence-inline
"""

0 comments on commit 1883dbf

Please sign in to comment.