haddock3
haddock3 copied to clipboard
Makes haddock3 restraints subcommands available as web service
You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines and that you comply with the following criteria:
- [x] You have sticked to Python. Please talk to us before adding other programming languages to HADDOCK3
- [ ] Your PR is about CNS
- [x] Your code is well documented: proper docstrings and explanatory comments for those tricky parts
- [x] You structured the code into small functions as much as possible. You can use classes if there is a (state) purpose
- [ ] Your code follows our coding style
- [ ] You wrote tests for the new code
- [ ]
tox
tests pass. Runtox
command inside the repository folder - [ ]
-test.cfg
examples execute without errors. Insideexamples/
runpython run_tests.py -b
- [ ] PR does not add any dependencies, unless permission granted by the HADDOCK team
- [x] PR does not break licensing
- [ ] Your PR is about writing documentation for already existing code :fire:
- [ ] Your PR is about writing tests for already existing code :godmode:
In the haddock3 webapp I want to make a restraints file (*.tbl) from a list of active residues in 2 models/structures/molecules. I decided not to replicate that algorithm or have a complicated shell script behind a generic web service, but make the web service part of haddock3 repo. As the web service only exposes endpoints that are quick and do not need cns.
With this PR you can do
pip install fastapi uvicorn
uvicorn --port 5000 haddock.clis.restraints.webservice:app
This have the Swagger UI running at http://127.0.0.1:5000/docs#/