A protein graph REST-API to query generated pickle
-graphs from ProtGraph.
This project currently only allows to query peptides from already known paths. Therefore, there is currently only one possible query-point.
To query a peptide (with a given path, here 0->2->4->177
), access the following url: <url>/ACCESSION/path_to_peptide?path=0,2,4,177
.
It will return the peptide in plain text, which can be then parsed. It is also possible to query multiple paths at once, yielding
a new line seperated list of the corresponding peptides.
curl http://localhost:8000/A0A4S5AXF8/path_to_pep?path=0,13,14,15,16,245
VASS
curl http://localhost:8000/A0A4S5AXF8/path_to_pep?path=0,13,14,15,16,245&path=0,14,15,16,17,245
VASS
ASSM
More Examples can be found under <url>/swagger
. The OpenAPI-yaml specification is located in the folder resources
.
To start this project, clone it first via git
.
Install the dependencies via pipenv install
and start the shell with: pipenv shell
Currently the entrypoint is: main.py
To start ProtGraphREST, you need to specificy a base folder, which contains exported pickle
files from ProtGraph.
Make sure to export those graphs via the additonal argument (-edirs
), so that ProtGraphREST can access the generated graphs.
Example:
Graphs were or are currently generated by ProtGraph in /test/examples/
(via -epickle
, -edirs
)
Simply run: python main.py /test/examples
and the graphs can then be queried via REST.