nextstrain / seasonal-flu

Scripts. config, and snakefiles for seasonal-flu nextstrain builds
44 stars 26 forks source link

Add rules to the nextflu-private workflow to rename Auspice JSONs based on the build date and deploy the JSONs to the Nextstrain group #139

Closed huddlej closed 8 months ago

huddlej commented 8 months ago

Before we can deploy newly built Auspice JSONs to the Nextstrain group, we need to rename them to a unique name that reflects the date they were built. The builds need to be renamed from names like h1n1pdm_2y_titers_ha.json to flu_seasonal_YYYY-MM-DD_h1n1pdm_2y_titers_ha.json where the YYYY-MM-DD is the date the builds were run. We currently rename these files manually to include the date.

The nextstrain-public builds provide an example of custom rules to rename the JSONs prior to deployment. The new names for the JSONs get defined as a template string in the build configuration parameter called auspice_name. The rename rules get invoked by the custom deploy rule which is the primary target of the workflow we run from GitHub Actions.

We should follow the same pattern for the nextflu-private builds, except we need to calculate the current date when the workflow runs. One approach could be to assign the current date to a global variable in the rename.smk Snakemake file, define an auspice_name for the builds with a non-wildcard placeholder for the date like "flu_seasonal_{{date}}_{lineage}_{{segment}}_{resolution}", and then pass the date value to the format call on the filename strings (e.g., this one and this one).

TODO: