-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from cancervariants/staging
Staging
- Loading branch information
Showing
21 changed files
with
2,141 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[run] | ||
source = | ||
evidence/ | ||
tests/ | ||
omit = | ||
setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[flake8] | ||
ignore = D205, D400, I101, ANN101, ANN002, ANN003 | ||
max-line-length = 88 | ||
exclude = | ||
.git | ||
venv | ||
__pycache__ | ||
source | ||
outputs | ||
evidence/version.py | ||
inline-quotes = " | ||
import-order-style = pep8 | ||
application-import-names = | ||
evidence | ||
tests | ||
per-file-ignores = | ||
tests/*:ANN001, ANN2 | ||
setup.py:F821 | ||
*__init__.py:F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v1.4.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-docstrings, flake8-quotes, flake8-import-order, flake8-annotations] | ||
- id: check-added-large-files | ||
- id: detect-private-key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
pydantic = "*" | ||
requests = "*" | ||
bravado = "*" | ||
matplotlib = "*" | ||
seaborn = "*" | ||
variation-normalizer = "*" | ||
pandas = "*" | ||
openpyxl = "*" | ||
xlrd = "*" | ||
xlwt = "*" | ||
fastapi = "*" | ||
boto3 = "*" | ||
|
||
[dev-packages] | ||
evidence = {editable = true, path = "."} | ||
pytest = "*" | ||
pre-commit = "*" | ||
flake8 = "*" | ||
flake8-docstrings = "*" | ||
flake8-quotes = "*" | ||
flake8-annotations = "*" | ||
flake8-import-order = "*" | ||
coverage = "*" | ||
pytest-cov = "*" | ||
ipykernel = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,63 @@ | ||
# evidence-normalization | ||
# Evidence Normalization | ||
|
||
Service for normalizing evidence | ||
|
||
## Developer instructions | ||
|
||
The following sections include instructions specifically for developers. | ||
|
||
### Installation | ||
For a development install, we recommend using Pipenv. See the | ||
[pipenv docs](https://pipenv-fork.readthedocs.io/en/latest/#install-pipenv-today) | ||
for direction on installing pipenv in your compute environment. | ||
|
||
Once installed, from the project root dir, just run: | ||
|
||
```commandline | ||
pipenv shell | ||
pipenv lock && pipenv sync | ||
``` | ||
|
||
### Backend Services | ||
|
||
Evidence Normalization relies on [Variation Normalization](https://github.com/cancervariants/variation-normalization) for normalizing Cancer Hotspots data. You will need to setup backend services and set the appropriate environment variables. See the [README](https://github.com/cancervariants/variation-normalization#variation-normalization) for more information. | ||
|
||
|
||
### Starting the Evidence Normalization Service Locally | ||
|
||
To start the service, run the following: | ||
|
||
```commandline | ||
uvicorn evidence.main:app --reload | ||
``` | ||
|
||
Next, view the OpenAPI docs on your local machine: | ||
http://127.0.0.1:8000/evidence | ||
|
||
### Init coding style tests | ||
|
||
Code style is managed by [flake8](https://github.com/PyCQA/flake8) and checked prior to commit. | ||
|
||
We use [pre-commit](https://pre-commit.com/#usage) to run conformance tests. | ||
|
||
This ensures: | ||
|
||
* Check code style | ||
* Check for added large files | ||
* Detect AWS Credentials | ||
* Detect Private Key | ||
|
||
Before first commit run: | ||
|
||
```commandline | ||
pre-commit install | ||
``` | ||
|
||
|
||
### Running unit tests | ||
|
||
Running unit tests is as easy as pytest. | ||
|
||
```commandline | ||
pipenv run pytest | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""The VICC library for normalizing evidence""" | ||
from pathlib import Path | ||
from os import environ | ||
import logging | ||
|
||
APP_ROOT = Path(__file__).resolve().parents[0] | ||
DATA_DIR_PATH = APP_ROOT / "data" | ||
SEQREPO_DATA_PATH = environ.get("SEQREPO_DATA_PATH", "/usr/local/share/seqrepo/latest") | ||
|
||
if environ.get("EVIDENCE_PROD") == "True": | ||
ENV_NAME = "PROD" | ||
environ["VARIATION_NORM_EB_PROD"] = "True" | ||
environ["GENE_NORM_EB_PROD"] = "True" | ||
else: | ||
ENV_NAME = "DEV" | ||
|
||
logging.basicConfig( | ||
filename="evidence-normalizer.log", | ||
format="[%(asctime)s] - %(name)s - %(levelname)s : %(message)s" | ||
) | ||
logger = logging.getLogger("evidence") | ||
logger.setLevel(logging.DEBUG) | ||
|
||
logging.getLogger("bravado").setLevel(logging.INFO) | ||
logging.getLogger("bravado_core").setLevel(logging.INFO) | ||
logging.getLogger("boto3").setLevel(logging.INFO) | ||
logging.getLogger("botocore").setLevel(logging.INFO) | ||
logging.getLogger("python_jsonschema_objects").setLevel(logging.INFO) | ||
logging.getLogger("swagger_spec_validator").setLevel(logging.INFO) | ||
logging.getLogger("urllib3").setLevel(logging.INFO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""Import data sources""" | ||
from .gnomad import GnomAD | ||
from .cbioportal import CBioPortal | ||
from .cancer_hotspots import CancerHotspots |
Oops, something went wrong.