Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename variant->variation services #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@ data/
# services
therapy-normalization/
gene-normalization/
variant-normalization/
variation-normalization/
disease-normalization/
metakb/
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You will need to clone services repositories.
git clone https://github.com/cancervariants/disease-normalization
git clone https://github.com/cancervariants/gene-normalization
git clone https://github.com/cancervariants/therapy-normalization
git clone https://github.com/cancervariants/variant-normalization
git clone https://github.com/cancervariants/variation-normalization
```


Expand Down Expand Up @@ -90,17 +90,17 @@ dc exec gene sh -c "pipenv run python3 -m gene.cli --update_all"
```


* Variant
* Variation

```
#
# Variant normalizer will read from variant/data/seqrepo/latest
# Variation normalizer will read from variation/data/seqrepo/latest
# so, in the host os, navigate to data/gene/seqrepo and `ln -s`
#
ln -s 2020-11-27 latest
#
# then, in docker compose, we map the seqrepo we setup for gene to the variant container
# `- ./data/gene/seqrepo:/app/variant/data/seqrepo`
# then, in docker compose, we map the seqrepo we setup for gene to the variation container
# `- ./data/gene/seqrepo:/app/variation/data/seqrepo`
#
```

Expand All @@ -122,7 +122,7 @@ dynamodb /docker-entrypoint.py --sm ... Up 10000/tcp, 22/tcp, 70
gene /bin/sh -c pipenv run uvic ... Up (healthy) 0.0.0.0:8002->80/tcp
test /bin/sh -c tail -f /dev/null Up
therapy /bin/sh -c pipenv run uvic ... Up (healthy) 0.0.0.0:8001->80/tcp
variant /bin/sh -c pipenv run uvic ... Up (healthy) 0.0.0.0:8003->80/tcp
variation /bin/sh -c pipenv run uvic ... Up (healthy) 0.0.0.0:8003->80/tcp
```


Expand Down Expand Up @@ -155,7 +155,7 @@ du -sh ./data/*
14G ./data/gene
1.5G ./data/scylla
20G ./data/therapy
38M ./data/variant
38M ./data/variation
```


Expand All @@ -168,7 +168,7 @@ docker-compose exec test sh -c "pipenv run pytest tests/integration"
tests/integration/test_disease.py ...
tests/integration/test_gene.py ...
tests/integration/test_therapy.py ...
tests/integration/test_variant.py ...
tests/integration/test_variation.py ...

```

Expand Down
Binary file modified docker-compose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ services:
- "dynamodb"
volumes:
- ./data/gene:/app/gene/data
# The variant service
variant:
build: variant-normalization
hostname: variant
container_name: variant
# The variation service
variation:
build: variation-normalization
hostname: variation
container_name: variation
environment:
# variant shares gene's db
# variation shares gene's db
- GENE_NORM_DB_URL=http://dynamodb:8000
# read from .env file
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-dev}
Expand All @@ -84,10 +84,10 @@ services:
depends_on:
- "dynamodb"
volumes:
# The variant service has packaged data at variant/data,
# so we do not map a host directory to variant/data.
# The variation service has packaged data at variation/data,
# so we do not map a host directory to variation/data.
# We do share seqrepo already harvested for gene
- ./data/gene/seqrepo:/app/variant/data/seqrepo
- ./data/gene/seqrepo:/app/variation/data/seqrepo
# The disease service
disease:
build: disease-normalization
Expand Down Expand Up @@ -146,7 +146,7 @@ services:
depends_on:
- "neo4j"
- "disease"
- "variant"
- "variation"
- "gene"
- "therapy"
volumes:
Expand All @@ -166,7 +166,7 @@ services:
- ./test/tests:/app/tests
depends_on:
- "disease"
- "variant"
- "variation"
- "gene"
- "therapy"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@


def test_server_alive():
"""Variant server should return 200."""
response = requests.get("http://variant/variant")
"""Variation server should return 200."""
response = requests.get("http://variation/variation")
assert response.status_code == 200, test_server_alive.__doc__


def test_swagger_ui():
"""Variant server should return swagger UI 'FastAPI - Swagger UI'."""
response = requests.get("http://variant/variant")
"""Variation server should return swagger UI 'FastAPI - Swagger UI'."""
response = requests.get("http://variation/variation")
assert response.status_code == 200, test_swagger_ui.__doc__
assert 'FastAPI - Swagger UI' in response.text, test_swagger_ui.__doc__


def test_query():
"""Variant server should find `BRAF V600E`."""
url = "http://variant/variant/normalize?q=BRAF%20V600E"
"""Variation server should find `BRAF V600E`."""
url = "http://variation/variation/normalize?q=BRAF%20V600E"
headers = {'accept': 'application/json'}
response = requests.get(url, headers=headers)
assert response.status_code == 200, test_query.__doc__