biofilter 3.2.0__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.
- biofilter-3.2.0/PKG-INFO +45 -0
- biofilter-3.2.0/README.md +7 -0
- biofilter-3.2.0/biofilter/__init__.py +3 -0
- biofilter-3.2.0/biofilter/alembic/README +1 -0
- biofilter-3.2.0/biofilter/alembic/env.py +88 -0
- biofilter-3.2.0/biofilter/alembic/script.py.mako +28 -0
- biofilter-3.2.0/biofilter/alembic/versions/0c242ad16a44_3_0_1_base_schema.py +408 -0
- biofilter-3.2.0/biofilter/biofilter.py +375 -0
- biofilter-3.2.0/biofilter/bkps/extract_loki.py +93 -0
- biofilter-3.2.0/biofilter/bkps/loki_models.py +557 -0
- biofilter-3.2.0/biofilter/bkps/variants_version_full/dtp_dbsnp_V3.old +432 -0
- biofilter-3.2.0/biofilter/bkps/variants_version_full/dtp_dbsnp_v2.old +616 -0
- biofilter-3.2.0/biofilter/bkps/variants_version_full/initial_allele_types.json +11 -0
- biofilter-3.2.0/biofilter/bkps/variants_version_full/initial_variant_types.json +15 -0
- biofilter-3.2.0/biofilter/bkps/variants_version_full/variants_models_V1.py +172 -0
- biofilter-3.2.0/biofilter/cli.py +7 -0
- biofilter-3.2.0/biofilter/core/__init__.py +0 -0
- biofilter-3.2.0/biofilter/core/mixins/__init__.py +0 -0
- biofilter-3.2.0/biofilter/core/mixins/get_data_mixin.py +49 -0
- biofilter-3.2.0/biofilter/core/settings_manager.py +45 -0
- biofilter-3.2.0/biofilter/db/__init__.py +7 -0
- biofilter-3.2.0/biofilter/db/base.py +3 -0
- biofilter-3.2.0/biofilter/db/create_db_mixin.py +217 -0
- biofilter-3.2.0/biofilter/db/database.py +154 -0
- biofilter-3.2.0/biofilter/db/models/__init__.py +109 -0
- biofilter-3.2.0/biofilter/db/models/model_chemicals.py +150 -0
- biofilter-3.2.0/biofilter/db/models/model_config.py +178 -0
- biofilter-3.2.0/biofilter/db/models/model_curation.py +73 -0
- biofilter-3.2.0/biofilter/db/models/model_diseases.py +123 -0
- biofilter-3.2.0/biofilter/db/models/model_entities.py +488 -0
- biofilter-3.2.0/biofilter/db/models/model_etl.py +247 -0
- biofilter-3.2.0/biofilter/db/models/model_genes.py +365 -0
- biofilter-3.2.0/biofilter/db/models/model_go.py +124 -0
- biofilter-3.2.0/biofilter/db/models/model_pathways.py +44 -0
- biofilter-3.2.0/biofilter/db/models/model_proteins.py +176 -0
- biofilter-3.2.0/biofilter/db/models/model_variants.py +375 -0
- biofilter-3.2.0/biofilter/db/models/models_info.json +82 -0
- biofilter-3.2.0/biofilter/db/seed/initial_config.json +44 -0
- biofilter-3.2.0/biofilter/db/seed/initial_data_sources.json +563 -0
- biofilter-3.2.0/biofilter/db/seed/initial_entity_group.json +74 -0
- biofilter-3.2.0/biofilter/db/seed/initial_entity_relationship_types.json +50 -0
- biofilter-3.2.0/biofilter/db/seed/initial_etl_processes.json +251 -0
- biofilter-3.2.0/biofilter/db/seed/initial_genome_assemblies.json +249 -0
- biofilter-3.2.0/biofilter/db/seed/initial_metadata.json +7 -0
- biofilter-3.2.0/biofilter/db/seed/initial_omic_status.json +34 -0
- biofilter-3.2.0/biofilter/db/seed/initial_source_systems.json +76 -0
- biofilter-3.2.0/biofilter/db/types.py +23 -0
- biofilter-3.2.0/biofilter/etl/__init__.py +0 -0
- biofilter-3.2.0/biofilter/etl/conflict_manager.py +574 -0
- biofilter-3.2.0/biofilter/etl/dtps/__init__.py +0 -0
- biofilter-3.2.0/biofilter/etl/dtps/devs/dtp_variant_ncbi__multiproc__.py +969 -0
- biofilter-3.2.0/biofilter/etl/dtps/devs/dtp_variant_ncbi_bkp1.py +1013 -0
- biofilter-3.2.0/biofilter/etl/dtps/devs/worker_dbsnp__multiproc__.py +498 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_biogrid.py +704 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_chebi.py +594 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_clingen.py +754 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_gene_ensembl.py +804 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_gene_hgnc.py +546 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_gene_ncbi.py +645 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_go.py +536 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_gwas.py +699 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_kegg.py +355 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_mondo.py +705 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_mondo_relationships.py +194 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_pfam.py +295 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_reactome.py +495 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_reactome_relationships.py +343 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_uniprot.py +809 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_uniprot_relationships.py +304 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_variant_ncbi.py +724 -0
- biofilter-3.2.0/biofilter/etl/dtps/dtp_variant_ncbi_master.py +906 -0
- biofilter-3.2.0/biofilter/etl/dtps/worker_dbsnp.py +502 -0
- biofilter-3.2.0/biofilter/etl/etl_manager.py +1214 -0
- biofilter-3.2.0/biofilter/etl/mixins/__init__.py +0 -0
- biofilter-3.2.0/biofilter/etl/mixins/base_dtp.py +185 -0
- biofilter-3.2.0/biofilter/etl/mixins/base_dtp_turning.py +399 -0
- biofilter-3.2.0/biofilter/etl/mixins/entity_query_mixin.py +261 -0
- biofilter-3.2.0/biofilter/etl/mixins/gene_query_mixin.py +453 -0
- biofilter-3.2.0/biofilter/etl/mixins/variant_query_mixin.py +119 -0
- biofilter-3.2.0/biofilter/query/__init__.py +4 -0
- biofilter-3.2.0/biofilter/query/query.py +255 -0
- biofilter-3.2.0/biofilter/query/schema_explorer.py +166 -0
- biofilter-3.2.0/biofilter/report/__init__.py +0 -0
- biofilter-3.2.0/biofilter/report/report_manager.py +251 -0
- biofilter-3.2.0/biofilter/report/reports/__init__.py +11 -0
- biofilter-3.2.0/biofilter/report/reports/base_report.py +195 -0
- biofilter-3.2.0/biofilter/report/reports/report_entity_filter.py +114 -0
- biofilter-3.2.0/biofilter/report/reports/report_etl_packages.py +186 -0
- biofilter-3.2.0/biofilter/report/reports/report_etl_status.py +248 -0
- biofilter-3.2.0/biofilter/report/reports/report_gene_to_snp.py +521 -0
- biofilter-3.2.0/biofilter/report/reports/report_template.py +43 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/__init__.py +11 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/base_report.py +165 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_entity_filter.py +114 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_etl_status.py +55 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_gene_to_snp copy.py +476 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_gene_to_snp.py +336 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_position_to_gene copy.py +255 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_position_to_gene.py +363 -0
- biofilter-3.2.0/biofilter/report/reports_bkp/report_template.py +43 -0
- biofilter-3.2.0/biofilter/tools/__init__.py +2 -0
- biofilter-3.2.0/biofilter/tools/parquet_exporter.py +220 -0
- biofilter-3.2.0/biofilter/tools/to_do.txt +1 -0
- biofilter-3.2.0/biofilter/utils/__init__.py +3 -0
- biofilter-3.2.0/biofilter/utils/cli_main.py +234 -0
- biofilter-3.2.0/biofilter/utils/config.py +31 -0
- biofilter-3.2.0/biofilter/utils/database_initializer.py +27 -0
- biofilter-3.2.0/biofilter/utils/db_loader.py +23 -0
- biofilter-3.2.0/biofilter/utils/file_hash.py +12 -0
- biofilter-3.2.0/biofilter/utils/formatter.py +18 -0
- biofilter-3.2.0/biofilter/utils/init_project.py +15 -0
- biofilter-3.2.0/biofilter/utils/logger.py +170 -0
- biofilter-3.2.0/biofilter/utils/migrate.py +54 -0
- biofilter-3.2.0/biofilter/utils/model_explorer.py +97 -0
- biofilter-3.2.0/biofilter/utils/utilities.py +87 -0
- biofilter-3.2.0/biofilter/utils/version.py +2 -0
- biofilter-3.2.0/pyproject.toml +53 -0
biofilter-3.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: biofilter
|
|
3
|
+
Version: 3.2.0
|
|
4
|
+
Summary: Biofilter3R: cloud-ready biological knowledge system
|
|
5
|
+
Home-page: https://ritchielab.org
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: Andre Rico
|
|
8
|
+
Author-email: andreluis.rico@pennmedicine.upenn.edu
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Dist: aiosqlite (>=0.21.0,<0.22.0)
|
|
16
|
+
Requires-Dist: alembic (>=1.16.4,<2.0.0)
|
|
17
|
+
Requires-Dist: apsw (==3.46.1.0)
|
|
18
|
+
Requires-Dist: click (==8.1.7)
|
|
19
|
+
Requires-Dist: colorama (>=0.4.6,<0.5.0)
|
|
20
|
+
Requires-Dist: duckdb (>=1.4.0,<2.0.0)
|
|
21
|
+
Requires-Dist: iniconfig (==2.0.0)
|
|
22
|
+
Requires-Dist: notebook (>=7.4.6,<8.0.0)
|
|
23
|
+
Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
|
|
24
|
+
Requires-Dist: packaging (==24.1)
|
|
25
|
+
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
|
26
|
+
Requires-Dist: platformdirs (==4.3.6)
|
|
27
|
+
Requires-Dist: pluggy (==1.5.0)
|
|
28
|
+
Requires-Dist: psutil (>=6.1.1,<7.0.0)
|
|
29
|
+
Requires-Dist: psycopg2-binary (>=2.9.10,<3.0.0)
|
|
30
|
+
Requires-Dist: pyarrow (>=19.0.1,<20.0.0)
|
|
31
|
+
Requires-Dist: requests (>=2.32.4,<3.0.0)
|
|
32
|
+
Requires-Dist: sqlalchemy (>=2.0.37,<3.0.0)
|
|
33
|
+
Requires-Dist: toml (>=0.10.2,<0.11.0)
|
|
34
|
+
Requires-Dist: tqdm (>=4.67.1,<5.0.0)
|
|
35
|
+
Requires-Dist: wget (>=3.2,<4.0)
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# Biofilter3R (Development Branch)
|
|
39
|
+
|
|
40
|
+
**Version**: New Project (with SQLAlchemy)
|
|
41
|
+
**Status**: In Development
|
|
42
|
+
**Focus**: Adding new Data Sources
|
|
43
|
+
|
|
44
|
+
## Project Overview
|
|
45
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Generic single-database configuration.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from alembic import context
|
|
3
|
+
from logging.config import fileConfig
|
|
4
|
+
from sqlalchemy import pool
|
|
5
|
+
from sqlalchemy import engine_from_config
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# this is the Alembic Config object, which provides
|
|
9
|
+
# access to the values within the .ini file in use.
|
|
10
|
+
config = context.config
|
|
11
|
+
|
|
12
|
+
# Set DB URL manually if not in alembic.ini
|
|
13
|
+
# config.set_main_option("sqlalchemy.url", db_path)
|
|
14
|
+
# Override sqlalchemy.url from environment variable if set
|
|
15
|
+
db_path = os.getenv("BIOFILTER_DB_URI")
|
|
16
|
+
if db_path:
|
|
17
|
+
config.set_main_option("sqlalchemy.url", db_path)
|
|
18
|
+
|
|
19
|
+
# Interpret the config file for Python logging.
|
|
20
|
+
# This line sets up loggers basically.
|
|
21
|
+
if config.config_file_name is not None:
|
|
22
|
+
fileConfig(config.config_file_name)
|
|
23
|
+
|
|
24
|
+
# add your model's MetaData object here
|
|
25
|
+
# for 'autogenerate' support
|
|
26
|
+
# from myapp import mymodel
|
|
27
|
+
# target_metadata = mymodel.Base.metadata
|
|
28
|
+
# target_metadata = None # Default
|
|
29
|
+
from biofilter.db import Base # noqa E402
|
|
30
|
+
from biofilter.db import models # Import all models. # noqa
|
|
31
|
+
|
|
32
|
+
target_metadata = Base.metadata
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# other values from the config, defined by the needs of env.py,
|
|
36
|
+
# can be acquired:
|
|
37
|
+
# my_important_option = config.get_main_option("my_important_option")
|
|
38
|
+
# ... etc.
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def run_migrations_offline() -> None:
|
|
42
|
+
"""Run migrations in 'offline' mode.
|
|
43
|
+
|
|
44
|
+
This configures the context with just a URL
|
|
45
|
+
and not an Engine, though an Engine is acceptable
|
|
46
|
+
here as well. By skipping the Engine creation
|
|
47
|
+
we don't even need a DBAPI to be available.
|
|
48
|
+
|
|
49
|
+
Calls to context.execute() here emit the given string to the
|
|
50
|
+
script output.
|
|
51
|
+
|
|
52
|
+
"""
|
|
53
|
+
url = config.get_main_option("sqlalchemy.url")
|
|
54
|
+
context.configure(
|
|
55
|
+
url=url,
|
|
56
|
+
target_metadata=target_metadata,
|
|
57
|
+
literal_binds=True,
|
|
58
|
+
dialect_opts={"paramstyle": "named"},
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
with context.begin_transaction():
|
|
62
|
+
context.run_migrations()
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def run_migrations_online() -> None:
|
|
66
|
+
"""Run migrations in 'online' mode.
|
|
67
|
+
|
|
68
|
+
In this scenario we need to create an Engine
|
|
69
|
+
and associate a connection with the context.
|
|
70
|
+
|
|
71
|
+
"""
|
|
72
|
+
connectable = engine_from_config(
|
|
73
|
+
config.get_section(config.config_ini_section, {}),
|
|
74
|
+
prefix="sqlalchemy.",
|
|
75
|
+
poolclass=pool.NullPool,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
with connectable.connect() as connection:
|
|
79
|
+
context.configure(connection=connection, target_metadata=target_metadata)
|
|
80
|
+
|
|
81
|
+
with context.begin_transaction():
|
|
82
|
+
context.run_migrations()
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
if context.is_offline_mode():
|
|
86
|
+
run_migrations_offline()
|
|
87
|
+
else:
|
|
88
|
+
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,408 @@
|
|
|
1
|
+
"""3.0.1 - Base schema
|
|
2
|
+
|
|
3
|
+
Revision ID: 0c242ad16a44
|
|
4
|
+
Revises:
|
|
5
|
+
Create Date: 2025-08-21 08:49:50.931523
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Sequence, Union
|
|
10
|
+
|
|
11
|
+
from alembic import op
|
|
12
|
+
import sqlalchemy as sa
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# revision identifiers, used by Alembic.
|
|
16
|
+
revision: str = "0c242ad16a44"
|
|
17
|
+
down_revision: Union[str, Sequence[str], None] = None
|
|
18
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
|
19
|
+
depends_on: Union[str, Sequence[str], None] = None
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def upgrade() -> None:
|
|
23
|
+
"""Upgrade schema."""
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
op.drop_index(op.f("idx_entities_group_id"), table_name="entities")
|
|
26
|
+
op.drop_index(op.f("idx_entities_has_conflict"), table_name="entities")
|
|
27
|
+
op.drop_index(op.f("idx_entities_is_deactive"), table_name="entities")
|
|
28
|
+
op.drop_index(op.f("idx_entity_names_data_source_id"), table_name="entity_names")
|
|
29
|
+
op.drop_index(
|
|
30
|
+
op.f("idx_entity_names_data_source_id_entity_id"), table_name="entity_names"
|
|
31
|
+
)
|
|
32
|
+
op.drop_index(
|
|
33
|
+
op.f("idx_entity_names_data_source_id_name"), table_name="entity_names"
|
|
34
|
+
)
|
|
35
|
+
op.drop_index(op.f("idx_entity_names_entity_id"), table_name="entity_names")
|
|
36
|
+
op.drop_index(
|
|
37
|
+
op.f("idx_entity_names_entity_id_is_primary"), table_name="entity_names"
|
|
38
|
+
)
|
|
39
|
+
op.drop_index(op.f("idx_entity_names_name"), table_name="entity_names")
|
|
40
|
+
op.drop_index(
|
|
41
|
+
op.f("idx_entity_relationship_types_code"),
|
|
42
|
+
table_name="entity_relationship_types",
|
|
43
|
+
)
|
|
44
|
+
op.drop_index(
|
|
45
|
+
op.f("idx_entity_relationships_data_source_id"),
|
|
46
|
+
table_name="entity_relationships",
|
|
47
|
+
)
|
|
48
|
+
op.drop_index(
|
|
49
|
+
op.f("idx_entity_relationships_entity_1_id"), table_name="entity_relationships"
|
|
50
|
+
)
|
|
51
|
+
op.drop_index(
|
|
52
|
+
op.f("idx_entity_relationships_entity_1_id_entity_2_id_relationship_type_id"),
|
|
53
|
+
table_name="entity_relationships",
|
|
54
|
+
)
|
|
55
|
+
op.drop_index(
|
|
56
|
+
op.f("idx_entity_relationships_entity_1_id_relationship_type_id"),
|
|
57
|
+
table_name="entity_relationships",
|
|
58
|
+
)
|
|
59
|
+
op.drop_index(
|
|
60
|
+
op.f("idx_entity_relationships_entity_2_id"), table_name="entity_relationships"
|
|
61
|
+
)
|
|
62
|
+
op.drop_index(
|
|
63
|
+
op.f("idx_entity_relationships_relationship_type_id"),
|
|
64
|
+
table_name="entity_relationships",
|
|
65
|
+
)
|
|
66
|
+
op.drop_index(
|
|
67
|
+
op.f("idx_gene_genomic_regions_chromosome"), table_name="gene_genomic_regions"
|
|
68
|
+
)
|
|
69
|
+
op.drop_index(
|
|
70
|
+
op.f("idx_gene_genomic_regions_chromosome_start_end"),
|
|
71
|
+
table_name="gene_genomic_regions",
|
|
72
|
+
)
|
|
73
|
+
op.drop_index(
|
|
74
|
+
op.f("idx_gene_genomic_regions_label"), table_name="gene_genomic_regions"
|
|
75
|
+
)
|
|
76
|
+
op.drop_index(
|
|
77
|
+
op.f("idx_gene_group_memberships_gene_id"), table_name="gene_group_memberships"
|
|
78
|
+
)
|
|
79
|
+
op.drop_index(
|
|
80
|
+
op.f("idx_gene_group_memberships_group_id"), table_name="gene_group_memberships"
|
|
81
|
+
)
|
|
82
|
+
op.drop_index(op.f("idx_gene_groups_name"), table_name="gene_groups")
|
|
83
|
+
op.drop_index(op.f("idx_gene_locations_assembly"), table_name="gene_locations")
|
|
84
|
+
op.drop_index(op.f("idx_gene_locations_chromosome"), table_name="gene_locations")
|
|
85
|
+
op.drop_index(
|
|
86
|
+
op.f("idx_gene_locations_chromosome_start_end"), table_name="gene_locations"
|
|
87
|
+
)
|
|
88
|
+
op.drop_index(
|
|
89
|
+
op.f("idx_gene_locations_data_source_id"), table_name="gene_locations"
|
|
90
|
+
)
|
|
91
|
+
op.drop_index(op.f("idx_gene_locations_gene_id"), table_name="gene_locations")
|
|
92
|
+
op.drop_index(op.f("idx_gene_locations_region_id"), table_name="gene_locations")
|
|
93
|
+
op.drop_index(op.f("idx_gene_locus_groups_name"), table_name="gene_locus_groups")
|
|
94
|
+
op.drop_index(op.f("idx_gene_locus_types_name"), table_name="gene_locus_types")
|
|
95
|
+
op.drop_index(op.f("idx_gene_masters_data_source_id"), table_name="gene_masters")
|
|
96
|
+
op.drop_index(op.f("idx_gene_masters_ensembl_id"), table_name="gene_masters")
|
|
97
|
+
op.drop_index(op.f("idx_gene_masters_entity_id"), table_name="gene_masters")
|
|
98
|
+
op.drop_index(op.f("idx_gene_masters_entrez_id"), table_name="gene_masters")
|
|
99
|
+
op.drop_index(op.f("idx_gene_masters_hgnc_id"), table_name="gene_masters")
|
|
100
|
+
op.drop_index(op.f("idx_gene_masters_locus_group_id"), table_name="gene_masters")
|
|
101
|
+
op.drop_index(op.f("idx_gene_masters_locus_type_id"), table_name="gene_masters")
|
|
102
|
+
op.drop_index(op.f("idx_gene_masters_omic_status_id"), table_name="gene_masters")
|
|
103
|
+
op.drop_index(op.f("idx_go_masters_entity_id"), table_name="go_masters")
|
|
104
|
+
op.drop_index(op.f("idx_go_masters_go_id"), table_name="go_masters")
|
|
105
|
+
op.drop_index(op.f("idx_go_masters_namespace"), table_name="go_masters")
|
|
106
|
+
op.drop_index(op.f("idx_go_relations_child_id"), table_name="go_relations")
|
|
107
|
+
op.drop_index(
|
|
108
|
+
op.f("idx_go_relations_child_id_relation_type"), table_name="go_relations"
|
|
109
|
+
)
|
|
110
|
+
op.drop_index(op.f("idx_go_relations_parent_id"), table_name="go_relations")
|
|
111
|
+
op.drop_index(
|
|
112
|
+
op.f("idx_go_relations_parent_id_relation_type"), table_name="go_relations"
|
|
113
|
+
)
|
|
114
|
+
op.drop_index(op.f("idx_go_relations_relation_type"), table_name="go_relations")
|
|
115
|
+
op.drop_index(op.f("idx_omic_status_name"), table_name="omic_status")
|
|
116
|
+
op.drop_index(
|
|
117
|
+
op.f("idx_pathway_masters_data_source_id"), table_name="pathway_masters"
|
|
118
|
+
)
|
|
119
|
+
op.drop_index(op.f("idx_pathway_masters_entity_id"), table_name="pathway_masters")
|
|
120
|
+
op.drop_index(op.f("idx_pathway_masters_pathway_id"), table_name="pathway_masters")
|
|
121
|
+
op.drop_index(op.f("idx_protein_entities_entity_id"), table_name="protein_entities")
|
|
122
|
+
op.drop_index(
|
|
123
|
+
op.f("idx_protein_entities_protein_master_id_is_isoform"),
|
|
124
|
+
table_name="protein_entities",
|
|
125
|
+
)
|
|
126
|
+
op.drop_index(op.f("idx_protein_masters_protein_id"), table_name="protein_masters")
|
|
127
|
+
op.drop_index(
|
|
128
|
+
op.f("idx_protein_pfam_links_pfam_pk_id"), table_name="protein_pfam_links"
|
|
129
|
+
)
|
|
130
|
+
op.drop_index(op.f("idx_protein_pfams_clan_acc"), table_name="protein_pfams")
|
|
131
|
+
op.drop_index(op.f("idx_protein_pfams_pfam_id"), table_name="protein_pfams")
|
|
132
|
+
# ### end Alembic commands ###
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def downgrade() -> None:
|
|
136
|
+
"""Downgrade schema."""
|
|
137
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
138
|
+
op.create_index(
|
|
139
|
+
op.f("idx_protein_pfams_pfam_id"), "protein_pfams", ["pfam_id"], unique=False
|
|
140
|
+
)
|
|
141
|
+
op.create_index(
|
|
142
|
+
op.f("idx_protein_pfams_clan_acc"), "protein_pfams", ["clan_acc"], unique=False
|
|
143
|
+
)
|
|
144
|
+
op.create_index(
|
|
145
|
+
op.f("idx_protein_pfam_links_pfam_pk_id"),
|
|
146
|
+
"protein_pfam_links",
|
|
147
|
+
["pfam_pk_id"],
|
|
148
|
+
unique=False,
|
|
149
|
+
)
|
|
150
|
+
op.create_index(
|
|
151
|
+
op.f("idx_protein_masters_protein_id"),
|
|
152
|
+
"protein_masters",
|
|
153
|
+
["protein_id"],
|
|
154
|
+
unique=False,
|
|
155
|
+
)
|
|
156
|
+
op.create_index(
|
|
157
|
+
op.f("idx_protein_entities_protein_master_id_is_isoform"),
|
|
158
|
+
"protein_entities",
|
|
159
|
+
["protein_master_id", "is_isoform"],
|
|
160
|
+
unique=False,
|
|
161
|
+
)
|
|
162
|
+
op.create_index(
|
|
163
|
+
op.f("idx_protein_entities_entity_id"),
|
|
164
|
+
"protein_entities",
|
|
165
|
+
["entity_id"],
|
|
166
|
+
unique=False,
|
|
167
|
+
)
|
|
168
|
+
op.create_index(
|
|
169
|
+
op.f("idx_pathway_masters_pathway_id"),
|
|
170
|
+
"pathway_masters",
|
|
171
|
+
["pathway_id"],
|
|
172
|
+
unique=False,
|
|
173
|
+
)
|
|
174
|
+
op.create_index(
|
|
175
|
+
op.f("idx_pathway_masters_entity_id"),
|
|
176
|
+
"pathway_masters",
|
|
177
|
+
["entity_id"],
|
|
178
|
+
unique=False,
|
|
179
|
+
)
|
|
180
|
+
op.create_index(
|
|
181
|
+
op.f("idx_pathway_masters_data_source_id"),
|
|
182
|
+
"pathway_masters",
|
|
183
|
+
["data_source_id"],
|
|
184
|
+
unique=False,
|
|
185
|
+
)
|
|
186
|
+
op.create_index(op.f("idx_omic_status_name"), "omic_status", ["name"], unique=False)
|
|
187
|
+
op.create_index(
|
|
188
|
+
op.f("idx_go_relations_relation_type"),
|
|
189
|
+
"go_relations",
|
|
190
|
+
["relation_type"],
|
|
191
|
+
unique=False,
|
|
192
|
+
)
|
|
193
|
+
op.create_index(
|
|
194
|
+
op.f("idx_go_relations_parent_id_relation_type"),
|
|
195
|
+
"go_relations",
|
|
196
|
+
["parent_id", "relation_type"],
|
|
197
|
+
unique=False,
|
|
198
|
+
)
|
|
199
|
+
op.create_index(
|
|
200
|
+
op.f("idx_go_relations_parent_id"), "go_relations", ["parent_id"], unique=False
|
|
201
|
+
)
|
|
202
|
+
op.create_index(
|
|
203
|
+
op.f("idx_go_relations_child_id_relation_type"),
|
|
204
|
+
"go_relations",
|
|
205
|
+
["child_id", "relation_type"],
|
|
206
|
+
unique=False,
|
|
207
|
+
)
|
|
208
|
+
op.create_index(
|
|
209
|
+
op.f("idx_go_relations_child_id"), "go_relations", ["child_id"], unique=False
|
|
210
|
+
)
|
|
211
|
+
op.create_index(
|
|
212
|
+
op.f("idx_go_masters_namespace"), "go_masters", ["namespace"], unique=False
|
|
213
|
+
)
|
|
214
|
+
op.create_index(op.f("idx_go_masters_go_id"), "go_masters", ["go_id"], unique=False)
|
|
215
|
+
op.create_index(
|
|
216
|
+
op.f("idx_go_masters_entity_id"), "go_masters", ["entity_id"], unique=False
|
|
217
|
+
)
|
|
218
|
+
op.create_index(
|
|
219
|
+
op.f("idx_gene_masters_omic_status_id"),
|
|
220
|
+
"gene_masters",
|
|
221
|
+
["omic_status_id"],
|
|
222
|
+
unique=False,
|
|
223
|
+
)
|
|
224
|
+
op.create_index(
|
|
225
|
+
op.f("idx_gene_masters_locus_type_id"),
|
|
226
|
+
"gene_masters",
|
|
227
|
+
["locus_type_id"],
|
|
228
|
+
unique=False,
|
|
229
|
+
)
|
|
230
|
+
op.create_index(
|
|
231
|
+
op.f("idx_gene_masters_locus_group_id"),
|
|
232
|
+
"gene_masters",
|
|
233
|
+
["locus_group_id"],
|
|
234
|
+
unique=False,
|
|
235
|
+
)
|
|
236
|
+
op.create_index(
|
|
237
|
+
op.f("idx_gene_masters_hgnc_id"), "gene_masters", ["hgnc_id"], unique=False
|
|
238
|
+
)
|
|
239
|
+
op.create_index(
|
|
240
|
+
op.f("idx_gene_masters_entrez_id"), "gene_masters", ["entrez_id"], unique=False
|
|
241
|
+
)
|
|
242
|
+
op.create_index(
|
|
243
|
+
op.f("idx_gene_masters_entity_id"), "gene_masters", ["entity_id"], unique=False
|
|
244
|
+
)
|
|
245
|
+
op.create_index(
|
|
246
|
+
op.f("idx_gene_masters_ensembl_id"),
|
|
247
|
+
"gene_masters",
|
|
248
|
+
["ensembl_id"],
|
|
249
|
+
unique=False,
|
|
250
|
+
)
|
|
251
|
+
op.create_index(
|
|
252
|
+
op.f("idx_gene_masters_data_source_id"),
|
|
253
|
+
"gene_masters",
|
|
254
|
+
["data_source_id"],
|
|
255
|
+
unique=False,
|
|
256
|
+
)
|
|
257
|
+
op.create_index(
|
|
258
|
+
op.f("idx_gene_locus_types_name"), "gene_locus_types", ["name"], unique=False
|
|
259
|
+
)
|
|
260
|
+
op.create_index(
|
|
261
|
+
op.f("idx_gene_locus_groups_name"), "gene_locus_groups", ["name"], unique=False
|
|
262
|
+
)
|
|
263
|
+
op.create_index(
|
|
264
|
+
op.f("idx_gene_locations_region_id"),
|
|
265
|
+
"gene_locations",
|
|
266
|
+
["region_id"],
|
|
267
|
+
unique=False,
|
|
268
|
+
)
|
|
269
|
+
op.create_index(
|
|
270
|
+
op.f("idx_gene_locations_gene_id"), "gene_locations", ["gene_id"], unique=False
|
|
271
|
+
)
|
|
272
|
+
op.create_index(
|
|
273
|
+
op.f("idx_gene_locations_data_source_id"),
|
|
274
|
+
"gene_locations",
|
|
275
|
+
["data_source_id"],
|
|
276
|
+
unique=False,
|
|
277
|
+
)
|
|
278
|
+
op.create_index(
|
|
279
|
+
op.f("idx_gene_locations_chromosome_start_end"),
|
|
280
|
+
"gene_locations",
|
|
281
|
+
["chromosome", "start", "end"],
|
|
282
|
+
unique=False,
|
|
283
|
+
)
|
|
284
|
+
op.create_index(
|
|
285
|
+
op.f("idx_gene_locations_chromosome"),
|
|
286
|
+
"gene_locations",
|
|
287
|
+
["chromosome"],
|
|
288
|
+
unique=False,
|
|
289
|
+
)
|
|
290
|
+
op.create_index(
|
|
291
|
+
op.f("idx_gene_locations_assembly"),
|
|
292
|
+
"gene_locations",
|
|
293
|
+
["assembly"],
|
|
294
|
+
unique=False,
|
|
295
|
+
)
|
|
296
|
+
op.create_index(op.f("idx_gene_groups_name"), "gene_groups", ["name"], unique=False)
|
|
297
|
+
op.create_index(
|
|
298
|
+
op.f("idx_gene_group_memberships_group_id"),
|
|
299
|
+
"gene_group_memberships",
|
|
300
|
+
["group_id"],
|
|
301
|
+
unique=False,
|
|
302
|
+
)
|
|
303
|
+
op.create_index(
|
|
304
|
+
op.f("idx_gene_group_memberships_gene_id"),
|
|
305
|
+
"gene_group_memberships",
|
|
306
|
+
["gene_id"],
|
|
307
|
+
unique=False,
|
|
308
|
+
)
|
|
309
|
+
op.create_index(
|
|
310
|
+
op.f("idx_gene_genomic_regions_label"),
|
|
311
|
+
"gene_genomic_regions",
|
|
312
|
+
["label"],
|
|
313
|
+
unique=False,
|
|
314
|
+
)
|
|
315
|
+
op.create_index(
|
|
316
|
+
op.f("idx_gene_genomic_regions_chromosome_start_end"),
|
|
317
|
+
"gene_genomic_regions",
|
|
318
|
+
["chromosome", "start", "end"],
|
|
319
|
+
unique=False,
|
|
320
|
+
)
|
|
321
|
+
op.create_index(
|
|
322
|
+
op.f("idx_gene_genomic_regions_chromosome"),
|
|
323
|
+
"gene_genomic_regions",
|
|
324
|
+
["chromosome"],
|
|
325
|
+
unique=False,
|
|
326
|
+
)
|
|
327
|
+
op.create_index(
|
|
328
|
+
op.f("idx_entity_relationships_relationship_type_id"),
|
|
329
|
+
"entity_relationships",
|
|
330
|
+
["relationship_type_id"],
|
|
331
|
+
unique=False,
|
|
332
|
+
)
|
|
333
|
+
op.create_index(
|
|
334
|
+
op.f("idx_entity_relationships_entity_2_id"),
|
|
335
|
+
"entity_relationships",
|
|
336
|
+
["entity_2_id"],
|
|
337
|
+
unique=False,
|
|
338
|
+
)
|
|
339
|
+
op.create_index(
|
|
340
|
+
op.f("idx_entity_relationships_entity_1_id_relationship_type_id"),
|
|
341
|
+
"entity_relationships",
|
|
342
|
+
["entity_1_id", "relationship_type_id"],
|
|
343
|
+
unique=False,
|
|
344
|
+
)
|
|
345
|
+
op.create_index(
|
|
346
|
+
op.f("idx_entity_relationships_entity_1_id_entity_2_id_relationship_type_id"),
|
|
347
|
+
"entity_relationships",
|
|
348
|
+
["entity_1_id", "entity_2_id", "relationship_type_id"],
|
|
349
|
+
unique=False,
|
|
350
|
+
)
|
|
351
|
+
op.create_index(
|
|
352
|
+
op.f("idx_entity_relationships_entity_1_id"),
|
|
353
|
+
"entity_relationships",
|
|
354
|
+
["entity_1_id"],
|
|
355
|
+
unique=False,
|
|
356
|
+
)
|
|
357
|
+
op.create_index(
|
|
358
|
+
op.f("idx_entity_relationships_data_source_id"),
|
|
359
|
+
"entity_relationships",
|
|
360
|
+
["data_source_id"],
|
|
361
|
+
unique=False,
|
|
362
|
+
)
|
|
363
|
+
op.create_index(
|
|
364
|
+
op.f("idx_entity_relationship_types_code"),
|
|
365
|
+
"entity_relationship_types",
|
|
366
|
+
["code"],
|
|
367
|
+
unique=False,
|
|
368
|
+
)
|
|
369
|
+
op.create_index(
|
|
370
|
+
op.f("idx_entity_names_name"), "entity_names", ["name"], unique=False
|
|
371
|
+
)
|
|
372
|
+
op.create_index(
|
|
373
|
+
op.f("idx_entity_names_entity_id_is_primary"),
|
|
374
|
+
"entity_names",
|
|
375
|
+
["entity_id", "is_primary"],
|
|
376
|
+
unique=False,
|
|
377
|
+
)
|
|
378
|
+
op.create_index(
|
|
379
|
+
op.f("idx_entity_names_entity_id"), "entity_names", ["entity_id"], unique=False
|
|
380
|
+
)
|
|
381
|
+
op.create_index(
|
|
382
|
+
op.f("idx_entity_names_data_source_id_name"),
|
|
383
|
+
"entity_names",
|
|
384
|
+
["data_source_id", "name"],
|
|
385
|
+
unique=False,
|
|
386
|
+
)
|
|
387
|
+
op.create_index(
|
|
388
|
+
op.f("idx_entity_names_data_source_id_entity_id"),
|
|
389
|
+
"entity_names",
|
|
390
|
+
["data_source_id", "entity_id"],
|
|
391
|
+
unique=False,
|
|
392
|
+
)
|
|
393
|
+
op.create_index(
|
|
394
|
+
op.f("idx_entity_names_data_source_id"),
|
|
395
|
+
"entity_names",
|
|
396
|
+
["data_source_id"],
|
|
397
|
+
unique=False,
|
|
398
|
+
)
|
|
399
|
+
op.create_index(
|
|
400
|
+
op.f("idx_entities_is_deactive"), "entities", ["is_deactive"], unique=False
|
|
401
|
+
)
|
|
402
|
+
op.create_index(
|
|
403
|
+
op.f("idx_entities_has_conflict"), "entities", ["has_conflict"], unique=False
|
|
404
|
+
)
|
|
405
|
+
op.create_index(
|
|
406
|
+
op.f("idx_entities_group_id"), "entities", ["group_id"], unique=False
|
|
407
|
+
)
|
|
408
|
+
# ### end Alembic commands ###
|