MyGeneset.info is a web API for storing, searching, and accessing geneset data.
- Python>=3.6 (Python versions lower than 3.8 also require PyPI package
singledispatchmethod
) - Git
- MongoDB
- Elasticsearch>=6.0.0
Elasticsearch and MongoDB can be installed locally, or run from Docker containers:
MongoDB:
docker run -d -p 27017-27019:27017-27019 --name mongodb mongo:latest
Elasticsearch:
docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --name elasticsearch docker.elastic.co/elasticsearch/elasticsearch:7.17.1
git clone https://github.com/biothings/mygeneset.info.git
mkdir -p ~/venvs
virtualenv ~/venvs/mygeneset
source ~/venvs/mygeneset/bin/activate
cd mygeneset.info
pip install -r ./requirements_hub.txt
cd src
vim config.py
from config_hub import * # Add additional customizations
# from src folder:
ssh-keygen -f bin/ssh_host_key
# from src folder:
python -m bin.hub
Navigate to "https://studio.biothings.io/" and create a connection to http://localhost:HUB_API_PORT
,
in which HUB_API_PORT
is the port number specified in your configuration (default is 19480).
MongoDB is not required for running the web server
- Python>=3.6 (Python versions lower than 3.8 also require PyPI package
singledispatchmethod
) - Git
- Elasticsearch>=6.0.0 (See installation steps above)
pip install -r ./requirements_web.txt
The API configuration file is located under /src/config_web.py
.
The value of STATUS_CHECK.id should match an _id
in the data.
STATUS_CHECK = {
'id': 'WP4966',
'index': 'mygeneset_current',
'doc_type': 'geneset'
}
You can override any settings from config_web.py
in config.py
:
from config_web import * # Add additional customizations
Some required configurations:
```python
# A random string
COOKIE_SECRET =
# GitHub keys
GITHUB_CLIENT_ID =
GITHUB_CLIENT_SECRET =
# ORCID keys
ORCID_CLIENT_ID =
ORCID_CLIENT_SECRET =
WEB_HOST = "http://localhost:8000"
# Path to local webapp folder
FRONTEND_PATH =
```
FRONTEND_PATH
is only required for running the API with the user interface. You need to first clone and build the web app project: "https://github.com/biothings/mygeneset.info-website"
The ES indices defined in the ES_INDEX
setting must exist.
For example:
```bash
# Creating an empty user_genesets index
curl -X PUT "localhost:9200/user_genesets"
```
python index.py
For launching alongside the web app:
python index.py --webapp
To see debugging messages:
python index.py --debug