nextclade
nextclade copied to clipboard
ENH: Allow nextclade web to import pre-analyzed outputs
I've often wished there was a way for the nextclade web interface to import a pre-computed nextclade analysis that comes from nextclade CLI output and/or saved as a serialized file from the nextclade web UI.
Main use case: being able to provide a collaborator a pre-computed data set without having to 1) ship an unaligned fasta file or 2) make the collaborator re-compute everything with whatever inputs and parameters I happened to use at the time. I basically want a visual interface for users for the analyses I already produced via nextclade CLI.
I think the nextclade output json file (not the auspice json file) might function well for this purpose but I don't know if it contains all the necessary information and might need to be extended slightly. But it's possible that this is just supporting a json input in addition to the fasta input here:
Thanks @dpark01 for the idea
Stacia Wyma, Anthony Fries, Genay Pilarowski, Duncan, Bryan, Nidia from Spheres expressed interest in this feature via Zoom chat
Possible benefits (magnitude/importance to be determined):
- Potentially requires less disk space than fasta file (competing feature: allow compressed fasta input)
- Potentially less processing time, suitable for sharing with colleagues (currently it takes ~.5s per sequence) -> users want to view results within seconds not a minute
@ivan-aksamentov is the expert on how difficult this would be to implement.
Without auspice.json
, tree display wouldn't be possible, but maybe one can simply disable that view in this mode. Same for all download options (like aligned.fasta)
This feature was often requested https://github.com/nextstrain/nextclade/issues/211 since the very beginning of Nextclade.
Some time ago I already considered how to implement it and git a prototype https://github.com/nextstrain/nextclade/pull/282. To make it properly it would require some breaking changes to the results JSON format https://github.com/nextstrain/nextclade/issues/212 and, as already pointed out, making decisions about the information that is missing from it. Some rearrangement of internal data structures would also be required - many fields would become optional, which is a great way to introduce some crashes to a JS app.
Since that time we've added even more features, so things might have become even more complicated. We have non-trivial dependencies between inputs and results: the gene map is required to reason about genes, the tree now serves as a source of information for dynamic columns, etc. So even more decisions to be made.
This seems to be a popular request, so I might take another look at it all. The first step will be to figure out all the pieces of information that are required, but not in the JSON and to decide what to do about it. The loading of the existing data should be relatively straightforward. And display logic should be almost intact, barring the missing pieces.
Given that the output JSON file isn't currently read in by anything and I don't think there's currently any guarantees made about the structure of what's in there, I don't think most users would be affected by any breaking changes to that file in order to give it the needed payload.
I think ultimately it's a request for some visual front-end to what nextclade CLI provides, which currently doesn't exist, because the web tool doesn't allow the user to get in between the analysis and visualization piece in the same way that the augur-auspice separation allows.
Another Nextclade user asked about this on our discussion forum: https://discussion.nextstrain.org/t/is-there-any-way-to-locally-view-the-result-like-clades-nextstrain-org/1233/3