With auspice build I can almost get what I want, but I always have a page where I have to drop (or be able to answer a GET request) the datasets into the visualization section.
Not knowing much about Auspice internals myself, you would probably have to fork the repo and change where the data gets loaded from to your own server.
@james is the guy who knows how this could be achieved.
Is there a particular reason why you can’t use the Github community build way to serve datasets?
Thanks @corneliusroemer ,
I’m relatively new to this, so I may be missing something.
What do you mean by the Github community build way?
Right now I’m struggling trying to implement in my django-based webpage the ability to answer the GET requests that auspice needs. I just thought there might be an easier way of doing it…
I don’t mean to jump in from Cornelius but thought I could link you to something that may be useful, depending on what you’re looking for - the ‘Github community way’. We have a way that you can create a repo on Github, please your JSON files in a folder called
auspice there, and then be able to view via a
nextstrain.org link that follows a certain structure. The instructions in more detail are here.
The main thing that tricks people is that the name of your repo needs to match the start of your file name. So, if the repo is called
covid then your files should be
covid_mycountry_jan.JSON (or similar!). Also, underscores are turned into
/ in the URL.
For a real-world example, I have some enterovirus builds like this:
The file this links to is here, is in a repo of mine called
enterovirus (not an accident!) and the file is called
enterovirus_d68_genome-15Feb22.json (note how the
_ turn into
/ in the URL path.)
This is a great way to share runs with a smaller group, or for more ‘internal’ use (but of course - still public - you can’t make these github repos private or nextstrain.org can’t access the file to process it!). I hope it helps!
Dear @emmahodcroft thanks for the pointers!
It does sound interesting and I’ll give it a go at the github community method.
Nonetheless, the matter of privacy may indeed be an issue on some occasions. Another disadvantage is that we sometimes have very big json files (eg. >100Mb) so it starts getting clunky in github…
@daniel.sobral are the json files so big because they are not minimized? You can minify auspice.jsons (not done by default) and then they’re much much smaller.
Nextstrain has an authentication system to restrict build viewing to authenticated individuals - but I’m not sure whether this system is Nextstrain-internal or can be customized to work for you use case. @trs will know better.
There isn’t, although this would be a really nice feature to have! (I actually implemented this for a one-off project a few years ago, but as we don’t use it in this way it’s no longer in the code.) I’d like to reinstate it, but it’s not very high on the priority list.
If you wanted to pursue this you’d need to change the
Dataset.prototype.fetchSidecars functions to either fetch from your (hardcoded) address or perhaps just import the data into the file and return it from that function. You’ll also have to change the default value of
<reduxStore>.general.displayComponent to be “main” so that the initial page is a dataset-view page. It would be great if this were a build-time customisation but again, it might take me a while to get round to this!
Let us know how you get on!