I really like the “frequencies” panel in the nextstrain builds, but I am not sure how to add it into my local build. I have a local build has sequences that are not in GISAID and are not even always SARS-CoV-2.
The creation of the tip-frequencies JSON is typically via augur frequencies (docs here). For an example, here’s the snakemake rule we use to create this for our SARS-CoV-2 builds.
Traceback (most recent call last):
File "/usr/bin/augur", line 11, in <module>
load_entry_point('nextstrain-augur', 'console_scripts', 'augur')()
File "/nextstrain/augur/augur/__main__.py", line 10, in main
return augur.run( argv[1:] )
File "/nextstrain/augur/augur/__init__.py", line 74, in run
return args.__command__.run(args)
File "/nextstrain/augur/augur/frequencies.py", line 97, in run
tip.attr = {"num_date": np.mean(dates[tip.name])}
KeyError: 'MN908947.3'
I think this is due to the ‘.’ in MN908947.3. How do I get around this?
Hey Erin – looking at that error I suspect that either MN908947.3 (Wuhan/Hu-1/2019, often included to root the tree) is not in the metadata file you provided to augur frequencies or that it’s in the metadata but missing a date.