Requirements and Installation¶
Requirements¶
Software¶
- Python 2.7.10+
- pyenv
- pyenv virtualenv
- pip
Python Modules¶
- DMP
- Flask
- Flask-Restful
- pytest
- Waitress
- Sphinx
- sphinx-autobuild
Installation¶
Basics¶
Directly from GitHub:
1 2 3 4 | git clone https://github.com/Multiscale-Genomics/mg-rest-dm.git
cd mg-rest-dm/
pip install -e .
pip install -r requirements.txt
|
Using pip:
1 | pip install git+https://github.com/Multiscale-Genomics/mg-rest-dm.git
|
Setting up a server¶
1 2 3 4 5 6 7 8 | git clone https://github.com/Multiscale-Genomics/mg-rest-dm.git
cd mg-rest-dm
pyenv virtualenv 2.7.12 mg-rest-dm
pyenv activate mg-rest-dm
pip install git+https://github.com/Multiscale-Genomics/mg-dm-api.git
pip install -e .
pyenv deactivate
|
Requires a file with the name mongodb.cnf with the following parameters to define the MongoDB server:
1 2 3 4 5 6 | [dmp]
host = localhost
port = 27017
user = testuser
pass = test123
db = dmp
|
Customise the rest/auth_meta.json file to locate the authentication server
Starting the service:
1 | nohup ${PATH_2_PYENV}/versions/2.7.12/envs/mg-rest-dm/bin/waitress-serve --listen=127.0.0.1:5002 rest.app:APP &
|
Testing¶
Test scripts are located in the test/ directory. Run pytest to from the root repository directory to ensure that the API is working correctly.
The scripts require a valid hdf5 file generated using the scripts from mg-dm-api and a matching datasets.json file located in the rest/ directory
Documentation¶
To build the documentation:
1 2 3 4 | pip install Sphinx
pip install sphinx-autobuild
cd docs
make html
|