Add private_api/proteins/count and private_api/proteins/filter endpoints #65
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.
This PR implements two new private_api endpoints for the proteins, and makes changes to the output and input of the existing
private_api/proteins
endpoint.private_api/proteins
The existing implementation has been replaced. If all proteins that match a given peptide are required, you should use
api/v2/pept2prot
instead ofprivate_api/proteins
. The new implementation of this endpoint requires a JSON-object with one keyaccessions
. This is a list of UniProt accession IDs for which the name, db_type and taxon will be returned.Example
Input
Output
private_api/proteins/count
A new endpoint that accepts one filter argument (string). It will then return the amount of UniProtKB entries in the Unipept database that match the filter. This endpoint counts UniProt entries where either:
NOTE: This endpoint will return either the correct count if less than 100 000 entries match, or 100 000 if it's more.
Example
Input
Output
private_api/proteins/filter
A new endpoint that accepts a filter argument (string) and then information required to perform correct pagination of the returned results (
start
: required,end
: required,sort_by
: optional andsort_descending
: optional). It will return all UniProt accession IDs of the UniProtKB entries in the Unipept database that match the filter and are in between the given bounds. Endpoint returns accession IDs where either:Example
Input