feat(backend): add backend API support for generalized collections#1076
Open
feat(backend): add backend API support for generalized collections#1076
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #1045
Summary
Adds collections:
{ "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My Variant Collection", "ownedBy": "user123", "organism": "covid", "description": "A collection tracking important SARS-CoV-2 variants", "variants": [ { "type": "query", "id": "660e8400-e29b-41d4-a716-446655440001", "collectionId": "550e8400-e29b-41d4-a716-446655440000", "name": "BA.2 in USA", "description": "BA.2 lineage cases in the United States", "countQuery": "country='USA' & lineage='BA.2'", "coverageQuery": "country='USA'" }, { "type": "mutationList", "id": "660e8400-e29b-41d4-a716-446655440002", "collectionId": "550e8400-e29b-41d4-a716-446655440000", "name": "Omicron Key Mutations", "description": "Important spike protein mutations for Omicron", "mutationList": { "aaMutations": ["S:N501Y", "S:E484K", "S:K417N"] } } ] }A collection has a name and description and a list of variants. A variant is either defined as a lineage and a set of mutations, or as a query (just a string).
A collection has an owner and only the owner can modify or delete a collection. All collections are public.
New endpoints
For the updating of collections: Name, description and variants can be updated independently, only the one you want to update needs to be supplied. For the variant list though, for each variant if you want to update one property, all other properties must also be given. This is where I think maybe we can change stuff later. It is easiest to do it like this though, also if you want to maybe remove the optional coverage query, its easy to implement like this.
Variants
A variant is either defined as a count (and optional coverage) query or as a list of mutations; the format is copied from how it is done in CovSpectrum:
{ "nextcladePangoLineage": "BA.2", "aaMutations": [ "S:N501Y", "ORF1a:P3395H", "ORF1b:P314L", ], "nucMutations": [ "C241T", "C3037T", "A23063T" ], "aaInsertions": [ "S:214:EPE", ], "nucInsertions": [], }Other changes
I've added a new Docker Compose file to spin up a dev database.
PR Checklist