Open corneliusroemer opened 1 year ago
That's already possible through the API. I just have to document it.
Don't worry about losing the data. I maintain daily backups.
Excellent, thanks :)
Hi all, would it be possible to have these Collections tables downloadable as a csv right off the page? e.g. you choose a baseline, it generates the table, and then you can export it with a csv button? thanks
Regarding importing/updating a collection, let me just document the API here for now because it still might be changed.
After creating a collection, it can be updated by sending a PUT
request to the following URL:
https://cov-spectrum.org/api/v2/resource/collection/<collection ID>?adminKey=<admin key>
with the following body:
{
"id": ...,
"title": "...",
"description": "...",
"maintainers": "...",
"email": "...",
"variants":
[
{
"name": "...",
"description": "...",
"highlighted": false,
"query": "{\"aaMutations\":[\"S:S371F\", \"S:Q498R\"],\"nucMutations\":[],\"aaInsertions\":[],\"nucInsertions\":[],\"nextcladePangoLineage\":\"BA.4*\"}",
},
{
"name": "...",
"description": "...",
"highlighted": false,
"query": "{\"variantQuery\":\"nextcladePangoLineage:BA.5*\"}",
},
]
}
The highlighted
field corresponds to the star. The query
field contains a JSON as string. It defines either a normal search and can have the fields aaMutations, nucMutations, aaInsertions, nucInsertions, pangoLineage, nextcladePangoLineage, and nextstrainClade
(does not need to have all the fields). Or it defines an advanced search, then it has only the field variantQuery
.
Hi all, would it be possible to have these Collections tables downloadable as a csv right off the page? e.g. you choose a baseline, it generates the table, and then you can export it with a csv button? thanks
Thanks for add this feature! :)
@murallcl, thanks for suggesting it!
I was wondering if it was possible to save the work we do on collections in case something happens, e.g. compromised password or outage etc.
Once export works, one could also do import.
That may also open the door to auto-generated collections, e.g. one could quickly programatically create a collection for all pango lineages etc.