anyvar 1.0.0__tar.gz → 1.1.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.env.example +5 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/workflows/python-package.yml +37 -41
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.gitignore +5 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.pre-commit-config.yaml +18 -8
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.readthedocs.yaml +4 -3
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.service_info_example.yaml +3 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/Dockerfile +1 -1
- anyvar-1.1.0.dev1/HISTORY.md +19 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/Makefile +2 -2
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/PKG-INFO +14 -25
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/README.md +1 -0
- anyvar-1.1.0.dev1/alembic/README +1 -0
- anyvar-1.1.0.dev1/alembic/env.py +72 -0
- anyvar-1.1.0.dev1/alembic/script.py.mako +28 -0
- anyvar-1.1.0.dev1/alembic/versions/18469f31ca97_initial_schema.py +156 -0
- anyvar-1.1.0.dev1/alembic.ini +93 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/compose.yaml +2 -1
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/_templates/module_summary.rst +0 -1
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/_templates/module_summary_no_inherit.rst +0 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/anyvar.anyvar.rst +1 -1
- anyvar-1.1.0.dev1/docs/source/api/anyvar.core.categorical_variants.rst +8 -0
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/anyvar.core.metadata.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/anyvar.core.objects.rst +1 -1
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/api/api/queueing/anyvar.queueing.celery_worker.rst +1 -1
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/api/index.rst +11 -5
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/mapping/anyvar.mapping.liftover.rst +1 -1
- anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.projection.rst +8 -0
- anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.projection_models.rst +8 -0
- anyvar-1.1.0.dev1/docs/source/api/mapping/anyvar.mapping.protocols.rst +8 -0
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/storage/anyvar.storage.base.rst +1 -1
- anyvar-1.1.0.dev1/docs/source/api/storage/anyvar.storage.duckdb.rst +9 -0
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/storage/anyvar.storage.mapper_registry.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/storage/anyvar.storage.mappers.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/storage/anyvar.storage.no_db.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/storage/anyvar.storage.orm.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/storage/anyvar.storage.postgres.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/translate/anyvar.translate.base.rst +1 -1
- anyvar-1.1.0.dev1/docs/source/api/translate/anyvar.translate.register.rst +8 -0
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/translate/anyvar.translate.vrs_python.rst +1 -1
- {anyvar-1.0.0/docs/source/api → anyvar-1.1.0.dev1/docs/source}/api/vcf/anyvar.vcf.ingest.rst +1 -1
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/async.rst +27 -4
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/index.rst +0 -2
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/storage.rst +9 -3
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/contributing.rst +3 -4
- anyvar-1.1.0.dev1/docs/source/features.rst +119 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/getting_started/manual_setup.rst +0 -1
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/usage/python.rst +17 -17
- anyvar-1.1.0.dev1/docs/source/usage/rest_api.rst +344 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/pyproject.toml +16 -8
- anyvar-1.1.0.dev1/src/anyvar/anyvar.py +448 -0
- anyvar-1.1.0.dev1/src/anyvar/core/categorical_variants.py +121 -0
- anyvar-1.1.0.dev1/src/anyvar/core/metadata.py +62 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/core/objects.py +8 -12
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/mapping/liftover.py +21 -21
- anyvar-1.1.0.dev1/src/anyvar/mapping/projection.py +1036 -0
- anyvar-1.1.0.dev1/src/anyvar/mapping/projection_models.py +112 -0
- anyvar-1.1.0.dev1/src/anyvar/mapping/protocols.py +44 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/queueing/celery_worker.py +50 -1
- anyvar-1.1.0.dev1/src/anyvar/restapi/__init__.py +20 -0
- anyvar-1.1.0.dev1/src/anyvar/restapi/async_utils.py +174 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/auth.py +1 -1
- anyvar-1.1.0.dev1/src/anyvar/restapi/categorical_variants_router.py +233 -0
- anyvar-1.1.0.dev1/src/anyvar/restapi/examples.py +499 -0
- anyvar-1.1.0.dev1/src/anyvar/restapi/main.py +176 -0
- anyvar-1.1.0.dev1/src/anyvar/restapi/objects_router.py +318 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/schema.py +77 -92
- anyvar-1.1.0.dev1/src/anyvar/restapi/variation_request.py +42 -0
- anyvar-1.1.0.dev1/src/anyvar/restapi/variations_router.py +334 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/vcf_router.py +97 -146
- anyvar-1.1.0.dev1/src/anyvar/restapi/vrs_objects.py +30 -0
- anyvar-1.1.0.dev1/src/anyvar/storage/alembic_config.py +13 -0
- anyvar-1.1.0.dev1/src/anyvar/storage/base.py +322 -0
- anyvar-1.1.0.dev1/src/anyvar/storage/duckdb.py +137 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/storage/mapper_registry.py +10 -3
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/storage/mappers.py +80 -14
- anyvar-1.1.0.dev1/src/anyvar/storage/no_db.py +110 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/storage/orm.py +31 -102
- anyvar-1.1.0.dev1/src/anyvar/storage/postgres.py +136 -0
- anyvar-1.1.0.dev1/src/anyvar/storage/sqlalchemy.py +605 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/translate/base.py +3 -13
- anyvar-1.1.0.dev1/src/anyvar/translate/register.py +170 -0
- anyvar-1.1.0.dev1/src/anyvar/translate/vrs_python.py +193 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/vcf/ingest.py +5 -3
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/PKG-INFO +14 -25
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/SOURCES.txt +59 -20
- anyvar-1.1.0.dev1/src/anyvar.egg-info/requires.txt +30 -0
- anyvar-1.1.0.dev1/src/anyvar.egg-info/scm_file_list.json +162 -0
- anyvar-1.1.0.dev1/src/anyvar.egg-info/scm_version.json +8 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/conftest.py +11 -26
- anyvar-1.1.0.dev1/tests/data/ucsc-chainfile/chainfile_hg19_to_hg38_.chain +56506 -0
- anyvar-1.1.0.dev1/tests/data/ucsc-chainfile/chainfile_hg38_to_hg19_.chain +236543 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/data/variations.json +81 -8
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/integration/restapi/conftest.py +39 -7
- anyvar-1.1.0.dev1/tests/integration/restapi/objects_router/test_extension.py +73 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/integration/restapi/objects_router/test_mappings.py +84 -23
- anyvar-1.1.0.dev1/tests/integration/restapi/objects_router/test_object.py +13 -0
- anyvar-1.1.0.dev1/tests/integration/restapi/test_catvars_router.py +331 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/integration/restapi/test_search_router.py +1 -1
- anyvar-1.1.0.dev1/tests/integration/restapi/variations_router/test_projection.py +661 -0
- anyvar-1.1.0.dev1/tests/integration/restapi/variations_router/test_projection_protein_edges.py +175 -0
- {anyvar-1.0.0/tests/integration/restapi/objects_router → anyvar-1.1.0.dev1/tests/integration/restapi/variations_router}/test_variation.py +43 -12
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/integration/restapi/vcf_router/test_annotate_vcf.py +8 -8
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/integration/restapi/vcf_router/test_ingest_vcf.py +13 -2
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/mapping/test_liftover.py +18 -24
- anyvar-1.1.0.dev1/tests/unit/mapping/test_projection.py +1630 -0
- anyvar-1.1.0.dev1/tests/unit/restapi/test_async_utils.py +237 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/restapi/test_meta_router.py +10 -0
- anyvar-1.1.0.dev1/tests/unit/restapi/test_objects_router.py +284 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/restapi/test_schema.py +7 -3
- anyvar-1.1.0.dev1/tests/unit/restapi/test_variations_router.py +278 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/storage/storage_test_funcs.py +156 -59
- anyvar-1.1.0.dev1/tests/unit/storage/test_duckdb.py +109 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/storage/test_postgres.py +21 -13
- anyvar-1.1.0.dev1/tests/unit/test_anyvar.py +55 -0
- anyvar-1.1.0.dev1/tests/unit/test_catvars.py +40 -0
- anyvar-1.1.0.dev1/tests/unit/translate/__init__.py +0 -0
- anyvar-1.1.0.dev1/tests/unit/translate/test_register.py +230 -0
- anyvar-1.1.0.dev1/tests/unit/translate/test_vrs_python.py +32 -0
- anyvar-1.1.0.dev1/tests/unit/translate/test_vrs_python_caching.py +188 -0
- anyvar-1.0.0/docs/source/configuration/snowflake.rst +0 -97
- anyvar-1.0.0/docs/source/features.rst +0 -74
- anyvar-1.0.0/docs/source/usage/rest_api.rst +0 -189
- anyvar-1.0.0/src/anyvar/anyvar.py +0 -266
- anyvar-1.0.0/src/anyvar/core/metadata.py +0 -41
- anyvar-1.0.0/src/anyvar/restapi/__init__.py +0 -1
- anyvar-1.0.0/src/anyvar/restapi/main.py +0 -101
- anyvar-1.0.0/src/anyvar/restapi/objects_router.py +0 -486
- anyvar-1.0.0/src/anyvar/restapi/search_router.py +0 -64
- anyvar-1.0.0/src/anyvar/storage/base.py +0 -200
- anyvar-1.0.0/src/anyvar/storage/no_db.py +0 -80
- anyvar-1.0.0/src/anyvar/storage/postgres.py +0 -407
- anyvar-1.0.0/src/anyvar/storage/snowflake.py +0 -754
- anyvar-1.0.0/src/anyvar/translate/vrs_python.py +0 -131
- anyvar-1.0.0/src/anyvar.egg-info/requires.txt +0 -43
- anyvar-1.0.0/tests/integration/restapi/objects_router/test_annotation.py +0 -63
- anyvar-1.0.0/tests/unit/storage/test_snowflake.py +0 -107
- anyvar-1.0.0/tests/unit/storage/test_snowflake_dyntable.py +0 -128
- anyvar-1.0.0/tests/unit/test_anyvar.py +0 -43
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.dockerignore +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.git-blame-ignore-revs +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/CODEOWNERS +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/ISSUE_TEMPLATE/bug-report.yaml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/ISSUE_TEMPLATE/feature-request.yaml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/labels.yml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/workflows/labels.yml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/workflows/release.yml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/.github/workflows/stale.yml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/CITATION.cff +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/LICENSE +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/Makefile +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/changelog.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/conf.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/authentication.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/docker_compose.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/dotenv_example.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/logging.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/configuration/service_info.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/getting_started/docker_compose.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/getting_started/index.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/help.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/index.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/license.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/usage/index.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/docs/source/usage/rest_service.rst +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/scripts/vcf_benchmark.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/setup.cfg +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/core/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/mapping/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/queueing/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/restapi/meta_router.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/storage/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/translate/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar/vcf/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/dependency_links.txt +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/src/anyvar.egg-info/top_level.txt +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/data/service_info_openapi.yaml +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/integration/restapi/objects_router/test_location.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/mapping/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/restapi/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/restapi/test_auth.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/storage/__init__.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/storage/conftest.py +0 -0
- {anyvar-1.0.0 → anyvar-1.1.0.dev1}/tests/unit/storage/test_no_db.py +0 -0
|
@@ -19,6 +19,11 @@ ANYVAR_SERVICE_INFO=./.service_info_example.yaml
|
|
|
19
19
|
## Logging - see "Configuration" -> "Logging" in the docs
|
|
20
20
|
ANYVAR_LOGGING_CONFIG=path/to/logging/config/file.yaml
|
|
21
21
|
|
|
22
|
+
## Projection - see "Features" -> "Variant Projection" in the docs
|
|
23
|
+
## Requires installing AnyVar with the projection extra and configured UTA/SeqRepo resources.
|
|
24
|
+
## Set to true to automatically store transcript/protein projections during registration.
|
|
25
|
+
ANYVAR_ENABLE_PROJECTION=false
|
|
26
|
+
|
|
22
27
|
## Celery - See "Configuration" -> "Asynchronous Processing" in the docs
|
|
23
28
|
CELERY_BROKER_URL=redis://localhost:6379/0
|
|
24
29
|
CELERY_BACKEND_URL=redis://localhost:6379/0
|
|
@@ -12,10 +12,10 @@ jobs:
|
|
|
12
12
|
name: lint
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
16
|
|
|
17
17
|
- name: Setup Python
|
|
18
|
-
uses: actions/setup-python@
|
|
18
|
+
uses: actions/setup-python@v6
|
|
19
19
|
with:
|
|
20
20
|
python-version: "3.11"
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ jobs:
|
|
|
25
25
|
enable-cache: true
|
|
26
26
|
|
|
27
27
|
- name: Install dependencies
|
|
28
|
-
run: uv sync --
|
|
28
|
+
run: uv sync --group dev
|
|
29
29
|
|
|
30
30
|
- name: Check style
|
|
31
31
|
run: uv run ruff check && uv run ruff format --check
|
|
@@ -35,44 +35,49 @@ jobs:
|
|
|
35
35
|
strategy:
|
|
36
36
|
matrix:
|
|
37
37
|
python-version: ["3.11", "3.12", "3.13"]
|
|
38
|
+
storage:
|
|
39
|
+
- backend: postgres
|
|
40
|
+
uri: postgresql://postgres:postgres@localhost:5432/postgres
|
|
41
|
+
deps:
|
|
42
|
+
|
|
43
|
+
- backend: duckdb
|
|
44
|
+
uri: duckdb:///variants.duckdb
|
|
45
|
+
deps: '--extra duckdb'
|
|
38
46
|
services:
|
|
39
|
-
|
|
40
|
-
image:
|
|
41
|
-
env:
|
|
42
|
-
POSTGRES_PASSWORD: postgres
|
|
43
|
-
options: >-
|
|
44
|
-
--health-cmd pg_isready
|
|
45
|
-
--health-interval 10s
|
|
46
|
-
--health-timeout 5s
|
|
47
|
-
--health-retries 5
|
|
47
|
+
redis:
|
|
48
|
+
image: redis:alpine
|
|
48
49
|
ports:
|
|
49
|
-
-
|
|
50
|
+
- 6379:6379
|
|
50
51
|
steps:
|
|
51
|
-
- uses: actions/checkout@
|
|
52
|
+
- uses: actions/checkout@v6
|
|
53
|
+
|
|
54
|
+
- name: Start Postgres
|
|
55
|
+
if: matrix.storage.backend == 'postgres'
|
|
56
|
+
run: |
|
|
57
|
+
docker run -d \
|
|
58
|
+
--name postgres \
|
|
59
|
+
-e POSTGRES_PASSWORD=postgres \
|
|
60
|
+
-p 5432:5432 \
|
|
61
|
+
postgres:17
|
|
52
62
|
|
|
53
63
|
- name: Wait for Postgres
|
|
64
|
+
if: matrix.storage.backend == 'postgres'
|
|
54
65
|
run: |
|
|
55
66
|
for i in {1..30}; do
|
|
56
67
|
pg_isready -h localhost -p 5432 -U postgres && exit 0
|
|
57
68
|
sleep 1
|
|
58
69
|
done
|
|
70
|
+
docker logs postgres
|
|
59
71
|
exit 1
|
|
60
72
|
|
|
61
|
-
- name: Initialize GiST extension
|
|
62
|
-
env:
|
|
63
|
-
PGPASSWORD: postgres
|
|
64
|
-
run: |
|
|
65
|
-
psql -h localhost -p 5432 -U postgres -d postgres \
|
|
66
|
-
-c "CREATE EXTENSION IF NOT EXISTS btree_gist;"
|
|
67
|
-
|
|
68
73
|
- name: Cache chainfiles for liftover
|
|
69
|
-
uses: actions/cache@
|
|
74
|
+
uses: actions/cache@v5
|
|
70
75
|
with:
|
|
71
76
|
path: ~/.local/share/wags_tails
|
|
72
77
|
key: ${{ runner.os }}-test-${{ hashFiles('pyproject.toml') }}
|
|
73
78
|
|
|
74
79
|
- name: Setup Python
|
|
75
|
-
uses: actions/setup-python@
|
|
80
|
+
uses: actions/setup-python@v6
|
|
76
81
|
with:
|
|
77
82
|
python-version: ${{ matrix.python-version }}
|
|
78
83
|
|
|
@@ -82,41 +87,32 @@ jobs:
|
|
|
82
87
|
enable-cache: true
|
|
83
88
|
|
|
84
89
|
- name: Install dependencies
|
|
85
|
-
run: uv sync --
|
|
90
|
+
run: uv sync --group test --extra queueing ${{ matrix.storage.deps }}
|
|
86
91
|
|
|
87
92
|
- name: Run tests
|
|
88
93
|
run: uv run pytest -vv -m "ci_ok"
|
|
89
94
|
env:
|
|
90
|
-
ANYVAR_TEST_STORAGE_URI:
|
|
95
|
+
ANYVAR_TEST_STORAGE_URI: ${{ matrix.storage.uri }}
|
|
96
|
+
CELERY_BROKER_URL: redis://localhost:6379/0
|
|
91
97
|
|
|
92
98
|
precommit_hooks:
|
|
93
99
|
runs-on: ubuntu-latest
|
|
94
|
-
strategy:
|
|
95
|
-
matrix:
|
|
96
|
-
cmd:
|
|
97
|
-
- "end-of-file-fixer"
|
|
98
|
-
- "trailing-whitespace"
|
|
99
|
-
- "mixed-line-ending"
|
|
100
100
|
steps:
|
|
101
|
-
- uses: actions/checkout@
|
|
101
|
+
- uses: actions/checkout@v6
|
|
102
102
|
|
|
103
|
-
-
|
|
104
|
-
uses: actions/setup-python@v5
|
|
103
|
+
- uses: j178/prek-action@v2
|
|
105
104
|
with:
|
|
106
|
-
|
|
105
|
+
extra_args: '--all-files --skip "ruff-format" --skip "ruff-check"'
|
|
107
106
|
|
|
108
|
-
- uses: pre-commit/action@v3.0.1
|
|
109
|
-
with:
|
|
110
|
-
extra_args: ${{ matrix.cmd }} --all-files
|
|
111
107
|
docs:
|
|
112
108
|
runs-on: ubuntu-latest
|
|
113
109
|
env:
|
|
114
110
|
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
115
111
|
steps:
|
|
116
|
-
- uses: actions/checkout@
|
|
112
|
+
- uses: actions/checkout@v6
|
|
117
113
|
|
|
118
114
|
- name: Set up Python
|
|
119
|
-
uses: actions/setup-python@
|
|
115
|
+
uses: actions/setup-python@v6
|
|
120
116
|
with:
|
|
121
117
|
python-version: 3.11
|
|
122
118
|
|
|
@@ -126,7 +122,7 @@ jobs:
|
|
|
126
122
|
enable-cache: true
|
|
127
123
|
|
|
128
124
|
- name: Install dependencies
|
|
129
|
-
run: uv sync --
|
|
125
|
+
run: uv sync --group docs
|
|
130
126
|
|
|
131
127
|
- name: Attempt docs build
|
|
132
128
|
working-directory: ./docs
|
|
@@ -53,6 +53,7 @@ coverage.xml
|
|
|
53
53
|
.pytest_cache/
|
|
54
54
|
anyvar-test.duckdb
|
|
55
55
|
tests/tmp_async_work_dir
|
|
56
|
+
tests/data/ncbi*
|
|
56
57
|
|
|
57
58
|
# Translations
|
|
58
59
|
*.mo
|
|
@@ -124,3 +125,7 @@ docker/data*
|
|
|
124
125
|
|
|
125
126
|
# logging configs
|
|
126
127
|
logging.yaml
|
|
128
|
+
|
|
129
|
+
# test data stuff
|
|
130
|
+
tests/data/ncbi_lrg_refseqgene
|
|
131
|
+
tests/data/ncbi_mane_summary
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
+
exclude: ^tests/data/ucsc-chainfile/
|
|
2
|
+
|
|
1
3
|
repos:
|
|
2
4
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
-
rev:
|
|
5
|
+
rev: v6.0.0 # pre-commit-hooks version
|
|
6
|
+
hooks:
|
|
7
|
+
- id: detect-aws-credentials
|
|
8
|
+
args: [ --allow-missing-credentials ]
|
|
9
|
+
- repo: builtin
|
|
4
10
|
hooks:
|
|
5
|
-
- id: check-added-large-files
|
|
6
|
-
- id: detect-private-key
|
|
7
11
|
- id: trailing-whitespace
|
|
12
|
+
- id: check-added-large-files
|
|
13
|
+
args: ['--maxkb=1500']
|
|
14
|
+
- id: check-case-conflict
|
|
8
15
|
- id: end-of-file-fixer
|
|
9
16
|
exclude: "^docs/source/_templates/.*\\.rst"
|
|
10
|
-
- id:
|
|
11
|
-
- id:
|
|
12
|
-
|
|
17
|
+
- id: fix-byte-order-marker
|
|
18
|
+
- id: check-json
|
|
19
|
+
- id: check-toml
|
|
20
|
+
- id: check-yaml
|
|
13
21
|
- id: mixed-line-ending
|
|
14
22
|
args: [ --fix=lf ]
|
|
23
|
+
- id: check-merge-conflict
|
|
24
|
+
- id: detect-private-key
|
|
15
25
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
16
26
|
rev: v0.12.8 # ruff version
|
|
17
27
|
hooks:
|
|
18
28
|
- id: ruff-format
|
|
19
|
-
- id: ruff
|
|
29
|
+
- id: ruff-check
|
|
20
30
|
args: [ --fix, --exit-non-zero-on-fix ]
|
|
21
|
-
|
|
31
|
+
minimum_prek_version: 0.2.23
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
version: 2
|
|
2
2
|
|
|
3
3
|
build:
|
|
4
|
-
os: "ubuntu-
|
|
4
|
+
os: "ubuntu-24.04"
|
|
5
5
|
tools:
|
|
6
6
|
python: "3.11"
|
|
7
|
+
jobs:
|
|
8
|
+
post_install:
|
|
9
|
+
- pip install --group docs
|
|
7
10
|
|
|
8
11
|
python:
|
|
9
12
|
install:
|
|
10
13
|
- method: pip
|
|
11
14
|
path: .
|
|
12
|
-
extra_requirements:
|
|
13
|
-
- docs
|
|
14
15
|
|
|
15
16
|
sphinx:
|
|
16
17
|
configuration: docs/source/conf.py
|
|
@@ -21,7 +21,7 @@ COPY pyproject.toml /app/pyproject.toml
|
|
|
21
21
|
COPY src /app/src
|
|
22
22
|
COPY .git /app/.git
|
|
23
23
|
ENV PATH=/app/venv/bin:$PATH
|
|
24
|
-
RUN pip install -e '.[
|
|
24
|
+
RUN pip install -e '.[queueing,postgres,projection]' --group dev --group test
|
|
25
25
|
|
|
26
26
|
FROM python:3.12-slim AS anyvar
|
|
27
27
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
> This file was merged into this repo in [PR #516](https://github.com/biocommons/anyvar/pull/516), before the repo was transferred to the GA4GH organization. It should stay at the root of this repo tree.
|
|
2
|
+
|
|
3
|
+
# AnyVar History
|
|
4
|
+
|
|
5
|
+
AnyVar was conceived of and prototyped by [Reece Hart](https://github.com/reece) in 2018 and placed in the [biocommons](https://biocommons.org/) organization. Reece received funding as a contractor from ClinGen, through [Heidi Rehm](https://github.com/heidirehm) and [Larry Babb](https://github.com/larrybabb), to work on the [Variation Representation Specification](https://vrs.ga4gh.org/) and the [vrs-python reference implementation](https://github.com/ga4gh/vrs-python/) on which AnyVar relies, and later to extend the capabilities of AnyVar. By mid-2020, the AnyVar prototype could ingest [ClinVar](https://www.ncbi.nlm.nih.gov/clinvar/) and provide variant registration and lookup services.
|
|
6
|
+
|
|
7
|
+
Development accelerated in 2025, when [Alex Wagner](https://github.com/ahwagner) and Larry began marshalling contributors who made valuable and extensive improvements to AnyVar's reliability, features, scalability, speed, and documentation. This work was supported by grants to Nationwide Children's Hospital from the National Human Genome Research Institute ([R35HG011949](https://reporter.nih.gov/search/PIYRhS3-ekKt1ML-i1swbA/project-details/11145058#description) and [U54HG012513](https://reporter.nih.gov/search/_mu1vkP9bEKhs72h0J0qMA/project-details/11173581#description)), and the National Cancer Institute [U24CA305456](https://reporter.nih.gov/search/n75Z4bNlv0SZ3vBVd1ktHA/project-details/11232677). By November 2025, the Nationwide Children's Hospital (NCH) and Broad Institute teams had written most of the code and built the project's momentum, and Alex and Larry had become the de facto leads of AnyVar. Alex and Larry also built new services that depend on AnyVar, including variant-level matching and MCP providers, and became the recognized contacts for that work with funding agencies. They requested deviations from the software development processes of the biocommons organization. Forking the project was deemed by all parties to be detrimental to the effort and likely to have adverse implications for the integrity of links in grants and other materials. Therefore, the biocommons Steering Committee agreed to transfer the project and related assets to GA4GH for continued development and community benefit. All parties agreed to provide appropriate credit for AnyVar and for the biocommons tools on which it depends in publications, presentations, and websites.
|
|
8
|
+
|
|
9
|
+
## Sustaining the biocommons foundation
|
|
10
|
+
|
|
11
|
+
AnyVar is the most visible layer of a larger stack. In addition to its reliance on the GA4GH [VRS Python](http://github.com/ga4gh/vrs-python) library, its usefulness depends on biocommons libraries such as [hgvs](https://github.com/biocommons/hgvs), [seqrepo](https://github.com/biocommons/biocommons.seqrepo), [UTA](https://github.com/biocommons/uta), and [bioutils](https://github.com/biocommons/bioutils), which are maintained by a small community of volunteers and contributors from several organizations. Those libraries are harder to fund than the applications built on them, yet every service built on AnyVar inherits their reliability, or their neglect.
|
|
12
|
+
|
|
13
|
+
We therefore ask that the AnyVar community treat these foundations as shared responsibilities:
|
|
14
|
+
|
|
15
|
+
- **Contribute upstream.** When AnyVar needs changes to a biocommons library, make them in that library through its community process. Forks for development are welcome; long-lived forks that diverge will fragment the ecosystem that AnyVar depends on.
|
|
16
|
+
- **Include the foundation in funding.** When proposals build on AnyVar, include support for the biocommons libraries it depends on, as budget, effort, or named collaboration.
|
|
17
|
+
- **Give credit.** When citing AnyVar, also cite AnyVar's origins and the biocommons tools it depends on in publications, presentations, and websites.
|
|
18
|
+
|
|
19
|
+
AnyVar will be only as sustainable as the infrastructure beneath it.
|
|
@@ -45,7 +45,7 @@ venv/%:
|
|
|
45
45
|
#=> develop: install package in develop mode
|
|
46
46
|
.PHONY: develop
|
|
47
47
|
develop:
|
|
48
|
-
pip install -e .[postgres,queueing
|
|
48
|
+
python -m pip install -e '.[postgres,queueing]' --group test --group dev --group docs
|
|
49
49
|
|
|
50
50
|
#=> devready: create venv, install prerequisites, install pkg in develop mode
|
|
51
51
|
.PHONY: devready
|
|
@@ -67,7 +67,7 @@ bdist bdist_egg bdist_wheel build sdist install: %:
|
|
|
67
67
|
|
|
68
68
|
.PHONY: testready
|
|
69
69
|
testready:
|
|
70
|
-
pip install -e '.[postgres,queueing
|
|
70
|
+
python -m pip install -e '.[postgres,queueing]' --group test
|
|
71
71
|
|
|
72
72
|
#=> test: execute tests
|
|
73
73
|
.PHONY: test
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: anyvar
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.1.0.dev1
|
|
4
4
|
Summary: AnyVar provides Python and REST interfaces to validate, normalize, generate identifiers, and register biological sequence variation according to the GA4GH Variation Representation standards.
|
|
5
5
|
Author-email: biocommons contributors <biocommons-dev@googlegroups.com>
|
|
6
6
|
License: Apache License
|
|
@@ -220,44 +220,32 @@ Classifier: Operating System :: OS Independent
|
|
|
220
220
|
Requires-Python: >=3.11
|
|
221
221
|
Description-Content-Type: text/markdown
|
|
222
222
|
License-File: LICENSE
|
|
223
|
-
Requires-Dist: fastapi>=0.
|
|
223
|
+
Requires-Dist: fastapi>=0.103.0
|
|
224
224
|
Requires-Dist: python-multipart
|
|
225
225
|
Requires-Dist: uvicorn
|
|
226
|
-
Requires-Dist: ga4gh.vrs[extras]<3.0,>=2.2
|
|
226
|
+
Requires-Dist: ga4gh.vrs[extras]<3.0,>=2.3.2
|
|
227
|
+
Requires-Dist: ga4gh.cat_vrs>=0.7.1
|
|
227
228
|
Requires-Dist: sqlalchemy~=2.0.0
|
|
228
|
-
Requires-Dist: snowflake-sqlalchemy~=1.8.2
|
|
229
229
|
Requires-Dist: pyyaml
|
|
230
230
|
Requires-Dist: agct>=0.2.0rc1
|
|
231
231
|
Requires-Dist: pysam
|
|
232
232
|
Requires-Dist: python-dotenv
|
|
233
233
|
Requires-Dist: anyio
|
|
234
234
|
Requires-Dist: bioutils
|
|
235
|
+
Requires-Dist: biocommons.seqrepo
|
|
236
|
+
Requires-Dist: pyjwt[crypto]
|
|
237
|
+
Provides-Extra: duckdb
|
|
238
|
+
Requires-Dist: duckdb-engine; extra == "duckdb"
|
|
239
|
+
Requires-Dist: alembic; extra == "duckdb"
|
|
240
|
+
Requires-Dist: duckdb~=2.0.0; extra == "duckdb"
|
|
235
241
|
Provides-Extra: postgres
|
|
236
242
|
Requires-Dist: psycopg[binary]; extra == "postgres"
|
|
243
|
+
Requires-Dist: alembic; extra == "postgres"
|
|
244
|
+
Provides-Extra: projection
|
|
245
|
+
Requires-Dist: cool-seq-tool~=0.17.0; extra == "projection"
|
|
237
246
|
Provides-Extra: queueing
|
|
238
247
|
Requires-Dist: celery[redis]~=5.5.0; extra == "queueing"
|
|
239
248
|
Requires-Dist: aiofiles; extra == "queueing"
|
|
240
|
-
Provides-Extra: test
|
|
241
|
-
Requires-Dist: pytest; extra == "test"
|
|
242
|
-
Requires-Dist: pytest-asyncio; extra == "test"
|
|
243
|
-
Requires-Dist: pytest-cov; extra == "test"
|
|
244
|
-
Requires-Dist: pytest-mock; extra == "test"
|
|
245
|
-
Requires-Dist: httpx; extra == "test"
|
|
246
|
-
Requires-Dist: celery[pytest]; extra == "test"
|
|
247
|
-
Requires-Dist: jsonschema; extra == "test"
|
|
248
|
-
Requires-Dist: pyyaml; extra == "test"
|
|
249
|
-
Provides-Extra: dev
|
|
250
|
-
Requires-Dist: ruff==0.12.8; extra == "dev"
|
|
251
|
-
Requires-Dist: pre-commit>=4.2.0; extra == "dev"
|
|
252
|
-
Requires-Dist: ipykernel; extra == "dev"
|
|
253
|
-
Provides-Extra: docs
|
|
254
|
-
Requires-Dist: sphinx==8.2.3; extra == "docs"
|
|
255
|
-
Requires-Dist: sphinx_rtd_theme==3.0.2; extra == "docs"
|
|
256
|
-
Requires-Dist: sphinx-autodoc-typehints==3.2.0; extra == "docs"
|
|
257
|
-
Requires-Dist: sphinx-autobuild==2024.10.3; extra == "docs"
|
|
258
|
-
Requires-Dist: sphinx-copybutton==0.5.2; extra == "docs"
|
|
259
|
-
Requires-Dist: sphinxext-opengraph==0.10.0; extra == "docs"
|
|
260
|
-
Requires-Dist: sphinx-github-changelog==1.7.1; extra == "docs"
|
|
261
249
|
Dynamic: license-file
|
|
262
250
|
|
|
263
251
|
# *AnyVar* - lightweight and portable variation storage and retrieval
|
|
@@ -268,6 +256,7 @@ AnyVar enables **registration**, **lookup**, and **search** of genetic variants
|
|
|
268
256
|
* Support a broad range of query modes, including VRS ID lookups, HGVS expressions, gene-based searches, and genomic ranges
|
|
269
257
|
* Translate community nomenclatures and conventions into a universal model for variant representation
|
|
270
258
|
* Provide a community-driven, extensible platform for shared conventions and policy to realize the above goals
|
|
259
|
+
* Enable institutions to deploy and manage their own variant registry to meet privacy, governance, or data-sharing requirements
|
|
271
260
|
|
|
272
261
|
## Information
|
|
273
262
|
|
|
@@ -6,6 +6,7 @@ AnyVar enables **registration**, **lookup**, and **search** of genetic variants
|
|
|
6
6
|
* Support a broad range of query modes, including VRS ID lookups, HGVS expressions, gene-based searches, and genomic ranges
|
|
7
7
|
* Translate community nomenclatures and conventions into a universal model for variant representation
|
|
8
8
|
* Provide a community-driven, extensible platform for shared conventions and policy to realize the above goals
|
|
9
|
+
* Enable institutions to deploy and manage their own variant registry to meet privacy, governance, or data-sharing requirements
|
|
9
10
|
|
|
10
11
|
## Information
|
|
11
12
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Generic single-database configuration.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Alembic environment setup"""
|
|
2
|
+
|
|
3
|
+
from logging.config import fileConfig
|
|
4
|
+
|
|
5
|
+
import dotenv
|
|
6
|
+
from alembic import context
|
|
7
|
+
from alembic.config import Config
|
|
8
|
+
from sqlalchemy import engine_from_config, pool
|
|
9
|
+
|
|
10
|
+
from anyvar.storage.alembic_config import configure_alembic
|
|
11
|
+
from anyvar.storage.orm import Base
|
|
12
|
+
|
|
13
|
+
dotenv.load_dotenv()
|
|
14
|
+
|
|
15
|
+
config: Config = context.config
|
|
16
|
+
|
|
17
|
+
if config.config_file_name is not None:
|
|
18
|
+
fileConfig(config.config_file_name)
|
|
19
|
+
|
|
20
|
+
target_metadata = Base.metadata
|
|
21
|
+
if not config.get_main_option("sqlalchemy.url"):
|
|
22
|
+
configure_alembic(config)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def run_migrations_offline() -> None:
|
|
26
|
+
"""Run migrations in 'offline' mode.
|
|
27
|
+
|
|
28
|
+
This configures the context with just a URL
|
|
29
|
+
and not an Engine, though an Engine is acceptable
|
|
30
|
+
here as well. By skipping the Engine creation
|
|
31
|
+
we don't even need a DBAPI to be available.
|
|
32
|
+
|
|
33
|
+
Calls to context.execute() here emit the given string to the
|
|
34
|
+
script output.
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
url = config.get_main_option("sqlalchemy.url")
|
|
38
|
+
context.configure(
|
|
39
|
+
url=url,
|
|
40
|
+
target_metadata=target_metadata,
|
|
41
|
+
literal_binds=True,
|
|
42
|
+
dialect_opts={"paramstyle": "named"},
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
with context.begin_transaction():
|
|
46
|
+
context.run_migrations()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def run_migrations_online() -> None:
|
|
50
|
+
"""Run migrations in 'online' mode.
|
|
51
|
+
|
|
52
|
+
In this scenario we need to create an Engine
|
|
53
|
+
and associate a connection with the context.
|
|
54
|
+
|
|
55
|
+
"""
|
|
56
|
+
connectable = engine_from_config(
|
|
57
|
+
config.get_section(config.config_ini_section, {}),
|
|
58
|
+
prefix="sqlalchemy.",
|
|
59
|
+
poolclass=pool.NullPool,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
with connectable.connect() as connection:
|
|
63
|
+
context.configure(connection=connection, target_metadata=target_metadata)
|
|
64
|
+
|
|
65
|
+
with context.begin_transaction():
|
|
66
|
+
context.run_migrations()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
if context.is_offline_mode():
|
|
70
|
+
run_migrations_offline()
|
|
71
|
+
else:
|
|
72
|
+
run_migrations_online()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""${message}
|
|
2
|
+
|
|
3
|
+
Revision ID: ${up_revision}
|
|
4
|
+
Revises: ${down_revision | comma,n}
|
|
5
|
+
Create Date: ${create_date}
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from typing import Sequence, Union
|
|
9
|
+
|
|
10
|
+
from alembic import op
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
${imports if imports else ""}
|
|
13
|
+
|
|
14
|
+
# revision identifiers, used by Alembic.
|
|
15
|
+
revision: str = ${repr(up_revision)}
|
|
16
|
+
down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
|
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
|
18
|
+
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def upgrade() -> None:
|
|
22
|
+
"""Upgrade schema."""
|
|
23
|
+
${upgrades if upgrades else "pass"}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def downgrade() -> None:
|
|
27
|
+
"""Downgrade schema."""
|
|
28
|
+
${downgrades if downgrades else "pass"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""Initial schema
|
|
2
|
+
|
|
3
|
+
Revision ID: 18469f31ca97
|
|
4
|
+
Revises:
|
|
5
|
+
Create Date: 2026-07-29 13:21:44.275633
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from collections.abc import Sequence
|
|
10
|
+
|
|
11
|
+
import sqlalchemy as sa
|
|
12
|
+
from alembic import op
|
|
13
|
+
from sqlalchemy.dialects import postgresql
|
|
14
|
+
from sqlalchemy.engine.base import Connection
|
|
15
|
+
|
|
16
|
+
# revision identifiers, used by Alembic.
|
|
17
|
+
revision: str = "18469f31ca97"
|
|
18
|
+
down_revision: str | Sequence[str] | None = None
|
|
19
|
+
branch_labels: str | Sequence[str] | None = None
|
|
20
|
+
depends_on: str | Sequence[str] | None = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def upgrade() -> None:
|
|
24
|
+
"""Upgrade schema."""
|
|
25
|
+
bind: Connection = op.get_bind()
|
|
26
|
+
if bind.dialect.name == "postgresql":
|
|
27
|
+
op.execute(sqltext="CREATE EXTENSION IF NOT EXISTS btree_gist")
|
|
28
|
+
|
|
29
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
30
|
+
op.create_table(
|
|
31
|
+
"extensions",
|
|
32
|
+
sa.Column("id", sa.Integer(), nullable=False),
|
|
33
|
+
sa.Column("object_id", sa.String(), nullable=False),
|
|
34
|
+
sa.Column("name", sa.String(), nullable=False),
|
|
35
|
+
sa.Column(
|
|
36
|
+
"value",
|
|
37
|
+
sa.JSON().with_variant(
|
|
38
|
+
postgresql.JSONB(astext_type=sa.Text()), "postgresql"
|
|
39
|
+
),
|
|
40
|
+
nullable=False,
|
|
41
|
+
),
|
|
42
|
+
sa.PrimaryKeyConstraint("id"),
|
|
43
|
+
)
|
|
44
|
+
op.create_table(
|
|
45
|
+
"sequence_references",
|
|
46
|
+
sa.Column("id", sa.String(), nullable=False),
|
|
47
|
+
sa.Column(
|
|
48
|
+
"molecule_type",
|
|
49
|
+
sa.Enum("genomic", "RNA", "mRNA", "protein", name="molecule_type"),
|
|
50
|
+
nullable=True,
|
|
51
|
+
),
|
|
52
|
+
sa.PrimaryKeyConstraint("id"),
|
|
53
|
+
)
|
|
54
|
+
mapping_type = postgresql.ENUM(
|
|
55
|
+
"LIFTOVER_TO",
|
|
56
|
+
"TRANSCRIBE_TO",
|
|
57
|
+
"TRANSLATE_TO",
|
|
58
|
+
name="mapping_type",
|
|
59
|
+
)
|
|
60
|
+
mapping_type.create(op.get_bind(), checkfirst=True)
|
|
61
|
+
mapping_type_column = postgresql.ENUM(
|
|
62
|
+
"LIFTOVER_TO",
|
|
63
|
+
"TRANSCRIBE_TO",
|
|
64
|
+
"TRANSLATE_TO",
|
|
65
|
+
name="mapping_type",
|
|
66
|
+
create_type=False,
|
|
67
|
+
)
|
|
68
|
+
op.create_table(
|
|
69
|
+
"variation_mappings",
|
|
70
|
+
sa.Column("source_id", sa.String(), nullable=False),
|
|
71
|
+
sa.Column("dest_id", sa.String(), nullable=False),
|
|
72
|
+
sa.Column("mapping_type", mapping_type_column, nullable=False),
|
|
73
|
+
sa.PrimaryKeyConstraint("source_id", "dest_id", "mapping_type"),
|
|
74
|
+
)
|
|
75
|
+
op.create_table(
|
|
76
|
+
"vrs_objects",
|
|
77
|
+
sa.Column("id", sa.String(), nullable=False),
|
|
78
|
+
sa.Column(
|
|
79
|
+
"vrs_object",
|
|
80
|
+
sa.JSON().with_variant(
|
|
81
|
+
postgresql.JSONB(astext_type=sa.Text()), "postgresql"
|
|
82
|
+
),
|
|
83
|
+
nullable=False,
|
|
84
|
+
),
|
|
85
|
+
sa.PrimaryKeyConstraint("id"),
|
|
86
|
+
)
|
|
87
|
+
op.create_table(
|
|
88
|
+
"locations",
|
|
89
|
+
sa.Column("id", sa.String(), nullable=False),
|
|
90
|
+
sa.Column("sequence_reference_id", sa.String(), nullable=False),
|
|
91
|
+
sa.Column("start_pos", sa.Integer(), nullable=True),
|
|
92
|
+
sa.Column("end_pos", sa.Integer(), nullable=True),
|
|
93
|
+
sa.Column("start_outer", sa.Integer(), nullable=True),
|
|
94
|
+
sa.Column("start_inner", sa.Integer(), nullable=True),
|
|
95
|
+
sa.Column("end_outer", sa.Integer(), nullable=True),
|
|
96
|
+
sa.Column("end_inner", sa.Integer(), nullable=True),
|
|
97
|
+
sa.ForeignKeyConstraint(
|
|
98
|
+
["sequence_reference_id"],
|
|
99
|
+
["sequence_references.id"],
|
|
100
|
+
),
|
|
101
|
+
sa.PrimaryKeyConstraint("id"),
|
|
102
|
+
)
|
|
103
|
+
op.create_table(
|
|
104
|
+
"alleles",
|
|
105
|
+
sa.Column("id", sa.String(), nullable=False),
|
|
106
|
+
sa.Column("location_id", sa.String(), nullable=False),
|
|
107
|
+
sa.Column(
|
|
108
|
+
"state",
|
|
109
|
+
sa.JSON().with_variant(
|
|
110
|
+
postgresql.JSONB(astext_type=sa.Text()), "postgresql"
|
|
111
|
+
),
|
|
112
|
+
nullable=False,
|
|
113
|
+
),
|
|
114
|
+
sa.ForeignKeyConstraint(
|
|
115
|
+
["location_id"],
|
|
116
|
+
["locations.id"],
|
|
117
|
+
),
|
|
118
|
+
sa.PrimaryKeyConstraint("id"),
|
|
119
|
+
)
|
|
120
|
+
op.create_table(
|
|
121
|
+
"canonical_alleles",
|
|
122
|
+
sa.Column("id", sa.String(), nullable=False),
|
|
123
|
+
sa.Column("name", sa.String(), nullable=False),
|
|
124
|
+
sa.Column("allele_id", sa.String(), nullable=False),
|
|
125
|
+
sa.ForeignKeyConstraint(
|
|
126
|
+
["allele_id"],
|
|
127
|
+
["alleles.id"],
|
|
128
|
+
),
|
|
129
|
+
sa.PrimaryKeyConstraint("id"),
|
|
130
|
+
)
|
|
131
|
+
op.create_table(
|
|
132
|
+
"protein_sequence_consequences",
|
|
133
|
+
sa.Column("id", sa.String(), nullable=False),
|
|
134
|
+
sa.Column("name", sa.String(), nullable=False),
|
|
135
|
+
sa.Column("allele_id", sa.String(), nullable=False),
|
|
136
|
+
sa.ForeignKeyConstraint(
|
|
137
|
+
["allele_id"],
|
|
138
|
+
["alleles.id"],
|
|
139
|
+
),
|
|
140
|
+
sa.PrimaryKeyConstraint("id"),
|
|
141
|
+
)
|
|
142
|
+
# ### end Alembic commands ###
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def downgrade() -> None:
|
|
146
|
+
"""Downgrade schema."""
|
|
147
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
148
|
+
op.drop_table("protein_sequence_consequences")
|
|
149
|
+
op.drop_table("canonical_alleles")
|
|
150
|
+
op.drop_table("alleles")
|
|
151
|
+
op.drop_table("locations")
|
|
152
|
+
op.drop_table("vrs_objects")
|
|
153
|
+
op.drop_table("variation_mappings")
|
|
154
|
+
op.drop_table("sequence_references")
|
|
155
|
+
op.drop_table("extensions")
|
|
156
|
+
# ### end Alembic commands ###
|