diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..51328dc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + checks: + name: Lint and OpenAPI schema + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Lint + run: ruff check app utils tests run.py + + - name: Check docs/openapi.json is up to date + run: python utils/export_openapi.py --check + + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run tests + run: python -m pytest -q diff --git a/.gitmodules b/.gitmodules index d17f658..a89c3d3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "moalmanac-db"] - path = moalmanac-db + path = moalmanac_db url = https://github.com/vanallenlab/moalmanac-db diff --git a/.vscode/settings.json b/.vscode/settings.json index 27480c0..44d539a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,6 @@ "python.defaultInterpreterPath": "/opt/miniconda3/envs/moalmanac-api/bin/python", "python-envs.defaultEnvManager": "ms-python.python:conda", "python-envs.defaultPackageManager": "ms-python.python:conda", - "python-envs.pythonProjects": [], "[python]": { "editor.defaultFormatter": "charliermarsh.ruff" }, diff --git a/README.md b/README.md index 1fe9e5f..f8d17c5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ API for the [moalmanac-db](https://github.com/vanallenlab/moalmanac-db) and [moa This repository can be downloaded through GitHub by either using the website or terminal. To download on the website, navigate to the top of this page, click the green `Clone or download` button, and select `Download ZIP` to download this repository in a compressed format. To install using GitHub on terminal, type: ```bash -git clone https://github.com/vanallenlab/moalmanac-api.git --recursive-submodules +git clone https://github.com/vanallenlab/moalmanac-api.git --recurse-submodules cd moalmanac-api ``` @@ -20,15 +20,17 @@ git submodule update --init --recursive To update moalmanac-db to the latest commit, use [update_submodule_to_commit.sh](update_submodule_to_commit.sh): ```bash -bash update_submodule_to_commit +bash update_submodule_to_commit.sh ``` Alternatively, to update moalmanac-db to a specific commit: ```bash -bash update_submodule_to_commit +bash update_submodule_to_commit.sh ``` +The script also regenerates [docs/openapi.json](docs/openapi.json) (see [OpenAPI schema](#openapi-schema)) and commits it together with the submodule update, so run it with this repository's Python environment activated, or point `PYTHON` at it (e.g. `PYTHON=/path/to/python bash update_submodule_to_commit.sh`). It refuses to run while `app/` has uncommitted changes, so the committed schema matches the committed code, and it commits nothing if regenerating the schema fails. + ### Python dependencies This repository uses Python 3.12. We recommend using a [virtual environment](https://docs.python.org/3/tutorial/venv.html) and running Python with either [Anaconda](https://www.anaconda.com/download/) or [Miniconda](https://conda.io/miniconda.html). @@ -61,7 +63,7 @@ ipython kernel install --user --name=moalmanac-api To update the database content from [moalmanac-db](https://github.com/vanallenlab/moalmanac-db): ```bash -rm data/moalmanac.sqlite3; python -m app.populate_database -i moalmanac-db/referenced/ -c config.ini +rm data/moalmanac.sqlite3; python -m app.populate_database -i moalmanac_db/referenced/ -c config.ini ``` ### Environment configuration @@ -95,6 +97,36 @@ Gunicorn is launched using the provided `ExecStart` command: Systemd and Gunicorn manage launching the application for production using the [service/moalmanac-api.service](service/moalmanac-api.service) file, so there is no need to run `python run.py` for production use. +## Development + +### OpenAPI schema + +The API's interactive documentation is served at [https://api.moalmanac.org](https://api.moalmanac.org). A copy of its OpenAPI schema is committed at [docs/openapi.json](docs/openapi.json), which the [documentation site](https://docs.moalmanac.org) renders. Response schemas and examples in it are built from moalmanac-db's JSON Schemas and records (see [app/schemas.py](app/schemas.py)). + +Regenerate it whenever [app/routers/main/routes.py](./app/routers/main/routes.py) changes (routes, their parameters, or docstrings) or moalmanac-db is updated, and commit it with the change: + +```bash +python utils/export_openapi.py +``` + +[update_submodule_to_commit.sh](update_submodule_to_commit.sh) does this automatically when updating moalmanac-db. + +### Continuous integration + +[GitHub Actions](.github/workflows/ci.yml) runs on every pull request and every push to `main`: + +- `ruff check app utils tests run.py` +- `python utils/export_openapi.py --check`, which fails if [docs/openapi.json](docs/openapi.json) is out of date +- `python -m pytest` + +To run the same checks locally before pushing: + +```bash +ruff check app utils tests run.py +python utils/export_openapi.py --check +python -m pytest +``` + ## Citation If you find this tool or any code herein useful, please cite: diff --git a/app/dereferenced.py b/app/dereferenced.py index 8052d77..07ae0d9 100644 --- a/app/dereferenced.py +++ b/app/dereferenced.py @@ -1,13 +1,13 @@ """ Builds the in-memory cache of dereferenced records served by the API. -The API's SQLite tables mirror moalmanac-db/schemas/referenced (see app.referenced). -Endpoints instead serve records shaped like moalmanac-db/schemas/dereferenced, with +The API's SQLite tables mirror moalmanac_db/schemas/referenced (see app.referenced). +Endpoints instead serve records shaped like moalmanac_db/schemas/dereferenced, with foreign keys resolved to embedded objects. Rather than reimplementing that resolution, this module rebuilds the referenced tables from SQLite (`app.referenced.load_referenced`) and runs them through the moalmanac-db -submodule's own `utils.dereference`, so the submodule stays the single source of -truth for the output shape. +submodule's own `moalmanac_db.utils.dereference`, so the submodule stays the single +source of truth for the output shape. `build_cache` is called once, at startup (see app.main.create_app), and its result is stored on `app.state.dereferenced`. It is a plain read-only dict and is never @@ -15,25 +15,12 @@ """ import copy -import pathlib -import sys import typing import sqlalchemy.orm from app import referenced - -_MOALMANAC_DB_ROOT = ( - pathlib - .Path(__file__) - .resolve() - .parents[1] - / "moalmanac-db" -) -if str(_MOALMANAC_DB_ROOT) not in sys.path: - sys.path.insert(0, str(_MOALMANAC_DB_ROOT)) - -from utils import dereference +from moalmanac_db.utils import dereference # Every table `dereference.Database` needs to resolve foreign keys, keyed by the # same names as app.referenced.TABLES. `urls` has no entry in _CONCEPT_DIRS (it is @@ -71,16 +58,16 @@ def build_cache(session: sqlalchemy.orm.Session) -> Cache: Rebuilds the referenced tables from SQLite, feeds them into a fresh `dereference.Database`, and dereferences each entity in the same order - `utils.dereference.write_all_concepts` uses. This is the entire dereferencing - logic; the API does not duplicate any of it. + `moalmanac_db.utils.dereference.write_all_concepts` uses. This is the entire + dereferencing logic; the API does not duplicate any of it. Args: session (sqlalchemy.orm.Session): The database session to read from. Returns: Cache: `{entity: {id: record}}` for every entity in - `utils.dereference._CONCEPT_DIRS`, each record equal to its file in - moalmanac-db/dereferenced//. Dict order (both the outer entities and + `moalmanac_db.utils.dereference._CONCEPT_DIRS`, each record equal to its file in + moalmanac_db/dereferenced//. Dict order (both the outer entities and each inner id) matches the referenced source, which callers rely on for deterministic, file-order output. """ diff --git a/app/main.py b/app/main.py index 6d11168..d46f1d2 100644 --- a/app/main.py +++ b/app/main.py @@ -3,7 +3,7 @@ import fastapi -from app import database, dereferenced +from app import database, dereferenced, schemas from app.routers.main import router as main_router @@ -21,6 +21,36 @@ def render(self, content: object) -> bytes: return json.dumps(content, indent=2, ensure_ascii=False).encode("utf-8") +def strip_nullable_query_parameters(schema: dict) -> dict: + """ + Removes the null branch from each query parameter's schema, in place. + + Optional query parameters are typed `X | None` so their None default type + checks, which Pydantic renders as `anyOf: [X, {"type": "null"}]`. A query + parameter is omitted rather than sent as null, so the null branch only clutters + the documentation. Response schemas are left alone, where null is a real value. + + Args: + schema (dict): The OpenAPI schema generated by FastAPI. + + Returns: + dict: The same schema, with `anyOf: [X, null]` replaced by `X` for every + query parameter. + """ + for path_item in schema.get("paths", {}).values(): + for operation in path_item.values(): + for parameter in operation.get("parameters", []): + if parameter.get("in") != "query": + continue + parameter_schema = parameter.get("schema", {}) + branches = parameter_schema.get("anyOf", []) + non_null = [branch for branch in branches if branch != {"type": "null"}] + if len(branches) == 2 and len(non_null) == 1: + del parameter_schema["anyOf"] + parameter_schema.update(non_null[0]) + return schema + + def create_app(config_path: str = "config.ini") -> fastapi.FastAPI: """ Creates and configures the FastAPI application instance. @@ -51,7 +81,15 @@ def create_app(config_path: str = "config.ini") -> fastapi.FastAPI: description=( "The Molecular Oncology Almanac (MOAlmanac) is a paired knowledgebase and clinical interpretation " "algorithm for precision cancer medicine. Visit [our website](https://moalmanac.org) for more " - "information." + "information.\n\n" + "**Filtering**\n\n" + "- Different filters combine with AND: `?gene=BRAF&disease=Melanoma` returns records " + "matching all of them.\n" + "- Repeating a filter combines its values with OR: `?gene=BRAF&gene=KRAS` returns records " + "matching any of them.\n" + "- Exception: on `/search`, the `document`, `indication`, and `agent_id` filters narrow " + "each proposition's statement aggregates rather than which propositions are returned. " + "See the `/search` endpoint for details." ), docs_url="/", license_info={ @@ -82,7 +120,7 @@ def create_app(config_path: str = "config.ini") -> fastapi.FastAPI: if not os.path.exists(database_path): raise FileNotFoundError( f"{database_path} does not exist. Run " - "`python -m app.populate_database -i moalmanac-db/referenced -c " + "`python -m app.populate_database -i moalmanac_db/referenced -c " f"{config_path}` to create it.", ) @@ -94,6 +132,24 @@ def create_app(config_path: str = "config.ini") -> fastapi.FastAPI: app.state.dereferenced = cache app.include_router(main_router) + + def openapi() -> dict: + """ + Generates the OpenAPI schema once, without null branches on query parameters + and with moalmanac-db's record schemas added as components. + + Returns: + dict: The cached OpenAPI schema. + """ + if app.openapi_schema is None: + schema = fastapi.FastAPI.openapi(app) + strip_nullable_query_parameters(schema=schema) + schema.setdefault("components", {}).setdefault("schemas", {}).update( + schemas.build_components(), + ) + return app.openapi_schema + + app.openapi = openapi return app diff --git a/app/models.py b/app/models.py index 4c2ae73..4601865 100644 --- a/app/models.py +++ b/app/models.py @@ -1,5 +1,5 @@ """ -SQLAlchemy models mirroring moalmanac-db/schemas/referenced. +SQLAlchemy models mirroring moalmanac_db/schemas/referenced. Each entity table has one column per scalar field of its referenced schema, and the column name is the JSON key. Where the JSON key cannot be a Python attribute @@ -543,17 +543,16 @@ class Documents(Base): nullable=True, ) ) - # Integer or string (or null) per the schema, so stored as JSON - identification_number = sqlalchemy.Column( - sqlalchemy.JSON, - nullable=True, - ) publication_date: sqlalchemy.orm.Mapped[datetime.date | None] = ( sqlalchemy.orm.mapped_column( sqlalchemy.Date, nullable=True, ) ) + regulatory_identifier = sqlalchemy.Column( + sqlalchemy.String, + nullable=True, + ) status = sqlalchemy.Column( sqlalchemy.String, nullable=False, diff --git a/app/populate_database.py b/app/populate_database.py index fa2479a..2b0bdc3 100644 --- a/app/populate_database.py +++ b/app/populate_database.py @@ -481,7 +481,7 @@ def main(referenced_directory: str, config_path: str = "config.ini") -> None: arg_parser.add_argument( "--input", "-i", - default="moalmanac-db/referenced", + default="moalmanac_db/referenced", help="Directory for referenced moalmanac db json files", ) arg_parser.add_argument( diff --git a/app/referenced.py b/app/referenced.py index c9d4873..00be891 100644 --- a/app/referenced.py +++ b/app/referenced.py @@ -320,8 +320,8 @@ def _mappings(association: type[models.Base], owner: str) -> ListField: "drug_name_brand", "drug_name_generic", "first_publication_date", - "identification_number", "publication_date", + "regulatory_identifier", "status", ), lists={ diff --git a/app/routers/main/__init__.py b/app/routers/main/__init__.py index 3a27ef1..1b2eccc 100644 --- a/app/routers/main/__init__.py +++ b/app/routers/main/__init__.py @@ -1 +1,3 @@ from .routes import router + +__all__ = ["router"] diff --git a/app/routers/main/handlers.py b/app/routers/main/handlers.py index cbd59b1..c24083b 100644 --- a/app/routers/main/handlers.py +++ b/app/routers/main/handlers.py @@ -7,8 +7,9 @@ another entity (for example `?gene=BRAF` on `/propositions`). The route then calls `execute_query` for the matching ids and `serialize` to look them up in `app.state.dereferenced[entity]`. Because that cache already holds fully resolved, -correctly ordered records (built by moalmanac-db's own `utils.dereference`), no -handler builds or reorders a response dictionary itself. +correctly ordered records (built by moalmanac-db's own +`moalmanac_db.utils.dereference`), no handler builds or reorders a response +dictionary itself. """ import typing @@ -509,7 +510,8 @@ def perform_joins( ) -> tuple[sqlalchemy.Select, set[type[models.Base]]]: """ Filters by `document` (id), and `agent`/`agent_id` (delegated to - Agents.perform_joins once Documents is joined). + Agents.perform_joins once Documents is joined). `agent_type` is not a + filter on Documents, Indications, or Statements, so it is ignored. When `base_table` is Statements, joins through AssociationDocumentsAndStatements (`reportedIn`); when Indications, through @@ -566,7 +568,11 @@ def perform_joins( statement, joined_tables = Agents.perform_joins( statement=statement, - parameters=parameters, + parameters={ + key: values + for key, values in parameters.items() + if key != "agent_type" + }, base_table=models.Documents, joined_tables=joined_tables, ) diff --git a/app/routers/main/routes.py b/app/routers/main/routes.py index 1cad0af..d19aa93 100644 --- a/app/routers/main/routes.py +++ b/app/routers/main/routes.py @@ -6,12 +6,144 @@ import fastapi import sqlalchemy -from app import database, referenced +from app import database, referenced, schemas from . import handlers router = fastapi.APIRouter() +# Cross-entity filters. Handlers read these from `request.query_params` directly, +# so routes declare them only to document them in the OpenAPI schema. Each may be +# repeated (e.g. `?gene=BRAF&gene=KRAS`) to match any of the given values; values +# are matched exactly and case-sensitively. +AgentFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Agent name, matched exactly. Repeatable; matches any of the given values (OR).", + examples=[["Van Allen lab"]], + ), +] +AgentIdFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Agent id. Repeatable; matches any of the given values (OR).", + examples=[["agent:user:vanallenlab"]], + ), +] +AgentTypeFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Agent type. Repeatable; matches any of the given values (OR).", + examples=[["organization"]], + ), +] +BiomarkerFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Biomarker name, matched exactly. Repeatable; matches any of the given values (OR).", + examples=[["BRAF p.V600E"]], + ), +] +BiomarkerTypeFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Biomarker type. Repeatable; matches any of the given values (OR).", + examples=[["Somatic variant"]], + ), +] +ContributionFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Contribution id. Repeatable; matches any of the given values (OR).", + examples=[["ctrb:vanallenlab:2024-10-30:0"]], + ), +] +DiseaseFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Disease name, matched exactly. Repeatable; matches any of the given values (OR).", + examples=[["Melanoma"]], + ), +] +DocumentFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Document id. Repeatable; matches any of the given values (OR).", + examples=[["doc:fda:verzenio"]], + ), +] +GeneFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Gene symbol, matched exactly. Repeatable; matches any of the given values (OR).", + examples=[["BRAF"]], + ), +] +IndicationFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Indication id. Repeatable; matches any of the given values (OR).", + examples=[["ind:fda:verzenio:0"]], + ), +] +TherapyFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Therapy name, matched exactly. Repeatable; matches any of the given values (OR).", + examples=[["Dabrafenib"]], + ), +] +TherapyTypeFilter = typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Therapy type. Repeatable; matches any of the given values (OR).", + examples=[["Targeted therapy"]], + ), +] +IncludeDeprecated = typing.Annotated[ + bool, + fastapi.Query( + description=( + "Also return deprecated records. Ignored when requesting a single " + "record by id, which is always returned." + ), + ), +] + + +def id_query(entity: str) -> typing.Any: + """ + Builds the query parameter for a route's own single-record id filter. + + Args: + entity (str): The entity name to use in the description, e.g. "agent". + + Returns: + typing.Any: A `fastapi.Query` defaulting to None. + """ + return fastapi.Query( + default=None, + description=f"Return only the {entity} with this id.", + ) + + +def name_query(entity: str, example: str | None = None) -> typing.Any: + """ + Builds the query parameter for a route's own case-insensitive name filter. + + Args: + entity (str): The entity name to use in the description, e.g. "gene". + example (str | None): An example value for the OpenAPI schema. + + Returns: + typing.Any: A `fastapi.Query` defaulting to None. + """ + return fastapi.Query( + default=None, + description=f"Return {entity} records with this name, ignoring case.", + examples=[example] if example else None, + ) + def equals_case_insensitive( column: sqlalchemy.ColumnElement, @@ -37,7 +169,20 @@ def generate_datetime_now() -> datetime.datetime: Returns: datetime.datetime: The current UTC datetime. """ - return datetime.datetime.now(datetime.timezone.utc) + return datetime.datetime.now(datetime.UTC) + + +def format_timestamp(value: datetime.datetime) -> str: + """ + Formats a UTC datetime as an ISO 8601 string ending in `Z`. + + Args: + value (datetime.datetime): A timezone-aware UTC datetime. + + Returns: + str: The timestamp, e.g. "2026-10-16T14:03:12.123456Z". + """ + return value.astimezone(datetime.UTC).isoformat().replace("+00:00", "Z") def get_session_factory( @@ -113,14 +258,14 @@ def create_response( elapsed = returned - received meta = { - "data_length": len(data) if hasattr(data, "__len__") else 1, + "data_length": len(data) if isinstance(data, list) else 1, "message": message, "request_url": request_url, "status": "success" if 200 <= status_code < 300 else "error", "status_code": status_code, "timestamp_elapsed": round(elapsed.total_seconds(), 6), - "timestamp_received": f"{received.isoformat()}Z" if received else None, - "timestamp_returned": f"{returned.isoformat()}Z", + "timestamp_received": format_timestamp(value=received), + "timestamp_returned": format_timestamp(value=returned), "trace_id": str(uuid.uuid4()), } return { @@ -249,7 +394,16 @@ def list_entities( ) -@router.get("/about", tags=["Service Info"]) +@router.get( + "/about", + summary="Service metadata", + tags=["Service Info"], + responses=schemas.object_response( + component="About", + path="/about", + subject="About metadata", + ), +) def get_about( request: fastapi.Request, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), @@ -269,10 +423,22 @@ def get_about( ) -@router.get("/agents", tags=["Entities"]) +@router.get( + "/agents", + summary="List agents", + tags=["Entities"], + responses=schemas.list_response( + component="Agent", + path="/agents", + subject="Agents", + ), +) def get_agents( request: fastapi.Request, - agent_name: str = fastapi.Query(default=None), + agent_name: str | None = name_query("agent", "Van Allen lab"), + agent: AgentFilter = None, + agent_id: AgentIdFilter = None, + agent_type: AgentTypeFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -286,15 +452,26 @@ def get_agents( received=generate_datetime_now(), message_subject=f"Agent name {agent_name}" if agent_name else "Agents", primary_filter=( - equals_case_insensitive(handlers.Agents.model.name, agent_name) if agent_name else None + equals_case_insensitive(handlers.Agents.model.name, agent_name) + if agent_name + else None ), ) -@router.get("/alleles", tags=["Entities"]) +@router.get( + "/alleles", + summary="List alleles", + tags=["Entities"], + responses=schemas.list_response( + component="Allele", + path="/alleles", + subject="Alleles", + ), +) def get_alleles( request: fastapi.Request, - allele_id: str = fastapi.Query(default=None), + allele_id: str | None = id_query("allele"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -310,11 +487,23 @@ def get_alleles( ) -@router.get("/biomarkers", tags=["Entities"]) +@router.get( + "/biomarkers", + summary="List biomarkers", + tags=["Entities"], + responses=schemas.list_response( + component="Biomarker", + path="/biomarkers", + subject="Biomarkers", + ), +) def get_biomarkers( request: fastapi.Request, - biomarker_id: str = fastapi.Query(default=None), - biomarker_name: str = fastapi.Query(default=None), + biomarker_id: str | None = id_query("biomarker"), + biomarker_name: str | None = name_query("biomarker", "BRAF p.V600E"), + biomarker: BiomarkerFilter = None, + biomarker_type: BiomarkerTypeFilter = None, + gene: GeneFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -336,15 +525,26 @@ def get_biomarkers( message_subject=message_subject, primary_filter=combine_filters( handlers.Biomarkers.model.id == biomarker_id if biomarker_id else None, - equals_case_insensitive(handlers.Biomarkers.model.name, biomarker_name) if biomarker_name else None, + equals_case_insensitive(handlers.Biomarkers.model.name, biomarker_name) + if biomarker_name + else None, ), ) -@router.get("/biomarker_criteria", tags=["Entities"]) +@router.get( + "/biomarker_criteria", + summary="List biomarker criteria", + tags=["Entities"], + responses=schemas.list_response( + component="BiomarkerCriterion", + path="/biomarker_criteria", + subject="Biomarker criteria", + ), +) def get_biomarker_criteria( request: fastapi.Request, - biomarker_criterion_id: str = fastapi.Query(default=None), + biomarker_criterion_id: str | None = id_query("biomarker criterion"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -368,10 +568,19 @@ def get_biomarker_criteria( ) -@router.get("/codings", tags=["Entities"]) +@router.get( + "/codings", + summary="List codings", + tags=["Entities"], + responses=schemas.list_response( + component="Coding", + path="/codings", + subject="Codings", + ), +) def get_codings( request: fastapi.Request, - coding_id: str = fastapi.Query(default=None), + coding_id: str | None = id_query("coding"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -388,11 +597,27 @@ def get_codings( ) -@router.get("/contributions", tags=["Entities"]) +@router.get( + "/contributions", + summary="List contributions", + tags=["Entities"], + responses=schemas.list_response( + component="ContributionResult", + path="/contributions", + subject="Contributions", + ), +) def get_contributions( request: fastapi.Request, - contribution_id: str = fastapi.Query(default=None), - include_records: bool = fastapi.Query(default=False), + contribution_id: str | None = id_query("contribution"), + include_records: bool = fastapi.Query( + default=False, + description="Add a `records` extension listing the indications and statements each contribution was made to.", + ), + contribution: ContributionFilter = None, + agent: AgentFilter = None, + agent_id: AgentIdFilter = None, + agent_type: AgentTypeFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -439,10 +664,19 @@ def get_contributions( return response -@router.get("/copy_changes", tags=["Entities"]) +@router.get( + "/copy_changes", + summary="List copy changes", + tags=["Entities"], + responses=schemas.list_response( + component="CopyChange", + path="/copy_changes", + subject="Copy changes", + ), +) def get_copy_changes( request: fastapi.Request, - copy_change_id: str = fastapi.Query(default=None), + copy_change_id: str | None = id_query("copy change"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -462,11 +696,21 @@ def get_copy_changes( ) -@router.get("/diseases", tags=["Entities"]) +@router.get( + "/diseases", + summary="List diseases", + tags=["Entities"], + responses=schemas.list_response( + component="Disease", + path="/diseases", + subject="Diseases", + ), +) def get_diseases( request: fastapi.Request, - disease_id: str = fastapi.Query(default=None), - disease_name: str = fastapi.Query(default=None), + disease_id: str | None = id_query("disease"), + disease_name: str | None = name_query("disease", "Melanoma"), + disease: DiseaseFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -487,16 +731,30 @@ def get_diseases( message_subject=message_subject, primary_filter=combine_filters( handlers.Diseases.model.id == disease_id if disease_id else None, - equals_case_insensitive(handlers.Diseases.model.name, disease_name) if disease_name else None, + equals_case_insensitive(handlers.Diseases.model.name, disease_name) + if disease_name + else None, ), ) -@router.get("/documents", tags=["Entities"]) +@router.get( + "/documents", + summary="List documents", + tags=["Entities"], + responses=schemas.list_response( + component="Document", + path="/documents", + subject="Documents", + ), +) def get_documents( request: fastapi.Request, - document_id: str = fastapi.Query(default=None), - include_deprecated: bool = fastapi.Query(default=False), + document_id: str | None = id_query("document"), + include_deprecated: IncludeDeprecated = False, + document: DocumentFilter = None, + agent: AgentFilter = None, + agent_id: AgentIdFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -520,10 +778,19 @@ def get_documents( ) -@router.get("/function_consequences", tags=["Entities"]) +@router.get( + "/function_consequences", + summary="List function consequences", + tags=["Entities"], + responses=schemas.list_response( + component="FunctionConsequence", + path="/function_consequences", + subject="Function consequences", + ), +) def get_function_consequences( request: fastapi.Request, - function_consequence_id: str = fastapi.Query(default=None), + function_consequence_id: str | None = id_query("function consequence"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -547,11 +814,21 @@ def get_function_consequences( ) -@router.get("/genes", tags=["Entities"]) +@router.get( + "/genes", + summary="List genes", + tags=["Entities"], + responses=schemas.list_response( + component="Gene", + path="/genes", + subject="Genes", + ), +) def get_genes( request: fastapi.Request, - gene_id: str = fastapi.Query(default=None), - gene_name: str = fastapi.Query(default=None), + gene_id: str | None = id_query("gene"), + gene_name: str | None = name_query("gene", "BRAF"), + gene: GeneFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -572,16 +849,31 @@ def get_genes( message_subject=message_subject, primary_filter=combine_filters( handlers.Genes.model.id == gene_id if gene_id else None, - equals_case_insensitive(handlers.Genes.model.name, gene_name) if gene_name else None, + equals_case_insensitive(handlers.Genes.model.name, gene_name) + if gene_name + else None, ), ) -@router.get("/indications", tags=["Entities"]) +@router.get( + "/indications", + summary="List indications", + tags=["Entities"], + responses=schemas.list_response( + component="Indication", + path="/indications", + subject="Indications", + ), +) def get_indications( request: fastapi.Request, - indication_id: str = fastapi.Query(default=None), - include_deprecated: bool = fastapi.Query(default=False), + indication_id: str | None = id_query("indication"), + include_deprecated: IncludeDeprecated = False, + indication: IndicationFilter = None, + document: DocumentFilter = None, + agent: AgentFilter = None, + agent_id: AgentIdFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -608,10 +900,19 @@ def get_indications( ) -@router.get("/mappings", tags=["Entities"]) +@router.get( + "/mappings", + summary="List mappings", + tags=["Entities"], + responses=schemas.list_response( + component="Mapping", + path="/mappings", + subject="Mappings", + ), +) def get_mappings( request: fastapi.Request, - mapping_id: str = fastapi.Query(default=None), + mapping_id: str | None = id_query("mapping"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -629,10 +930,25 @@ def get_mappings( ) -@router.get("/propositions", tags=["Entities"]) +@router.get( + "/propositions", + summary="List propositions", + tags=["Entities"], + responses=schemas.list_response( + component="Proposition", + path="/propositions", + subject="Propositions", + ), +) def get_propositions( request: fastapi.Request, - proposition_id: str = fastapi.Query(default=None), + proposition_id: str | None = id_query("proposition"), + biomarker: BiomarkerFilter = None, + biomarker_type: BiomarkerTypeFilter = None, + gene: GeneFilter = None, + disease: DiseaseFilter = None, + therapy: TherapyFilter = None, + therapy_type: TherapyTypeFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -653,11 +969,32 @@ def get_propositions( ) -@router.get("/search", tags=["Search"]) +@router.get( + "/search", + summary="Search propositions with statement aggregates", + tags=["Search"], + responses=schemas.list_response( + component="SearchResult", + path="/search", + subject="Search results by Proposition", + ), +) def get_search( request: fastapi.Request, - proposition_id: str | None = fastapi.Query(default=None), - include_empty: bool = fastapi.Query(default=False), + proposition_id: str | None = id_query("proposition"), + include_empty: bool = fastapi.Query( + default=False, + description="Also return propositions with zero matching statements.", + ), + biomarker: BiomarkerFilter = None, + biomarker_type: BiomarkerTypeFilter = None, + gene: GeneFilter = None, + disease: DiseaseFilter = None, + therapy: TherapyFilter = None, + therapy_type: TherapyTypeFilter = None, + document: DocumentFilter = None, + indication: IndicationFilter = None, + agent_id: AgentIdFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -712,10 +1049,19 @@ def get_search( ) -@router.get("/sequence_locations", tags=["Entities"]) +@router.get( + "/sequence_locations", + summary="List sequence locations", + tags=["Entities"], + responses=schemas.list_response( + component="SequenceLocation", + path="/sequence_locations", + subject="Sequence locations", + ), +) def get_sequence_locations( request: fastapi.Request, - sequence_location_id: str = fastapi.Query(default=None), + sequence_location_id: str | None = id_query("sequence location"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -739,10 +1085,19 @@ def get_sequence_locations( ) -@router.get("/sequence_references", tags=["Entities"]) +@router.get( + "/sequence_references", + summary="List sequence references", + tags=["Entities"], + responses=schemas.list_response( + component="SequenceReference", + path="/sequence_references", + subject="Sequence references", + ), +) def get_sequence_references( request: fastapi.Request, - sequence_reference_id: str = fastapi.Query(default=None), + sequence_reference_id: str | None = id_query("sequence reference"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -766,11 +1121,37 @@ def get_sequence_references( ) -@router.get("/statements", tags=["Entities"]) +@router.get( + "/statements", + summary="List statements", + tags=["Entities"], + responses=schemas.list_response( + component="Statement", + path="/statements", + subject="Statements", + ), +) def get_statements( request: fastapi.Request, - statement_id: str = fastapi.Query(default=None), - include_deprecated: bool = fastapi.Query(default=False), + statement_id: str | None = id_query("statement"), + include_deprecated: IncludeDeprecated = False, + proposition_id: typing.Annotated[ + list[str] | None, + fastapi.Query( + description="Proposition id. Repeatable; matches any of the given values (OR).", + ), + ] = None, + biomarker: BiomarkerFilter = None, + biomarker_type: BiomarkerTypeFilter = None, + gene: GeneFilter = None, + disease: DiseaseFilter = None, + therapy: TherapyFilter = None, + therapy_type: TherapyTypeFilter = None, + document: DocumentFilter = None, + agent: AgentFilter = None, + agent_id: AgentIdFilter = None, + indication: IndicationFilter = None, + contribution: ContributionFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -800,10 +1181,19 @@ def get_statements( ) -@router.get("/strengths", tags=["Entities"]) +@router.get( + "/strengths", + summary="List strengths", + tags=["Entities"], + responses=schemas.list_response( + component="Strength", + path="/strengths", + subject="Strengths", + ), +) def get_strengths( request: fastapi.Request, - strength_name: str = fastapi.Query(default=None), + strength_name: str | None = name_query("strength"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -819,16 +1209,29 @@ def get_strengths( f"Strength name {strength_name}" if strength_name else "Strengths" ), primary_filter=( - equals_case_insensitive(handlers.Strengths.model.name, strength_name) if strength_name else None + equals_case_insensitive(handlers.Strengths.model.name, strength_name) + if strength_name + else None ), ) -@router.get("/therapies", tags=["Entities"]) +@router.get( + "/therapies", + summary="List therapies", + tags=["Entities"], + responses=schemas.list_response( + component="Therapy", + path="/therapies", + subject="Therapies", + ), +) def get_therapies( request: fastapi.Request, - therapy_id: str = fastapi.Query(default=None), - therapy_name: str = fastapi.Query(default=None), + therapy_id: str | None = id_query("therapy"), + therapy_name: str | None = name_query("therapy", "Dabrafenib"), + therapy: TherapyFilter = None, + therapy_type: TherapyTypeFilter = None, database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ @@ -849,15 +1252,26 @@ def get_therapies( message_subject=message_subject, primary_filter=combine_filters( handlers.Therapies.model.id == therapy_id if therapy_id else None, - equals_case_insensitive(handlers.Therapies.model.name, therapy_name) if therapy_name else None, + equals_case_insensitive(handlers.Therapies.model.name, therapy_name) + if therapy_name + else None, ), ) -@router.get("/therapy_groups", tags=["Entities"]) +@router.get( + "/therapy_groups", + summary="List therapy groups", + tags=["Entities"], + responses=schemas.list_response( + component="TherapyGroup", + path="/therapy_groups", + subject="Therapy groups", + ), +) def get_therapy_groups( request: fastapi.Request, - therapy_group_id: str = fastapi.Query(default=None), + therapy_group_id: str | None = id_query("therapy group"), database: sqlalchemy.orm.Session = fastapi.Depends(get_db), ): """ diff --git a/app/schemas.py b/app/schemas.py new file mode 100644 index 0000000..c5957f0 --- /dev/null +++ b/app/schemas.py @@ -0,0 +1,566 @@ +""" +OpenAPI response schemas, built from moalmanac-db's JSON Schemas. + +The API returns moalmanac-db's dereferenced records unchanged, so its response +schemas are moalmanac-db's own `schemas/dereferenced/*.schema.json` (plus +`schemas/referenced/about.schema.json` for service metadata), copied into the +OpenAPI document's `components/schemas`. moalmanac-db stays the single source of +truth: updating the submodule updates the API documentation. + +These schemas only document responses. Routes do not set `response_model`, so +nothing is validated or re-serialized at request time. + +The db schemas reference each other with relative file `$ref`s +(`genes.schema.json#/$defs/Gene`) and local `$defs` (`#/$defs/Gene`), resolved +through each schema's `$id`. Swagger UI resolves `$ref`s against the OpenAPI +document instead, so each schema's `$defs` become components of their own and +every `$ref` is rewritten to point at `#/components/schemas/...`. + +Each record schema's example is a real record from moalmanac-db's `dereferenced/` +directory (see `EXAMPLE_IDS`). Any other string field with a `pattern` gets a +placeholder from the pattern's literal prefix (e.g. `coding:string`), because +Swagger UI otherwise generates a random string matching the regex. +""" + +import copy +import json +import pathlib +import re +import typing + +DB_DIRECTORY = pathlib.Path(__file__).parent.parent / "moalmanac_db" +DEREFERENCED_DIRECTORY = DB_DIRECTORY / "dereferenced" +SCHEMAS_DIRECTORY = DB_DIRECTORY / "schemas" +COMPONENTS_PREFIX = "#/components/schemas/" + +# The record used as each entity's example, keyed by its `dereferenced/` directory. +# Together they follow one statement: FDA approval of dabrafenib for BRAF p.V600E +# melanoma. If an id no longer exists, the directory's first record is used. +EXAMPLE_IDS = { + "agents": "agent:org:fda", + "alleles": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "biomarker_criteria": "bmkr.criterion:16", + "biomarkers": "bmkr:16", + "codings": "coding:hgnc:1097", + "contributions": "ctrb:fda:2013-05-29:0", + "diseases": "dis:ncit:C3224", + "documents": "doc:fda:tafinlar", + "genes": "gene:hgnc:1097", + "indications": "ind:fda:tafinlar:0", + "mappings": "map:hgnc:1097::ncbi:673", + "propositions": "prop:vtxr:88", + "sequence_locations": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequence_references": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "statements": "stmt:fda:tafinlar:0:0", + "strengths": "str:ncit:C25425", + "therapies": "tx:ncit:C82386", + "therapy_groups": "txgrp:18", +} + +# Hand-written, matching `create_response` in app/routers/main/routes.py. +META_SCHEMA = { + "title": "Meta", + "description": "Information about the request and response.", + "type": "object", + "required": [ + "data_length", + "message", + "request_url", + "status", + "status_code", + "timestamp_elapsed", + "timestamp_received", + "timestamp_returned", + "trace_id", + ], + "properties": { + "data_length": { + "type": "integer", + "description": "Number of records in `data`, or 1 for a single object.", + }, + "message": { + "type": "string", + "description": "Human-readable status message.", + }, + "request_url": { + "type": ["string", "null"], + "description": "The full URL of the request.", + }, + "status": {"type": "string", "enum": ["success", "error"]}, + "status_code": {"type": "integer", "examples": [200]}, + "timestamp_elapsed": { + "type": "number", + "description": "Seconds between receiving the request and returning it.", + }, + "timestamp_received": { + "type": "string", + "format": "date-time", + "description": "When the request was received, in UTC.", + "examples": ["2026-10-16T14:03:12.123456Z"], + }, + "timestamp_returned": { + "type": "string", + "format": "date-time", + "description": "When the response was returned, in UTC.", + "examples": ["2026-10-16T14:03:12.123456Z"], + }, + "trace_id": { + "type": "string", + "format": "uuid", + "description": "Unique id for this response.", + }, + }, + "additionalProperties": False, +} + +CONTRIBUTION_RECORDS_EXTENSION_SCHEMA = { + "type": "object", + "required": ["name", "value", "description"], + "properties": { + "name": {"const": "records"}, + "value": { + "type": "array", + "description": "Indications and statements this contribution was made to.", + "items": { + "type": "object", + "required": ["id", "type", "name", "description"], + "properties": { + "id": {"type": "string"}, + "type": {"type": "string", "enum": ["Indication", "Statement"]}, + "name": {"type": ["string", "null"]}, + "description": {"type": ["string", "null"]}, + }, + "additionalProperties": False, + }, + }, + "description": {"type": "string"}, + }, + "additionalProperties": False, +} + +SEARCH_AGGREGATES_SCHEMA = { + "title": "Search aggregates", + "description": ( + "Counts of Active statements made about this proposition, narrowed by the " + "`document`, `indication`, and `agent_id` filters." + ), + "type": "object", + "required": [ + "statement_count", + "by_direction", + "by_document", + "by_agent", + "by_strength", + ], + "properties": { + "statement_count": {"type": "integer"}, + "by_direction": { + "type": "array", + "items": { + "type": "object", + "required": ["direction", "count"], + "properties": { + "direction": {"type": ["string", "null"]}, + "count": {"type": "integer"}, + }, + "additionalProperties": False, + }, + }, + **{ + key: { + "type": "array", + "items": { + "type": "object", + "required": ["id", "count"], + "properties": { + "id": {"type": "string", "description": description}, + "count": {"type": "integer"}, + }, + "additionalProperties": False, + }, + } + for key, description in ( + ("by_document", "Document id."), + ("by_agent", "Agent id."), + ("by_strength", "Strength id."), + ) + }, + }, + "additionalProperties": False, +} + + +def add_pattern_examples(node: typing.Any) -> typing.Any: + """ + Gives every string schema with a `pattern` and no examples a placeholder + example, in place. + + Args: + node (typing.Any): A schema, or any value within one. + + Returns: + typing.Any: `node`, with placeholder examples added. + """ + if isinstance(node, list): + for item in node: + add_pattern_examples(node=item) + elif isinstance(node, dict): + pattern = node.get("pattern") + if ( + isinstance(pattern, str) + and node.get("type", "string") == "string" + and "examples" not in node + ): + example = pattern_example(pattern=pattern) + if example is not None: + node["examples"] = [example] + for value in node.values(): + add_pattern_examples(node=value) + return node + + +def build_components() -> dict[str, dict]: + """ + Builds the OpenAPI component schemas for every API response. + + Returns: + dict[str, dict]: Component schemas keyed by name: one per db schema + (named by its `title`, e.g. `Agent`), one per `$defs` entry (e.g. + `Indication.FDAIndication`), plus `Meta` and the API-specific + `SearchResult` and `ContributionResult`. + """ + paths = [ + *sorted((SCHEMAS_DIRECTORY / "dereferenced").glob("*.schema.json")), + SCHEMAS_DIRECTORY / "referenced" / "about.schema.json", + ] + loaded = {path.name: json.loads(path.read_text()) for path in paths} + titles = {filename: schema["title"] for filename, schema in loaded.items()} + + components: dict[str, dict] = {} + for filename, schema in loaded.items(): + title = titles[filename] + schema = copy.deepcopy(schema) + schema.pop("$schema", None) + schema.pop("$id", None) + definitions = schema.pop("$defs", {}) + example = load_example(filename=filename) + if example is not None: + schema["examples"] = [example] + components[title] = rewrite_references( + node=schema, + filename=filename, + titles=titles, + ) + for name, definition in definitions.items(): + component_name = definition_component_name(title=title, name=name) + if component_name in components: + raise ValueError(f"Duplicate component name {component_name}.") + components[component_name] = rewrite_references( + node=definition, + filename=filename, + titles=titles, + ) + + search_result = copy.deepcopy(components["Proposition"]) + search_result["title"] = "SearchResult" + search_result["examples"] = [search_result_example(components=components)] + search_result["description"] = ( + "A Proposition with aggregated information about the statements made about it." + ) + search_result["properties"]["aggregates"] = SEARCH_AGGREGATES_SCHEMA + search_result.setdefault("required", []).append("aggregates") + components["SearchResult"] = search_result + + contribution_result = copy.deepcopy(components["Contribution"]) + contribution_result["title"] = "ContributionResult" + contribution_result["description"] = ( + "A Contribution, with a `records` extension when requested with " + "`include_records=true`." + ) + contribution_result["properties"]["extensions"] = { + "type": "array", + "items": CONTRIBUTION_RECORDS_EXTENSION_SCHEMA, + } + components["ContributionResult"] = contribution_result + + components["Meta"] = META_SCHEMA + add_pattern_examples(node=components) + return components + + +def definition_component_name(title: str, name: str) -> str: + """ + Names the component for one `$defs` entry of a db schema. + + OpenAPI component names may only contain letters, digits, `.`, `-`, and `_`, + so `name` is converted to PascalCase. + + Args: + title (str): The title of the schema the definition belongs to, e.g. + "Indication". + name (str): The `$defs` key, e.g. "FDA Indication". + + Returns: + str: The component name, e.g. "Indication.FDAIndication". + """ + words = re.split(r"[^A-Za-z0-9]+", name) + return f"{title}." + "".join(word[:1].upper() + word[1:] for word in words) + + +def envelope(data: dict, path: str, message: str) -> dict: + """ + Wraps a `data` schema in the standard response envelope of meta, service, and + data. + + Args: + data (dict): The schema for the `data` key. + path (str): The endpoint's path, for the example `meta`, e.g. "/agents". + message (str): The endpoint's `meta.message`, for the example `meta`. + + Returns: + dict: The envelope schema. + """ + return { + "type": "object", + "required": ["meta", "service", "data"], + "properties": { + "meta": { + "$ref": f"{COMPONENTS_PREFIX}Meta", + "examples": [meta_example(path=path, message=message)], + }, + "service": { + "$ref": f"{COMPONENTS_PREFIX}About", + "description": "Service and database release metadata.", + }, + "data": data, + }, + "additionalProperties": False, + } + + +def list_response( + component: str, + path: str, + subject: str, +) -> dict[int | str, dict[str, typing.Any]]: + """ + Builds a route's `responses` for an endpoint returning a list of records. + + Args: + component (str): The component name of one record, e.g. "Agent". + path (str): The endpoint's path, e.g. "/agents". + subject (str): The subject of the endpoint's `meta.message`, e.g. "Agents". + + Returns: + dict[int | str, dict[str, typing.Any]]: The value for the route's + `responses` argument. + """ + return { + 200: { + "description": f"Matching {component} records.", + "content": { + "application/json": { + "schema": envelope( + data={ + "type": "array", + "items": {"$ref": f"{COMPONENTS_PREFIX}{component}"}, + }, + path=path, + message=f"{subject} retrieved successfully", + ), + }, + }, + }, + } + + +def load_example(filename: str) -> dict | None: + """ + Loads the moalmanac-db record used as the example for one db schema. + + Args: + filename (str): The schema's filename, e.g. "agents.schema.json". + + Returns: + dict | None: The record named in `EXAMPLE_IDS`, or the directory's first + record if that id no longer exists, or None if the schema has no + record directory (e.g. `extension.schema.json`). + """ + if filename == "about.schema.json": + return json.loads((DB_DIRECTORY / "referenced" / "about.json").read_text()) + + directory = DEREFERENCED_DIRECTORY / filename.removesuffix(".schema.json") + if not directory.is_dir(): + return None + + record_id = EXAMPLE_IDS.get(directory.name, "") + path = directory / f"{record_id.replace(':', '_')}.json" + if not path.is_file(): + records = sorted(directory.glob("*.json")) + if not records: + return None + path = records[0] + return json.loads(path.read_text()) + + +def meta_example(path: str, message: str) -> dict: + """ + Builds an example `meta` block for one endpoint. + + Args: + path (str): The endpoint's path, e.g. "/agents". + message (str): The endpoint's `meta.message`. + + Returns: + dict: An example `meta` block describing a one-record response. + """ + return { + "data_length": 1, + "message": message, + "request_url": f"https://api.moalmanac.org{path}", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + } + + +def object_response( + component: str, + path: str, + subject: str, +) -> dict[int | str, dict[str, typing.Any]]: + """ + Builds a route's `responses` for an endpoint returning a single object. + + Args: + component (str): The component name of the object, e.g. "About". + path (str): The endpoint's path, e.g. "/about". + subject (str): The subject of the endpoint's `meta.message`, e.g. + "About metadata". + + Returns: + dict[int | str, dict[str, typing.Any]]: The value for the route's + `responses` argument. + """ + return { + 200: { + "description": f"The {component} record.", + "content": { + "application/json": { + "schema": envelope( + data={"$ref": f"{COMPONENTS_PREFIX}{component}"}, + path=path, + message=f"{subject} retrieved successfully", + ), + }, + }, + }, + } + + +def pattern_example(pattern: str) -> str | None: + """ + Builds a placeholder example from the literal prefix of a regex pattern. + + Args: + pattern (str): The regex, e.g. "^bmkr\\.criterion:\\d+$". + + Returns: + str | None: The literal prefix followed by "string", e.g. + "bmkr.criterion:string", or None if the pattern has no literal prefix. + """ + if not pattern.startswith("^"): + return None + + prefix = "" + characters = iter(pattern[1:]) + for character in characters: + if character == "\\": + escaped = next(characters, "") + if escaped.isalnum() or not escaped: + break + prefix += escaped + elif character in ".[](){}*+?|$^": + break + else: + prefix += character + return f"{prefix}string" if prefix else None + + +def rewrite_references( + node: typing.Any, + filename: str, + titles: dict[str, str], +) -> typing.Any: + """ + Rewrites every `$ref` in a db schema to point into `#/components/schemas`. + + Args: + node (typing.Any): A schema, or any value within one. + filename (str): The file the schema came from, which local `#/$defs/...` + references resolve against. + titles (dict[str, str]): Schema titles keyed by filename. + + Returns: + typing.Any: `node`, with `$ref`s rewritten in place. + + Raises: + ValueError: If a `$ref` is not of a form used by moalmanac-db's schemas. + """ + if isinstance(node, list): + for item in node: + rewrite_references(node=item, filename=filename, titles=titles) + elif isinstance(node, dict): + reference = node.get("$ref") + if isinstance(reference, str): + target, _, fragment = reference.partition("#") + target = target or filename + if target not in titles: + raise ValueError(f"Unknown $ref target {reference!r} in {filename}.") + target_title = titles[target] + if fragment == "": + node["$ref"] = f"{COMPONENTS_PREFIX}{target_title}" + elif fragment.startswith("/$defs/"): + name = fragment.removeprefix("/$defs/") + node["$ref"] = COMPONENTS_PREFIX + definition_component_name( + title=target_title, + name=name, + ) + else: + raise ValueError(f"Unsupported $ref {reference!r} in {filename}.") + for key, value in node.items(): + if key != "$ref": + rewrite_references(node=value, filename=filename, titles=titles) + return node + + +def search_result_example(components: dict[str, dict]) -> dict: + """ + Builds the SearchResult example: the example Proposition, with aggregates + counting only the example Statement, which is made about that proposition. + + Args: + components (dict[str, dict]): Component schemas built so far, including + examples for `Proposition` and `Statement`. + + Returns: + dict: An illustrative `/search` result. + """ + proposition = components["Proposition"]["examples"][0] + statement = components["Statement"]["examples"][0] + return { + **proposition, + "aggregates": { + "statement_count": 1, + "by_direction": [{"direction": statement["direction"], "count": 1}], + "by_document": [ + {"id": document["id"], "count": 1} + for document in statement["reportedIn"] + ], + "by_agent": [{"id": EXAMPLE_IDS["agents"], "count": 1}], + "by_strength": [{"id": statement["strength"]["id"], "count": 1}], + }, + } diff --git a/data/moalmanac.sqlite3 b/data/moalmanac.sqlite3 index 0544623..301e320 100644 Binary files a/data/moalmanac.sqlite3 and b/data/moalmanac.sqlite3 differ diff --git a/docs/openapi.json b/docs/openapi.json new file mode 100644 index 0000000..41e7b5a --- /dev/null +++ b/docs/openapi.json @@ -0,0 +1,11311 @@ +{ + "openapi": "3.1.0", + "info": { + "title": "Molecular Oncology Almanac API", + "description": "The Molecular Oncology Almanac (MOAlmanac) is a paired knowledgebase and clinical interpretation algorithm for precision cancer medicine. Visit [our website](https://moalmanac.org) for more information.\n\n**Filtering**\n\n- Different filters combine with AND: `?gene=BRAF&disease=Melanoma` returns records matching all of them.\n- Repeating a filter combines its values with OR: `?gene=BRAF&gene=KRAS` returns records matching any of them.\n- Exception: on `/search`, the `document`, `indication`, and `agent_id` filters narrow each proposition's statement aggregates rather than which propositions are returned. See the `/search` endpoint for details.", + "contact": { + "name": "MOAlmanac API GitHub", + "url": "https://github.com/vanallenlab/moalmanac-api" + }, + "license": { + "name": "License: GNU GPL, Version 2", + "url": "https://github.com/vanallenlab/moalmanac-api/blob/main/LICENSE" + }, + "version": "draft" + }, + "paths": { + "/about": { + "get": { + "tags": [ + "Service Info" + ], + "summary": "Service metadata", + "description": "Retrieves service metadata from the About table in the database.", + "operationId": "get_about_about_get", + "responses": { + "200": { + "description": "The About record.", + "content": { + "application/json": { + "schema": { + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "About metadata retrieved successfully", + "request_url": "https://api.moalmanac.org/about", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "$ref": "#/components/schemas/About" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "meta", + "service", + "data" + ] + } + } + } + } + } + } + }, + "/agents": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List agents", + "description": "Retrieves Agents from the database. Filters by agent_name, agent_id, and\nagent_type. agent_name is matched case-insensitively.", + "operationId": "get_agents_agents_get", + "parameters": [ + { + "name": "agent_name", + "in": "query", + "required": false, + "schema": { + "description": "Return agent records with this name, ignoring case.", + "examples": [ + "Van Allen lab" + ], + "title": "Agent Name", + "type": "string" + }, + "description": "Return agent records with this name, ignoring case." + }, + { + "name": "agent", + "in": "query", + "required": false, + "schema": { + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Van Allen lab" + ] + ], + "title": "Agent", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { + "description": "Agent id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "agent:user:vanallenlab" + ] + ], + "title": "Agent Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_type", + "in": "query", + "required": false, + "schema": { + "description": "Agent type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "organization" + ] + ], + "title": "Agent Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent type. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Agent records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Agents retrieved successfully", + "request_url": "https://api.moalmanac.org/agents", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Agent" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/alleles": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List alleles", + "description": "Retrieves Alleles from the database.", + "operationId": "get_alleles_alleles_get", + "parameters": [ + { + "name": "allele_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the allele with this id.", + "title": "Allele Id", + "type": "string" + }, + "description": "Return only the allele with this id." + } + ], + "responses": { + "200": { + "description": "Matching Allele records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Alleles retrieved successfully", + "request_url": "https://api.moalmanac.org/alleles", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Allele" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/biomarkers": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List biomarkers", + "description": "Retrieves Biomarkers from the database. Filters by biomarker_id,\nbiomarker_name, biomarker_type, and gene. biomarker_name is matched\ncase-insensitively.", + "operationId": "get_biomarkers_biomarkers_get", + "parameters": [ + { + "name": "biomarker_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the biomarker with this id.", + "title": "Biomarker Id", + "type": "string" + }, + "description": "Return only the biomarker with this id." + }, + { + "name": "biomarker_name", + "in": "query", + "required": false, + "schema": { + "description": "Return biomarker records with this name, ignoring case.", + "examples": [ + "BRAF p.V600E" + ], + "title": "Biomarker Name", + "type": "string" + }, + "description": "Return biomarker records with this name, ignoring case." + }, + { + "name": "biomarker", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF p.V600E" + ] + ], + "title": "Biomarker", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "biomarker_type", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Somatic variant" + ] + ], + "title": "Biomarker Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker type. Repeatable; matches any of the given values (OR)." + }, + { + "name": "gene", + "in": "query", + "required": false, + "schema": { + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF" + ] + ], + "title": "Gene", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Biomarker records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Biomarkers retrieved successfully", + "request_url": "https://api.moalmanac.org/biomarkers", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Biomarker" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/biomarker_criteria": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List biomarker criteria", + "description": "Retrieves Biomarker Criteria from the database.", + "operationId": "get_biomarker_criteria_biomarker_criteria_get", + "parameters": [ + { + "name": "biomarker_criterion_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the biomarker criterion with this id.", + "title": "Biomarker Criterion Id", + "type": "string" + }, + "description": "Return only the biomarker criterion with this id." + } + ], + "responses": { + "200": { + "description": "Matching BiomarkerCriterion records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Biomarker criteria retrieved successfully", + "request_url": "https://api.moalmanac.org/biomarker_criteria", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BiomarkerCriterion" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/codings": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List codings", + "description": "Retrieves Codings from the database. Codings are representations of a concept\nfrom another website.", + "operationId": "get_codings_codings_get", + "parameters": [ + { + "name": "coding_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the coding with this id.", + "title": "Coding Id", + "type": "string" + }, + "description": "Return only the coding with this id." + } + ], + "responses": { + "200": { + "description": "Matching Coding records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Codings retrieved successfully", + "request_url": "https://api.moalmanac.org/codings", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Coding" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/contributions": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List contributions", + "description": "Retrieves Contributions from the database. Filters by contribution_id, agent,\nand agent_id. When include_records=true, each contribution gains a `records`\nextension listing the indications and statements it was made to, as\n{id, type, name, description}.", + "operationId": "get_contributions_contributions_get", + "parameters": [ + { + "name": "contribution_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the contribution with this id.", + "title": "Contribution Id", + "type": "string" + }, + "description": "Return only the contribution with this id." + }, + { + "name": "include_records", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "description": "Add a `records` extension listing the indications and statements each contribution was made to.", + "default": false, + "title": "Include Records" + }, + "description": "Add a `records` extension listing the indications and statements each contribution was made to." + }, + { + "name": "contribution", + "in": "query", + "required": false, + "schema": { + "description": "Contribution id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "ctrb:vanallenlab:2024-10-30:0" + ] + ], + "title": "Contribution", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Contribution id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent", + "in": "query", + "required": false, + "schema": { + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Van Allen lab" + ] + ], + "title": "Agent", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { + "description": "Agent id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "agent:user:vanallenlab" + ] + ], + "title": "Agent Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_type", + "in": "query", + "required": false, + "schema": { + "description": "Agent type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "organization" + ] + ], + "title": "Agent Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent type. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching ContributionResult records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Contributions retrieved successfully", + "request_url": "https://api.moalmanac.org/contributions", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ContributionResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/copy_changes": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List copy changes", + "description": "Retrieves Copy Changes from the database.", + "operationId": "get_copy_changes_copy_changes_get", + "parameters": [ + { + "name": "copy_change_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the copy change with this id.", + "title": "Copy Change Id", + "type": "string" + }, + "description": "Return only the copy change with this id." + } + ], + "responses": { + "200": { + "description": "Matching CopyChange records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Copy changes retrieved successfully", + "request_url": "https://api.moalmanac.org/copy_changes", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CopyChange" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/diseases": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List diseases", + "description": "Retrieves Diseases from the database. Filters by disease_id and disease_name.\ndisease_name is matched case-insensitively.", + "operationId": "get_diseases_diseases_get", + "parameters": [ + { + "name": "disease_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the disease with this id.", + "title": "Disease Id", + "type": "string" + }, + "description": "Return only the disease with this id." + }, + { + "name": "disease_name", + "in": "query", + "required": false, + "schema": { + "description": "Return disease records with this name, ignoring case.", + "examples": [ + "Melanoma" + ], + "title": "Disease Name", + "type": "string" + }, + "description": "Return disease records with this name, ignoring case." + }, + { + "name": "disease", + "in": "query", + "required": false, + "schema": { + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Melanoma" + ] + ], + "title": "Disease", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Disease records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Diseases retrieved successfully", + "request_url": "https://api.moalmanac.org/diseases", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Disease" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/documents": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List documents", + "description": "Retrieves Documents from the database. Filters by document_id, agent, and\nagent_id. Only Active documents are returned, unless include_deprecated=true,\nwhich also returns Deprecated documents. Deprecated documents are always\nreturned when requested by document_id.", + "operationId": "get_documents_documents_get", + "parameters": [ + { + "name": "document_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the document with this id.", + "title": "Document Id", + "type": "string" + }, + "description": "Return only the document with this id." + }, + { + "name": "include_deprecated", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "description": "Also return deprecated records. Ignored when requesting a single record by id, which is always returned.", + "default": false, + "title": "Include Deprecated" + }, + "description": "Also return deprecated records. Ignored when requesting a single record by id, which is always returned." + }, + { + "name": "document", + "in": "query", + "required": false, + "schema": { + "description": "Document id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "doc:fda:verzenio" + ] + ], + "title": "Document", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Document id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent", + "in": "query", + "required": false, + "schema": { + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Van Allen lab" + ] + ], + "title": "Agent", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { + "description": "Agent id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "agent:user:vanallenlab" + ] + ], + "title": "Agent Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent id. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Document records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Documents retrieved successfully", + "request_url": "https://api.moalmanac.org/documents", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/function_consequences": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List function consequences", + "description": "Retrieves Function Consequences from the database.", + "operationId": "get_function_consequences_function_consequences_get", + "parameters": [ + { + "name": "function_consequence_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the function consequence with this id.", + "title": "Function Consequence Id", + "type": "string" + }, + "description": "Return only the function consequence with this id." + } + ], + "responses": { + "200": { + "description": "Matching FunctionConsequence records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Function consequences retrieved successfully", + "request_url": "https://api.moalmanac.org/function_consequences", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FunctionConsequence" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/genes": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List genes", + "description": "Retrieves Genes from the database. Filters by gene_id and gene_name.\ngene_name is matched case-insensitively.", + "operationId": "get_genes_genes_get", + "parameters": [ + { + "name": "gene_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the gene with this id.", + "title": "Gene Id", + "type": "string" + }, + "description": "Return only the gene with this id." + }, + { + "name": "gene_name", + "in": "query", + "required": false, + "schema": { + "description": "Return gene records with this name, ignoring case.", + "examples": [ + "BRAF" + ], + "title": "Gene Name", + "type": "string" + }, + "description": "Return gene records with this name, ignoring case." + }, + { + "name": "gene", + "in": "query", + "required": false, + "schema": { + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF" + ] + ], + "title": "Gene", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Gene records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Genes retrieved successfully", + "request_url": "https://api.moalmanac.org/genes", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Gene" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/indications": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List indications", + "description": "Retrieves Indications (regulatory approvals) from the database. Filters by\nindication_id, document, agent, and agent_id. Only Approved and Accelerated\nindications are returned, unless include_deprecated=true, which also returns\nSuperseded and Withdrawn indications. Superseded and Withdrawn indications\nare always returned when requested by indication_id.", + "operationId": "get_indications_indications_get", + "parameters": [ + { + "name": "indication_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the indication with this id.", + "title": "Indication Id", + "type": "string" + }, + "description": "Return only the indication with this id." + }, + { + "name": "include_deprecated", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "description": "Also return deprecated records. Ignored when requesting a single record by id, which is always returned.", + "default": false, + "title": "Include Deprecated" + }, + "description": "Also return deprecated records. Ignored when requesting a single record by id, which is always returned." + }, + { + "name": "indication", + "in": "query", + "required": false, + "schema": { + "description": "Indication id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "ind:fda:verzenio:0" + ] + ], + "title": "Indication", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Indication id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "document", + "in": "query", + "required": false, + "schema": { + "description": "Document id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "doc:fda:verzenio" + ] + ], + "title": "Document", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Document id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent", + "in": "query", + "required": false, + "schema": { + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Van Allen lab" + ] + ], + "title": "Agent", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { + "description": "Agent id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "agent:user:vanallenlab" + ] + ], + "title": "Agent Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent id. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Indication records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Indications retrieved successfully", + "request_url": "https://api.moalmanac.org/indications", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Indication" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/mappings": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List mappings", + "description": "Retrieves Mappings from the database. Mappings are relationships between two Codings.", + "operationId": "get_mappings_mappings_get", + "parameters": [ + { + "name": "mapping_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the mapping with this id.", + "title": "Mapping Id", + "type": "string" + }, + "description": "Return only the mapping with this id." + } + ], + "responses": { + "200": { + "description": "Matching Mapping records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Mappings retrieved successfully", + "request_url": "https://api.moalmanac.org/mappings", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mapping" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/propositions": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List propositions", + "description": "Retrieves Propositions from the database. Filters by proposition_id,\nbiomarker, biomarker_type, gene, disease, therapy, and therapy_type.", + "operationId": "get_propositions_propositions_get", + "parameters": [ + { + "name": "proposition_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the proposition with this id.", + "title": "Proposition Id", + "type": "string" + }, + "description": "Return only the proposition with this id." + }, + { + "name": "biomarker", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF p.V600E" + ] + ], + "title": "Biomarker", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "biomarker_type", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Somatic variant" + ] + ], + "title": "Biomarker Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker type. Repeatable; matches any of the given values (OR)." + }, + { + "name": "gene", + "in": "query", + "required": false, + "schema": { + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF" + ] + ], + "title": "Gene", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "disease", + "in": "query", + "required": false, + "schema": { + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Melanoma" + ] + ], + "title": "Disease", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy", + "in": "query", + "required": false, + "schema": { + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Dabrafenib" + ] + ], + "title": "Therapy", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy_type", + "in": "query", + "required": false, + "schema": { + "description": "Therapy type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Targeted therapy" + ] + ], + "title": "Therapy Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy type. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Proposition records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Propositions retrieved successfully", + "request_url": "https://api.moalmanac.org/propositions", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Proposition" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/search": { + "get": { + "tags": [ + "Search" + ], + "summary": "Search propositions with statement aggregates", + "description": "Searches Propositions, with aggregated Statement information attached to each.\nWhich propositions are returned is filtered the same way as /propositions\n(proposition_id, biomarker, biomarker_type, gene, disease, therapy,\ntherapy_type). document, indication, and agent_id instead narrow each\nproposition's Statement aggregates, without changing which propositions are\nreturned; those aggregates only count Active statements. include_empty=true\nalso returns propositions with zero matching statements.", + "operationId": "get_search_search_get", + "parameters": [ + { + "name": "proposition_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the proposition with this id.", + "title": "Proposition Id", + "type": "string" + }, + "description": "Return only the proposition with this id." + }, + { + "name": "include_empty", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "description": "Also return propositions with zero matching statements.", + "default": false, + "title": "Include Empty" + }, + "description": "Also return propositions with zero matching statements." + }, + { + "name": "biomarker", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF p.V600E" + ] + ], + "title": "Biomarker", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "biomarker_type", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Somatic variant" + ] + ], + "title": "Biomarker Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker type. Repeatable; matches any of the given values (OR)." + }, + { + "name": "gene", + "in": "query", + "required": false, + "schema": { + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF" + ] + ], + "title": "Gene", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "disease", + "in": "query", + "required": false, + "schema": { + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Melanoma" + ] + ], + "title": "Disease", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy", + "in": "query", + "required": false, + "schema": { + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Dabrafenib" + ] + ], + "title": "Therapy", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy_type", + "in": "query", + "required": false, + "schema": { + "description": "Therapy type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Targeted therapy" + ] + ], + "title": "Therapy Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy type. Repeatable; matches any of the given values (OR)." + }, + { + "name": "document", + "in": "query", + "required": false, + "schema": { + "description": "Document id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "doc:fda:verzenio" + ] + ], + "title": "Document", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Document id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "indication", + "in": "query", + "required": false, + "schema": { + "description": "Indication id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "ind:fda:verzenio:0" + ] + ], + "title": "Indication", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Indication id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { + "description": "Agent id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "agent:user:vanallenlab" + ] + ], + "title": "Agent Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent id. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching SearchResult records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Search results by Proposition retrieved successfully", + "request_url": "https://api.moalmanac.org/search", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SearchResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/sequence_locations": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List sequence locations", + "description": "Retrieves Sequence Locations from the database.", + "operationId": "get_sequence_locations_sequence_locations_get", + "parameters": [ + { + "name": "sequence_location_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the sequence location with this id.", + "title": "Sequence Location Id", + "type": "string" + }, + "description": "Return only the sequence location with this id." + } + ], + "responses": { + "200": { + "description": "Matching SequenceLocation records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Sequence locations retrieved successfully", + "request_url": "https://api.moalmanac.org/sequence_locations", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/sequence_references": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List sequence references", + "description": "Retrieves Sequence References from the database.", + "operationId": "get_sequence_references_sequence_references_get", + "parameters": [ + { + "name": "sequence_reference_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the sequence reference with this id.", + "title": "Sequence Reference Id", + "type": "string" + }, + "description": "Return only the sequence reference with this id." + } + ], + "responses": { + "200": { + "description": "Matching SequenceReference records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Sequence references retrieved successfully", + "request_url": "https://api.moalmanac.org/sequence_references", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SequenceReference" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/statements": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List statements", + "description": "Retrieves Statements from the database. This endpoint essentially fetches the\nentire database, and will take several seconds to complete. Filters by\nstatement_id, proposition_id, biomarker, biomarker_type, gene, disease,\ntherapy, therapy_type, document, agent, agent_id, indication, and\ncontribution. Only Active statements are returned, unless\ninclude_deprecated=true, which also returns Superseded and Deprecated\nstatements. Superseded and Deprecated statements are always returned when\nrequested by statement_id.", + "operationId": "get_statements_statements_get", + "parameters": [ + { + "name": "statement_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the statement with this id.", + "title": "Statement Id", + "type": "string" + }, + "description": "Return only the statement with this id." + }, + { + "name": "include_deprecated", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "description": "Also return deprecated records. Ignored when requesting a single record by id, which is always returned.", + "default": false, + "title": "Include Deprecated" + }, + "description": "Also return deprecated records. Ignored when requesting a single record by id, which is always returned." + }, + { + "name": "proposition_id", + "in": "query", + "required": false, + "schema": { + "description": "Proposition id. Repeatable; matches any of the given values (OR).", + "title": "Proposition Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Proposition id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "biomarker", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF p.V600E" + ] + ], + "title": "Biomarker", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "biomarker_type", + "in": "query", + "required": false, + "schema": { + "description": "Biomarker type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Somatic variant" + ] + ], + "title": "Biomarker Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Biomarker type. Repeatable; matches any of the given values (OR)." + }, + { + "name": "gene", + "in": "query", + "required": false, + "schema": { + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "BRAF" + ] + ], + "title": "Gene", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Gene symbol, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "disease", + "in": "query", + "required": false, + "schema": { + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Melanoma" + ] + ], + "title": "Disease", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Disease name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy", + "in": "query", + "required": false, + "schema": { + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Dabrafenib" + ] + ], + "title": "Therapy", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy_type", + "in": "query", + "required": false, + "schema": { + "description": "Therapy type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Targeted therapy" + ] + ], + "title": "Therapy Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy type. Repeatable; matches any of the given values (OR)." + }, + { + "name": "document", + "in": "query", + "required": false, + "schema": { + "description": "Document id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "doc:fda:verzenio" + ] + ], + "title": "Document", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Document id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent", + "in": "query", + "required": false, + "schema": { + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Van Allen lab" + ] + ], + "title": "Agent", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "agent_id", + "in": "query", + "required": false, + "schema": { + "description": "Agent id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "agent:user:vanallenlab" + ] + ], + "title": "Agent Id", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Agent id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "indication", + "in": "query", + "required": false, + "schema": { + "description": "Indication id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "ind:fda:verzenio:0" + ] + ], + "title": "Indication", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Indication id. Repeatable; matches any of the given values (OR)." + }, + { + "name": "contribution", + "in": "query", + "required": false, + "schema": { + "description": "Contribution id. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "ctrb:vanallenlab:2024-10-30:0" + ] + ], + "title": "Contribution", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Contribution id. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Statement records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Statements retrieved successfully", + "request_url": "https://api.moalmanac.org/statements", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Statement" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/strengths": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List strengths", + "description": "Retrieves Strengths from the database. Filters by strength_name, which is\nmatched case-insensitively.", + "operationId": "get_strengths_strengths_get", + "parameters": [ + { + "name": "strength_name", + "in": "query", + "required": false, + "schema": { + "description": "Return strength records with this name, ignoring case.", + "title": "Strength Name", + "type": "string" + }, + "description": "Return strength records with this name, ignoring case." + } + ], + "responses": { + "200": { + "description": "Matching Strength records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Strengths retrieved successfully", + "request_url": "https://api.moalmanac.org/strengths", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Strength" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/therapies": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List therapies", + "description": "Retrieves Therapies from the database. Filters by therapy_id, therapy_name,\nand therapy_type. therapy_name is matched case-insensitively.", + "operationId": "get_therapies_therapies_get", + "parameters": [ + { + "name": "therapy_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the therapy with this id.", + "title": "Therapy Id", + "type": "string" + }, + "description": "Return only the therapy with this id." + }, + { + "name": "therapy_name", + "in": "query", + "required": false, + "schema": { + "description": "Return therapy records with this name, ignoring case.", + "examples": [ + "Dabrafenib" + ], + "title": "Therapy Name", + "type": "string" + }, + "description": "Return therapy records with this name, ignoring case." + }, + { + "name": "therapy", + "in": "query", + "required": false, + "schema": { + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Dabrafenib" + ] + ], + "title": "Therapy", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy name, matched exactly. Repeatable; matches any of the given values (OR)." + }, + { + "name": "therapy_type", + "in": "query", + "required": false, + "schema": { + "description": "Therapy type. Repeatable; matches any of the given values (OR).", + "examples": [ + [ + "Targeted therapy" + ] + ], + "title": "Therapy Type", + "type": "array", + "items": { + "type": "string" + } + }, + "description": "Therapy type. Repeatable; matches any of the given values (OR)." + } + ], + "responses": { + "200": { + "description": "Matching Therapy records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Therapies retrieved successfully", + "request_url": "https://api.moalmanac.org/therapies", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Therapy" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/therapy_groups": { + "get": { + "tags": [ + "Entities" + ], + "summary": "List therapy groups", + "description": "Retrieves Therapy Groups from the database.", + "operationId": "get_therapy_groups_therapy_groups_get", + "parameters": [ + { + "name": "therapy_group_id", + "in": "query", + "required": false, + "schema": { + "description": "Return only the therapy group with this id.", + "title": "Therapy Group Id", + "type": "string" + }, + "description": "Return only the therapy group with this id." + } + ], + "responses": { + "200": { + "description": "Matching TherapyGroup records.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "meta", + "service", + "data" + ], + "properties": { + "meta": { + "$ref": "#/components/schemas/Meta", + "examples": [ + { + "data_length": 1, + "message": "Therapy groups retrieved successfully", + "request_url": "https://api.moalmanac.org/therapy_groups", + "status": "success", + "status_code": 200, + "timestamp_elapsed": 0.012345, + "timestamp_received": "2026-10-16T14:03:12.123456Z", + "timestamp_returned": "2026-10-16T14:03:12.135801Z", + "trace_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6" + } + ] + }, + "service": { + "$ref": "#/components/schemas/About", + "description": "Service and database release metadata." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TherapyGroup" + } + } + }, + "additionalProperties": false + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "HTTPValidationError": { + "properties": { + "detail": { + "items": { + "$ref": "#/components/schemas/ValidationError" + }, + "type": "array", + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "ValidationError": { + "properties": { + "loc": { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + }, + "type": "array", + "title": "Location" + }, + "msg": { + "type": "string", + "title": "Message" + }, + "type": { + "type": "string", + "title": "Error Type" + } + }, + "type": "object", + "required": [ + "loc", + "msg", + "type" + ], + "title": "ValidationError" + }, + "Agent": { + "title": "Agent", + "description": "An organization or person that publishes documents or contributes to records.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^agent:(org|user):[a-z0-9]+$", + "examples": [ + "agent:string" + ] + }, + "type": { + "const": "Agent" + }, + "agentType": { + "enum": [ + "organization", + "contributor" + ] + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "last_updated" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "url" + }, + "value": { + "type": "string" + } + } + } + ] + } + } + }, + "required": [ + "id", + "type", + "agentType", + "name", + "description" + ], + "additionalProperties": false, + "examples": [ + { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States.", + "extensions": [ + { + "name": "last_updated", + "value": "2026-06-24", + "description": "" + }, + { + "name": "url", + "value": "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm", + "description": "" + } + ] + } + ] + }, + "Allele": { + "title": "Allele", + "description": "A VRS Allele with its SequenceLocation embedded. The referenced `hgvs.*` keys become `expressions` and the `state_*` keys become `state`.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ga4gh:VA\\.[A-Za-z0-9_-]{32}$", + "examples": [ + "ga4gh:VA.string" + ] + }, + "type": { + "const": "Allele" + }, + "name": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "digest": { + "type": "string" + }, + "expressions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "syntax": { + "enum": [ + "hgvs.g", + "hgvs.c", + "hgvs.p" + ] + }, + "value": { + "type": "string" + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvs.c_short" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvs.p_short" + }, + "value": { + "type": "string" + } + } + } + ] + } + } + }, + "required": [ + "syntax", + "value" + ], + "additionalProperties": false + } + }, + "location": { + "$ref": "#/components/schemas/SequenceLocation" + }, + "state": { + "description": "The allele's state, one of the VRS state types defined in `$defs`, selected by `type`.", + "oneOf": [ + { + "$ref": "#/components/schemas/Allele.LiteralSequenceExpression" + }, + { + "$ref": "#/components/schemas/Allele.ReferenceLengthExpression" + } + ] + } + }, + "required": [ + "id", + "type", + "name", + "aliases", + "description", + "digest", + "expressions", + "location", + "state" + ], + "additionalProperties": false, + "examples": [ + { + "id": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "type": "Allele", + "name": "NP_004324.2:p.Val600Glu", + "aliases": [ + "NP_004324.2:p.V600E", + "BRAF p.V600E" + ], + "description": "VRS variation of NP_004324.2:p.Val600Glu", + "digest": "j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "expressions": [ + { + "syntax": "hgvs.p", + "value": "NP_004324.2:p.Val600Glu", + "extensions": [ + { + "name": "hgvs.p_short", + "value": "p.V600E" + } + ] + } + ], + "location": { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + }, + "state": { + "type": "LiteralSequenceExpression", + "sequence": "E" + } + } + ] + }, + "Allele.LiteralSequenceExpression": { + "description": "A state given as a literal sequence.", + "type": "object", + "properties": { + "type": { + "const": "LiteralSequenceExpression" + }, + "sequence": { + "type": "string" + } + }, + "required": [ + "type", + "sequence" + ], + "additionalProperties": false + }, + "Allele.ReferenceLengthExpression": { + "description": "A state given as a length relative to the reference, e.g. a repeat expansion or deletion.", + "type": "object", + "properties": { + "type": { + "const": "ReferenceLengthExpression" + }, + "sequence": { + "type": "string" + }, + "length": { + "type": "integer", + "minimum": 0 + }, + "repeatSubunitLength": { + "type": "integer", + "minimum": 0 + } + }, + "required": [ + "type", + "sequence", + "length", + "repeatSubunitLength" + ], + "additionalProperties": false + }, + "BiomarkerCriterion": { + "title": "BiomarkerCriterion", + "description": "Interim link between a proposition and a biomarker (a draft Cat-VRS categorical variant criterion), with the biomarker embedded as `subject`.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^bmkr\\.criterion:\\d+$", + "examples": [ + "bmkr.criterion:string" + ] + }, + "present": { + "type": "boolean" + }, + "subject": { + "$ref": "#/components/schemas/Biomarker" + } + }, + "required": [ + "id", + "present", + "subject" + ], + "additionalProperties": false, + "examples": [ + { + "id": "bmkr.criterion:16", + "present": true, + "subject": { + "id": "bmkr:16", + "type": "CategoricalVariant", + "name": "BRAF p.V600E", + "constraints": [ + { + "type": "DefiningAlleleConstraint", + "allele": { + "id": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "type": "Allele", + "name": "NP_004324.2:p.Val600Glu", + "aliases": [ + "NP_004324.2:p.V600E", + "BRAF p.V600E" + ], + "description": "VRS variation of NP_004324.2:p.Val600Glu", + "digest": "j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "expressions": [ + { + "syntax": "hgvs.p", + "value": "NP_004324.2:p.Val600Glu", + "extensions": [ + { + "name": "hgvs.p_short", + "value": "p.V600E" + } + ] + } + ], + "location": { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + }, + "state": { + "type": "LiteralSequenceExpression", + "sequence": "E" + } + }, + "relations": [] + }, + { + "type": "FeatureContextConstraint", + "featureContext": { + "id": "gene:hgnc:1097", + "conceptType": "Gene", + "name": "BRAF", + "primaryCoding": { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + }, + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:ensembl:ensg00000157764", + "code": "ENSG00000157764", + "system": "https://www.ensembl.org", + "iris": [ + "https://www.ensembl.org/id/ENSG00000157764" + ] + } + }, + { + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:refseq:NM_004333.6", + "code": "NM_004333.6", + "system": "https://www.ncbi.nlm.nih.gov/nuccore", + "iris": [ + "https://www.ncbi.nlm.nih.gov/nuccore/NM_004333.6" + ] + } + } + ] + } + } + ], + "extensions": [ + { + "name": "biomarker_type", + "value": "Somatic variant" + }, + { + "name": "chromosome", + "value": "7" + }, + { + "name": "start_position", + "value": 140453136 + }, + { + "name": "end_position", + "value": 140453136 + }, + { + "name": "reference_allele", + "value": "A" + }, + { + "name": "alternate_allele", + "value": "T" + }, + { + "name": "cdna_change", + "value": "c.1799T>A" + }, + { + "name": "protein_change", + "value": "p.V600E" + }, + { + "name": "variant_annotation", + "value": "Missense" + }, + { + "name": "exon", + "value": 15 + }, + { + "name": "rsid", + "value": "rs113488022" + }, + { + "name": "hgvsg", + "value": "7:g.140453136A>T" + }, + { + "name": "hgvsc", + "value": "ENST00000288602.6:c.1799T>A" + } + ] + } + } + ] + }, + "Biomarker": { + "title": "Biomarker", + "description": "A Cat-VRS CategoricalVariant whose allele, location, genes, function, and copy change are shaped into `constraints`. Root type `Biomarker` with one subtype per `biomarker_type` extension value.", + "$ref": "#/components/schemas/Biomarker.Biomarker", + "allOf": [ + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Copy number" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.CopyNumber" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Copy number (arm level)" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.CopyNumberArmLevel" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Gene fusion" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.GeneFusion" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Germline variant" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.GermlineVariant" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Haplotype genotype" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.HaplotypeGenotype" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Homologous recombination" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.HomologousRecombination" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Microsatellite stability" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.MicrosatelliteStability" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Mismatch repair" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.MismatchRepair" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Protein expression" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.ProteinExpression" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Rearrangement" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.Rearrangement" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Translocation" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.Translocation" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Somatic variant" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.SomaticVariant" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Tumor mutational burden" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.TumorMutationalBurden" + } + }, + { + "if": { + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "contains": { + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Wild type" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + }, + "then": { + "$ref": "#/components/schemas/Biomarker.WildType" + } + } + ], + "unevaluatedProperties": false, + "examples": [ + { + "id": "bmkr:16", + "type": "CategoricalVariant", + "name": "BRAF p.V600E", + "constraints": [ + { + "type": "DefiningAlleleConstraint", + "allele": { + "id": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "type": "Allele", + "name": "NP_004324.2:p.Val600Glu", + "aliases": [ + "NP_004324.2:p.V600E", + "BRAF p.V600E" + ], + "description": "VRS variation of NP_004324.2:p.Val600Glu", + "digest": "j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "expressions": [ + { + "syntax": "hgvs.p", + "value": "NP_004324.2:p.Val600Glu", + "extensions": [ + { + "name": "hgvs.p_short", + "value": "p.V600E" + } + ] + } + ], + "location": { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + }, + "state": { + "type": "LiteralSequenceExpression", + "sequence": "E" + } + }, + "relations": [] + }, + { + "type": "FeatureContextConstraint", + "featureContext": { + "id": "gene:hgnc:1097", + "conceptType": "Gene", + "name": "BRAF", + "primaryCoding": { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + }, + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:ensembl:ensg00000157764", + "code": "ENSG00000157764", + "system": "https://www.ensembl.org", + "iris": [ + "https://www.ensembl.org/id/ENSG00000157764" + ] + } + }, + { + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:refseq:NM_004333.6", + "code": "NM_004333.6", + "system": "https://www.ncbi.nlm.nih.gov/nuccore", + "iris": [ + "https://www.ncbi.nlm.nih.gov/nuccore/NM_004333.6" + ] + } + } + ] + } + } + ], + "extensions": [ + { + "name": "biomarker_type", + "value": "Somatic variant" + }, + { + "name": "chromosome", + "value": "7" + }, + { + "name": "start_position", + "value": 140453136 + }, + { + "name": "end_position", + "value": 140453136 + }, + { + "name": "reference_allele", + "value": "A" + }, + { + "name": "alternate_allele", + "value": "T" + }, + { + "name": "cdna_change", + "value": "c.1799T>A" + }, + { + "name": "protein_change", + "value": "p.V600E" + }, + { + "name": "variant_annotation", + "value": "Missense" + }, + { + "name": "exon", + "value": 15 + }, + { + "name": "rsid", + "value": "rs113488022" + }, + { + "name": "hgvsg", + "value": "7:g.140453136A>T" + }, + { + "name": "hgvsc", + "value": "ENST00000288602.6:c.1799T>A" + } + ] + } + ] + }, + "Biomarker.Biomarker": { + "description": "Root type shared by every biomarker. Subtypes below are selected by the `biomarker_type` extension; the top-level schema closes the record.", + "type": "object", + "required": [ + "id", + "type", + "name", + "constraints", + "extensions" + ], + "properties": { + "id": { + "type": "string", + "pattern": "^bmkr:\\d+$", + "examples": [ + "bmkr:string" + ] + }, + "type": { + "const": "CategoricalVariant" + }, + "name": { + "type": "string" + }, + "constraints": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/Biomarker.DefiningAlleleConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.AdjacencyConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.FunctionConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.CopyChangeConstraint" + } + ] + } + }, + "extensions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Extension" + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "enum": [ + "Copy number", + "Copy number (arm level)", + "Gene fusion", + "Germline variant", + "Haplotype genotype", + "Homologous recombination", + "Microsatellite stability", + "Mismatch repair", + "Protein expression", + "Rearrangement", + "Somatic variant", + "Translocation", + "Tumor mutational burden", + "Wild type" + ] + } + } + } + } + ] + } + } + }, + "Biomarker.DefiningAlleleConstraint": { + "type": "object", + "properties": { + "type": { + "const": "DefiningAlleleConstraint" + }, + "allele": { + "$ref": "#/components/schemas/Allele" + }, + "relations": { + "type": "array", + "items": {} + } + }, + "required": [ + "type", + "allele", + "relations" + ], + "additionalProperties": false + }, + "Biomarker.DefiningLocationConstraint": { + "type": "object", + "properties": { + "type": { + "const": "DefiningLocationConstraint" + }, + "location": { + "$ref": "#/components/schemas/SequenceLocation" + }, + "relations": { + "type": "array", + "items": {} + }, + "matchCharacteristic": { + "type": "object", + "properties": { + "primaryCoding": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "system": { + "type": "string" + } + }, + "required": [ + "code", + "system" + ], + "additionalProperties": false + } + }, + "required": [ + "primaryCoding" + ], + "additionalProperties": false + } + }, + "required": [ + "type", + "location", + "relations", + "matchCharacteristic" + ], + "additionalProperties": false + }, + "Biomarker.FeatureContextConstraint": { + "type": "object", + "properties": { + "type": { + "const": "FeatureContextConstraint" + }, + "featureContext": { + "$ref": "#/components/schemas/Gene.Gene", + "not": { + "required": [ + "extensions" + ] + } + } + }, + "required": [ + "type", + "featureContext" + ], + "additionalProperties": false + }, + "Biomarker.AdjacencyConstraint": { + "type": "object", + "properties": { + "type": { + "const": "AdjacencyConstraint" + }, + "orderKnown": { + "type": "boolean", + "description": "True only when both partners are known." + }, + "adjoinedElements": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Gene.Gene", + "not": { + "required": [ + "extensions" + ] + } + }, + { + "$ref": "#/components/schemas/Biomarker.UnspecifiedElement" + } + ] + }, + "minItems": 2, + "maxItems": 2 + } + }, + "required": [ + "type", + "orderKnown", + "adjoinedElements" + ], + "additionalProperties": false + }, + "Biomarker.FunctionConstraint": { + "type": "object", + "properties": { + "type": { + "const": "FunctionConstraint" + }, + "functionConsequence": { + "$ref": "#/components/schemas/FunctionConsequence" + } + }, + "required": [ + "type", + "functionConsequence" + ], + "additionalProperties": false + }, + "Biomarker.CopyChangeConstraint": { + "type": "object", + "properties": { + "type": { + "const": "CopyChangeConstraint" + }, + "copyChange": { + "type": "string" + } + }, + "required": [ + "type", + "copyChange" + ], + "additionalProperties": false + }, + "Biomarker.UnspecifiedElement": { + "type": "object", + "properties": { + "type": { + "const": "UnspecifiedElement" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "Biomarker.CopyNumber": { + "description": "Gene-level copy number change: a gene and a copy change.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Copy number" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cytoband" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Copy number" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cytoband" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.CopyChangeConstraint" + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + "minContains": 1, + "maxContains": 1 + }, + { + "contains": { + "$ref": "#/components/schemas/Biomarker.CopyChangeConstraint" + }, + "minContains": 1, + "maxContains": 1 + } + ] + } + } + } + ] + }, + "Biomarker.CopyNumberArmLevel": { + "description": "Arm-level copy number change: a location and a copy change.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Copy number (arm level)" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "chromosome" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "arm" + }, + "value": { + "enum": [ + "p", + "q" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Copy number (arm level)" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "chromosome" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "arm" + }, + "value": { + "enum": [ + "p", + "q" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.CopyChangeConstraint" + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + "minContains": 1, + "maxContains": 1 + }, + { + "contains": { + "$ref": "#/components/schemas/Biomarker.CopyChangeConstraint" + }, + "minContains": 1, + "maxContains": 1 + } + ] + } + } + } + ] + }, + "Biomarker.GeneFusion": { + "description": "Gene fusion, represented by a single AdjacencyConstraint. A fusion with one known partner has an UnspecifiedElement for the other.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Gene fusion" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Gene fusion" + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "$ref": "#/components/schemas/Biomarker.AdjacencyConstraint" + } + } + } + } + ] + }, + "Biomarker.GermlineVariant": { + "description": "Germline variant: a location and a FeatureContextConstraint.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Germline variant" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "chromosome" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "start_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "end_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reference_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "alternate_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cdna_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "variant_annotation" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "exon" + }, + "value": { + "type": [ + "integer", + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "rsid" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsg" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsc" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "requires_pathogenic" + }, + "value": { + "type": "boolean" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Germline variant" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "chromosome" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "start_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "end_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reference_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "alternate_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cdna_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "variant_annotation" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "exon" + }, + "value": { + "type": [ + "integer", + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "rsid" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsg" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsc" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "requires_pathogenic" + }, + "value": { + "type": "boolean" + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + "minContains": 1, + "maxContains": 1 + }, + { + "contains": { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + "minContains": 1, + "maxContains": 1 + } + ] + } + } + } + ] + }, + "Biomarker.HaplotypeGenotype": { + "description": "Haplotype genotype. No constraints.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Haplotype genotype" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Haplotype genotype" + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "maxItems": 0 + } + } + } + ] + }, + "Biomarker.HomologousRecombination": { + "description": "Homologous recombination status. No constraints.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Homologous recombination" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "type": "string" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Homologous recombination" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "type": "string" + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "maxItems": 0 + } + } + } + ] + }, + "Biomarker.MicrosatelliteStability": { + "description": "Microsatellite instability status. No constraints.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Microsatellite stability" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Microsatellite instability-high (MSI-H)", + "Microsatellite instability-low (MSI-L)", + "Microsatellite stable (MSS)" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Microsatellite stability" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Microsatellite instability-high (MSI-H)", + "Microsatellite instability-low (MSI-L)", + "Microsatellite stable (MSS)" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "maxItems": 0 + } + } + } + ] + }, + "Biomarker.MismatchRepair": { + "description": "Mismatch repair status. No constraints.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Mismatch repair" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Deficient", + "Proficient" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Mismatch repair" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Deficient", + "Proficient" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "maxItems": 0 + } + } + } + ] + }, + "Biomarker.NonFusionRearrangement": { + "description": "Structural shape shared by `Rearrangement` and `Translocation`: a gene fusion's genes collapse into a single AdjacencyConstraint, while these use one FeatureContextConstraint per gene instead. A `Translocation` may also carry a `DefiningLocationConstraint` per chromosome when it's named by cytogenetic band rather than gene (`Rearrangement`'s `location` is always empty, so it can never actually produce one).", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "constraints": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + } + ] + } + } + } + } + ] + }, + "Biomarker.ProteinExpression": { + "description": "Protein expression, e.g. PD-L1 TPS >= 1%. No constraints.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Protein expression" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "marker" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "unit" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "equality" + }, + "value": { + "enum": [ + "=", + ">=", + "<=", + "<", + ">" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "value" + }, + "value": { + "type": [ + "number", + "string" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Protein expression" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "marker" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "unit" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "equality" + }, + "value": { + "enum": [ + "=", + ">=", + "<=", + "<", + ">" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "value" + }, + "value": { + "type": [ + "number", + "string" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "maxItems": 0 + } + } + } + ] + }, + "Biomarker.Rearrangement": { + "description": "Chromosomal rearrangement that is neither a gene fusion nor a translocation (see `Gene fusion`, `Translocation`). Shares `NonFusionRearrangement`'s shape.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.NonFusionRearrangement" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Rearrangement" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Rearrangement" + } + } + } + } + ] + } + } + } + ] + }, + "Biomarker.Translocation": { + "description": "Chromosomal translocation between one or two partner genes, or between one or two chromosomes. Shares `NonFusionRearrangement`'s shape, but also allows a `DefiningLocationConstraint` per chromosome when the translocation is named by cytogenetic band rather than gene.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.NonFusionRearrangement" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Translocation" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Translocation" + } + } + } + } + ] + } + } + } + ] + }, + "Biomarker.SomaticVariant": { + "description": "Somatic variant: a FeatureContextConstraint, plus an allele or location and optionally a function.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Somatic variant" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "chromosome" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "start_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "end_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reference_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "alternate_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cdna_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "variant_annotation" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "exon" + }, + "value": { + "type": [ + "integer", + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsg" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsc" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "rsid" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "requires_oncogenic" + }, + "value": { + "type": "boolean" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Somatic variant" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "chromosome" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "start_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "end_position" + }, + "value": { + "type": [ + "integer", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reference_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "alternate_allele" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cdna_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_change" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "variant_annotation" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "exon" + }, + "value": { + "type": [ + "integer", + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsg" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "hgvsc" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Biomarker.DefiningAlleleConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.FunctionConstraint" + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + "minContains": 1, + "maxContains": 1 + } + ] + } + } + } + ] + }, + "Biomarker.TumorMutationalBurden": { + "description": "Tumor mutational burden classification. No constraints.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Tumor mutational burden" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "classification" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "minimum_mutations" + }, + "value": { + "type": [ + "number", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "minimum_mutations_per_megabase" + }, + "value": { + "type": [ + "number", + "null" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Tumor mutational burden" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "classification" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "minimum_mutations" + }, + "value": { + "type": [ + "number", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "minimum_mutations_per_megabase" + }, + "value": { + "type": [ + "number", + "null" + ] + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "maxItems": 0 + } + } + } + ] + }, + "Biomarker.WildType": { + "description": "Absence of variants in a gene: a location and a gene.", + "allOf": [ + { + "$ref": "#/components/schemas/Biomarker.Biomarker" + }, + { + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Wild type" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarker_type" + }, + "value": { + "const": "Wild type" + } + } + } + } + ] + }, + "constraints": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Biomarker.DefiningLocationConstraint" + }, + "minContains": 1, + "maxContains": 1 + }, + { + "contains": { + "$ref": "#/components/schemas/Biomarker.FeatureContextConstraint" + }, + "minContains": 1, + "maxContains": 1 + } + ] + } + } + } + ] + }, + "Coding": { + "title": "Coding", + "description": "A code within a coding system, e.g. `oncotree:BRCA` or `ncit:C97660`.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^coding:[a-z]+:.+$", + "examples": [ + "coding:string" + ] + }, + "code": { + "type": "string" + }, + "name": { + "type": "string" + }, + "system": { + "type": "string" + }, + "systemVersion": { + "type": "string" + }, + "iris": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + } + }, + "required": [ + "id", + "code", + "system", + "iris" + ], + "additionalProperties": false, + "examples": [ + { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + } + ] + }, + "Contribution": { + "title": "Contribution", + "description": "A dated contribution by an agent, with the agent embedded as `contributor`.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ctrb:[a-z]+:\\d{4}-\\d{2}-\\d{2}:\\d+$", + "examples": [ + "ctrb:string" + ] + }, + "type": { + "const": "Contribution" + }, + "description": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$" + }, + "contributor": { + "$ref": "#/components/schemas/Agent", + "not": { + "required": [ + "extensions" + ] + } + } + }, + "required": [ + "id", + "type", + "description", + "date", + "contributor" + ], + "additionalProperties": false, + "examples": [ + { + "id": "ctrb:fda:2013-05-29:0", + "type": "Contribution", + "description": "Indication received traditional approval.", + "date": "2013-05-29", + "contributor": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + } + } + ] + }, + "CopyChange": { + "title": "CopyChange", + "description": "A copy change term, e.g. gain or loss.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^copy_change:efo:\\d+$", + "examples": [ + "copy_change:efo:string" + ] + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ], + "additionalProperties": false, + "examples": [ + { + "id": "copy_change:efo:0030067", + "name": "loss" + } + ] + }, + "Disease": { + "title": "Disease", + "description": "A cancer type concept with its primary coding and mappings embedded.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^dis:(oncotree|ncit):.+$", + "examples": [ + "dis:string" + ] + }, + "conceptType": { + "const": "Disease" + }, + "name": { + "type": "string" + }, + "primaryCoding": { + "$ref": "#/components/schemas/Coding" + }, + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mapping.ConceptMapping" + } + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "solid_tumor" + }, + "value": { + "type": "boolean" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "solid_tumor" + }, + "value": { + "type": "boolean" + } + } + } + } + ] + } + }, + "required": [ + "id", + "conceptType", + "name", + "primaryCoding", + "mappings", + "extensions" + ], + "additionalProperties": false, + "examples": [ + { + "id": "dis:ncit:C3224", + "conceptType": "Disease", + "name": "Melanoma", + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:oncotree:MEL", + "code": "MEL", + "name": "Melanoma", + "system": "https://oncotree.mskcc.org", + "systemVersion": "oncotree_2025_10_03", + "iris": [ + "https://oncotree.mskcc.org/?version=oncotree_2025_10_03&field=NAME&search=Melanoma+%28MEL%29" + ] + } + } + ], + "extensions": [ + { + "name": "solid_tumor", + "value": true, + "description": "Boolean value for if this tumor type is categorized as a solid tumor." + } + ], + "primaryCoding": { + "id": "coding:ncit:C3224", + "code": "C3224", + "name": "Melanoma", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C3224" + ] + } + } + ] + }, + "Document": { + "title": "Document", + "description": "A source document. Publisher, company, drug names, dates, and status are extensions; urls are plain strings.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^doc:(fda|ema|hse|hc|hpra):.+$", + "examples": [ + "doc:string" + ] + }, + "type": { + "const": "Document" + }, + "documentType": { + "enum": [ + "Regulatory approval" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": [ + "string", + "null" + ] + }, + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "urls": { + "type": "array", + "items": { + "type": "string", + "format": "uri" + } + }, + "doi": { + "type": [ + "string", + "null" + ] + }, + "pmid": { + "type": [ + "string", + "null" + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "agent" + }, + "value": { + "$ref": "#/components/schemas/Agent", + "not": { + "required": [ + "extensions" + ] + } + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "company" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "drug_name_brand" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "drug_name_generic" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "first_publication_date" + }, + "value": { + "$ref": "#/components/schemas/Document.IsoDateOrNull" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "publication_date" + }, + "value": { + "$ref": "#/components/schemas/Document.IsoDateOrNull" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "regulatory_identifier" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Active", + "Deprecated" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "agent" + }, + "value": { + "$ref": "#/components/schemas/Agent", + "not": { + "required": [ + "extensions" + ] + } + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "company" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "drug_name_brand" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "drug_name_generic" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "first_publication_date" + }, + "value": { + "$ref": "#/components/schemas/Document.IsoDateOrNull" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "publication_date" + }, + "value": { + "$ref": "#/components/schemas/Document.IsoDateOrNull" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "regulatory_identifier" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Active", + "Deprecated" + ] + } + } + } + } + ] + } + }, + "required": [ + "id", + "type", + "documentType", + "name", + "title", + "aliases", + "description", + "urls", + "doi", + "pmid", + "extensions" + ], + "additionalProperties": false, + "allOf": [ + { + "if": { + "required": [ + "id" + ], + "properties": { + "id": { + "pattern": "^doc:fda:", + "examples": [ + "doc:fda:string" + ] + } + } + }, + "then": { + "properties": { + "extensions": { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "regulatory_identifier" + }, + "value": { + "type": "string", + "pattern": "^(BLA|NDA)[0-9]{6}$" + } + } + } + } + } + } + } + ], + "examples": [ + { + "id": "doc:fda:tafinlar", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf. Revised March 2024. Accessed October 30, 2024.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2024-03-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Active", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + } + ] + }, + "Document.IsoDateOrNull": { + "description": "An ISO 8601 date (YYYY-MM-DD) or null.", + "oneOf": [ + { + "type": "null" + }, + { + "type": "string", + "format": "date" + } + ] + }, + "Extension": { + "title": "Extension", + "description": "A GKS Core extension: a name/value pair for information the underlying specification does not directly support. `value` may be any JSON type.", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "value": {}, + "description": { + "type": "string" + } + }, + "required": [ + "name", + "value" + ], + "additionalProperties": false + }, + "FunctionConsequence": { + "title": "FunctionConsequence", + "description": "The functional consequence of a variant, with its primary coding embedded.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^func:so:\\d+$", + "examples": [ + "func:so:string" + ] + }, + "name": { + "type": "string" + }, + "primaryCoding": { + "$ref": "#/components/schemas/Coding" + } + }, + "required": [ + "id", + "name", + "primaryCoding" + ], + "additionalProperties": false, + "examples": [ + { + "id": "func:so:0001786", + "name": "Loss of heterozygosity", + "primaryCoding": { + "id": "coding:so:0001786", + "name": "loss_of_heterozygosity", + "system": "https://www.ebi.ac.uk/ols4/ontologies/so", + "code": "SO:0001786", + "iris": [ + "https://www.ebi.ac.uk/ols4/ontologies/so/classes/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FSO_0001786" + ] + } + } + ] + }, + "Gene": { + "title": "Gene", + "description": "A gene concept. Standalone genes carry the gene's sequence locations in `extensions`; genes embedded in a biomarker have `extensions` stripped (`$defs/Gene` without `extensions`).", + "$ref": "#/components/schemas/Gene.Gene", + "required": [ + "extensions" + ], + "properties": { + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cds_start" + }, + "value": { + "type": "integer", + "minimum": 0 + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "location" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "location_sortable" + }, + "value": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_product" + }, + "value": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_product_exons" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "transcript" + }, + "value": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "transcript_exons" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "cds_start" + }, + "value": { + "type": "integer", + "minimum": 0 + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "location" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "location_sortable" + }, + "value": { + "type": "string" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_product" + }, + "value": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "protein_product_exons" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "transcript" + }, + "value": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "transcript_exons" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SequenceLocation" + } + } + } + } + } + ] + } + }, + "examples": [ + { + "id": "gene:hgnc:1097", + "conceptType": "Gene", + "name": "BRAF", + "primaryCoding": { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + }, + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:ensembl:ensg00000157764", + "code": "ENSG00000157764", + "system": "https://www.ensembl.org", + "iris": [ + "https://www.ensembl.org/id/ENSG00000157764" + ] + } + }, + { + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:refseq:NM_004333.6", + "code": "NM_004333.6", + "system": "https://www.ncbi.nlm.nih.gov/nuccore", + "iris": [ + "https://www.ncbi.nlm.nih.gov/nuccore/NM_004333.6" + ] + } + } + ], + "extensions": [ + { + "name": "cds_start", + "value": 226 + }, + { + "name": "location", + "value": "7q34" + }, + { + "name": "location_sortable", + "value": "07q34" + }, + { + "name": "protein_product", + "value": { + "id": "ga4gh:SL.GyZjLKMYAGTYzPBu6QnOWQ7yPzCmiDHX", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence spanning the length of refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "GyZjLKMYAGTYzPBu6QnOWQ7yPzCmiDHX", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 0, + "end": 766, + "sequence": null + } + }, + { + "name": "protein_product_exons", + "value": [ + { + "id": "ga4gh:SL.hOL8WaahYSFFYZueqxoOoxbJ7pIuQvTn", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 1.", + "digest": "hOL8WaahYSFFYZueqxoOoxbJ7pIuQvTn", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 0, + "end": 46, + "sequence": null + }, + { + "id": "ga4gh:SL.7_goR_Oultxkg0mXCkwlXmINl-XQDhHE", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 2.", + "digest": "7_goR_Oultxkg0mXCkwlXmINl-XQDhHE", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 46, + "end": 80, + "sequence": null + }, + { + "id": "ga4gh:SL.CS1pe7zSaG1e50vpe4vWc7AKIk1fxr87", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 3.", + "digest": "CS1pe7zSaG1e50vpe4vWc7AKIk1fxr87", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 80, + "end": 168, + "sequence": null + }, + { + "id": "ga4gh:SL.5yUJi9Qo1iL2QHp6uZNCFwOhBUtRQ40e", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 4. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "5yUJi9Qo1iL2QHp6uZNCFwOhBUtRQ40e", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 168, + "end": 203, + "sequence": null + }, + { + "id": "ga4gh:SL.O6UpevcZQs-ROXsfAljQ9qPlYxtxSqeh", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 5. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "O6UpevcZQs-ROXsfAljQ9qPlYxtxSqeh", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 202, + "end": 237, + "sequence": null + }, + { + "id": "ga4gh:SL.UOm9kpL4EqQfjENxbvQFISS0N6xQLJD7", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 6. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "UOm9kpL4EqQfjENxbvQFISS0N6xQLJD7", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 237, + "end": 287, + "sequence": null + }, + { + "id": "ga4gh:SL.O5aoKYgGQeQxty8mMZ2v0FDapGZdKc-D", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 7. This exon's protein location shares a codon boundary with the adjacent exons on both sides.", + "digest": "O5aoKYgGQeQxty8mMZ2v0FDapGZdKc-D", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 286, + "end": 327, + "sequence": null + }, + { + "id": "ga4gh:SL.fFssoKwZLVckbEC8fUrPMNCtBPnNMXgJ", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 8. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "fFssoKwZLVckbEC8fUrPMNCtBPnNMXgJ", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 326, + "end": 380, + "sequence": null + }, + { + "id": "ga4gh:SL.U__fUwoAIJcsdY5hmAmavUUuO4CC8pk0", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 9. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "U__fUwoAIJcsdY5hmAmavUUuO4CC8pk0", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 380, + "end": 393, + "sequence": null + }, + { + "id": "ga4gh:SL.-K392L7HXLsNWM4ufXNfgoG7GIfQVarD", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 10. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "-K392L7HXLsNWM4ufXNfgoG7GIfQVarD", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 392, + "end": 438, + "sequence": null + }, + { + "id": "ga4gh:SL.eCxrSQh4fL3MKPnUBLUv9KNfO98RKuMV", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 11. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "eCxrSQh4fL3MKPnUBLUv9KNfO98RKuMV", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 438, + "end": 478, + "sequence": null + }, + { + "id": "ga4gh:SL.w3Z4K3BnaFT6T91kNNpUh7RCoSoMahn1", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 12. This exon's protein location shares a codon boundary with the adjacent exons on both sides.", + "digest": "w3Z4K3BnaFT6T91kNNpUh7RCoSoMahn1", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 477, + "end": 506, + "sequence": null + }, + { + "id": "ga4gh:SL.2qOEw44VleMXnVH-BgtC2CQ7qyw3Xsae", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 13. This exon's protein location shares a codon boundary with the adjacent exons on both sides.", + "digest": "2qOEw44VleMXnVH-BgtC2CQ7qyw3Xsae", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 505, + "end": 565, + "sequence": null + }, + { + "id": "ga4gh:SL.bdvKTqoNhYd6NS8rYw73wKhrJQly7I1Y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 14. This exon's protein location shares a codon boundary with the adjacent exons on both sides.", + "digest": "bdvKTqoNhYd6NS8rYw73wKhrJQly7I1Y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 564, + "end": 581, + "sequence": null + }, + { + "id": "ga4gh:SL.6XQV2D1tqwsE1vZHUy9aYIs6hI5nH94s", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 15. This exon's protein location may share a codon boundary with the adjacent exon's protein location.", + "digest": "6XQV2D1tqwsE1vZHUy9aYIs6hI5nH94s", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 580, + "end": 620, + "sequence": null + }, + { + "id": "ga4gh:SL.UPsLeAWsaAKh-Fp0flSsgG8179uub4hZ", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 16.", + "digest": "UPsLeAWsaAKh-Fp0flSsgG8179uub4hZ", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 620, + "end": 664, + "sequence": null + }, + { + "id": "ga4gh:SL.nc355SUTUMrJVgug-WSzOJctq4MoNNYB", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 17.", + "digest": "nc355SUTUMrJVgug-WSzOJctq4MoNNYB", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 664, + "end": 709, + "sequence": null + }, + { + "id": "ga4gh:SL.AIk_69IB5TFjrSrtgzSg6lMfyxYRLmGJ", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NP_004324.2, the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to Exon 18.", + "digest": "AIk_69IB5TFjrSrtgzSg6lMfyxYRLmGJ", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 709, + "end": 766, + "sequence": null + } + ] + }, + { + "name": "transcript", + "value": { + "id": "ga4gh:SL.5DaQm7UICclYaDk1ZwJXVyZgRCqIjWOC", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence spanning the length of refseq:NM_004333.6, the MANE Select coding transcript for BRAF.", + "digest": "5DaQm7UICclYaDk1ZwJXVyZgRCqIjWOC", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 0, + "end": 6459, + "sequence": null + } + }, + { + "name": "transcript_exons", + "value": [ + { + "id": "ga4gh:SL.NkKLnr1SEzKfAAiRnemhTlozP0rfW3Gs", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 1.", + "digest": "NkKLnr1SEzKfAAiRnemhTlozP0rfW3Gs", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 0, + "end": 364, + "sequence": null + }, + { + "id": "ga4gh:SL.vD8ErVLM_zSuQvjszFVy62_a0bw1S4er", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 2.", + "digest": "vD8ErVLM_zSuQvjszFVy62_a0bw1S4er", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 364, + "end": 466, + "sequence": null + }, + { + "id": "ga4gh:SL.5KxB3y0QHdBzi3tzRNkfvT8uLRTt9ts5", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 3.", + "digest": "5KxB3y0QHdBzi3tzRNkfvT8uLRTt9ts5", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 466, + "end": 730, + "sequence": null + }, + { + "id": "ga4gh:SL.p4Y8oVln7WJ0UYUe5pxvoQWVSHWpJDf8", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 4.", + "digest": "p4Y8oVln7WJ0UYUe5pxvoQWVSHWpJDf8", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 730, + "end": 834, + "sequence": null + }, + { + "id": "ga4gh:SL.vpskSU0K3SFOs3EZIieH-fWURMwKZhQz", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 5.", + "digest": "vpskSU0K3SFOs3EZIieH-fWURMwKZhQz", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 834, + "end": 937, + "sequence": null + }, + { + "id": "ga4gh:SL.9sCT0A0ANw9rx2A08OtiVwMNH1NRN9sW", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 6.", + "digest": "9sCT0A0ANw9rx2A08OtiVwMNH1NRN9sW", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 937, + "end": 1086, + "sequence": null + }, + { + "id": "ga4gh:SL.yAvyZYBfIIMMqyeEIIaUgglnGKgcLeJZ", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 7.", + "digest": "yAvyZYBfIIMMqyeEIIaUgglnGKgcLeJZ", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1086, + "end": 1206, + "sequence": null + }, + { + "id": "ga4gh:SL.NYhcSsAWc-JY-Vn53DWm8Tu48WXXq-hW", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 8.", + "digest": "NYhcSsAWc-JY-Vn53DWm8Tu48WXXq-hW", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1206, + "end": 1366, + "sequence": null + }, + { + "id": "ga4gh:SL.6EBIS7HvFmpxVgkTRoLdMjvVF8EWUAGC", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 9.", + "digest": "6EBIS7HvFmpxVgkTRoLdMjvVF8EWUAGC", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1366, + "end": 1403, + "sequence": null + }, + { + "id": "ga4gh:SL.UTwkUqGHMu0dYAIgLM7F5pdC-sY6aUQA", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 10.", + "digest": "UTwkUqGHMu0dYAIgLM7F5pdC-sY6aUQA", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1403, + "end": 1540, + "sequence": null + }, + { + "id": "ga4gh:SL.jLKvZLq-ngqr4x7brIW6vLXDS_3fd5Ob", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 11.", + "digest": "jLKvZLq-ngqr4x7brIW6vLXDS_3fd5Ob", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1540, + "end": 1658, + "sequence": null + }, + { + "id": "ga4gh:SL.u46iGdWJkKaGiKk7hOYPjitzfrMaqF0-", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 12.", + "digest": "u46iGdWJkKaGiKk7hOYPjitzfrMaqF0-", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1658, + "end": 1743, + "sequence": null + }, + { + "id": "ga4gh:SL.9dXtdcHkRExYIMZyxIAseZiCw5hLlpEs", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 13.", + "digest": "9dXtdcHkRExYIMZyxIAseZiCw5hLlpEs", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1743, + "end": 1920, + "sequence": null + }, + { + "id": "ga4gh:SL.R20uLka3zT6NvHaHQwfzrHZydZh6yGYc", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 14.", + "digest": "R20uLka3zT6NvHaHQwfzrHZydZh6yGYc", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1920, + "end": 1967, + "sequence": null + }, + { + "id": "ga4gh:SL.X2boAR9YrGSdN5P63-H1RozJVZ-dVXYN", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 15.", + "digest": "X2boAR9YrGSdN5P63-H1RozJVZ-dVXYN", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 1967, + "end": 2086, + "sequence": null + }, + { + "id": "ga4gh:SL.qSUaujsu7DQyZWQpQaDpOEZI54aXGj3x", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 16.", + "digest": "qSUaujsu7DQyZWQpQaDpOEZI54aXGj3x", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 2086, + "end": 2218, + "sequence": null + }, + { + "id": "ga4gh:SL.vHos-yjEx-SGyjV4IXbx10u3e4udZEXD", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 17.", + "digest": "vHos-yjEx-SGyjV4IXbx10u3e4udZEXD", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 2218, + "end": 2353, + "sequence": null + }, + { + "id": "ga4gh:SL.hLqg47i3Eb9SJSGmzv-iimV0l_Wwbukv", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Sequence within refseq:NM_004333.6, the MANE Select coding transcript for BRAF, corresponding to Exon 18.", + "digest": "hLqg47i3Eb9SJSGmzv-iimV0l_Wwbukv", + "sequenceReference": { + "id": "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "type": "SequenceReference", + "name": "NM_004333.6", + "aliases": [ + "ga4gh:SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "refseq:NM_004333.6" + ], + "description": "The MANE Select coding transcript for BRAF, corresponding to the Refseq transcript accession NM_004333.6.", + "moleculeType": "mRNA", + "refgetAccession": "SQ.aKMPEJgmlZXt_F6gRY5cUG3THH2n-GUa", + "residueAlphabet": "na" + }, + "start": 2353, + "end": 6459, + "sequence": null + } + ] + } + ] + } + ] + }, + "Gene.Gene": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^gene:hgnc:\\d+$", + "examples": [ + "gene:hgnc:string" + ] + }, + "conceptType": { + "const": "Gene" + }, + "name": { + "type": "string" + }, + "primaryCoding": { + "$ref": "#/components/schemas/Coding" + }, + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mapping.ConceptMapping" + } + }, + "extensions": { + "type": "array" + } + }, + "required": [ + "id", + "conceptType", + "name", + "primaryCoding", + "mappings" + ], + "additionalProperties": false + }, + "Indication": { + "title": "Indication", + "description": "Regulatory approval text and its source, with contributions and documents embedded. Root type `Indication` with one subtype per organization, selected by the id prefix `ind:{org}:`. `status` is an extension; HSE indications additionally carry `reimbursement_scheme` and `reimbursement_comment` extensions.", + "$ref": "#/components/schemas/Indication.Indication", + "allOf": [ + { + "if": { + "required": [ + "id" + ], + "properties": { + "id": { + "pattern": "^ind:fda:", + "examples": [ + "ind:fda:string" + ] + } + } + }, + "then": { + "$ref": "#/components/schemas/Indication.FDAIndication" + } + }, + { + "if": { + "required": [ + "id" + ], + "properties": { + "id": { + "pattern": "^ind:ema:", + "examples": [ + "ind:ema:string" + ] + } + } + }, + "then": { + "$ref": "#/components/schemas/Indication.EMAIndication" + } + }, + { + "if": { + "required": [ + "id" + ], + "properties": { + "id": { + "pattern": "^ind:hc:", + "examples": [ + "ind:hc:string" + ] + } + } + }, + "then": { + "$ref": "#/components/schemas/Indication.HCIndication" + } + }, + { + "if": { + "required": [ + "id" + ], + "properties": { + "id": { + "pattern": "^ind:hpra:", + "examples": [ + "ind:hpra:string" + ] + } + } + }, + "then": { + "$ref": "#/components/schemas/Indication.HPRAIndication" + } + }, + { + "if": { + "required": [ + "id" + ], + "properties": { + "id": { + "pattern": "^ind:hse:", + "examples": [ + "ind:hse:string" + ] + } + } + }, + "then": { + "$ref": "#/components/schemas/Indication.HSEIndication" + } + } + ], + "unevaluatedProperties": false, + "examples": [ + { + "id": "ind:fda:tafinlar:0", + "type": "Indication", + "description": "TAFINLAR is a kinase inhibitor indicated as a single agent for the treatment of patients with unresectable or metastatic melanoma with BRAF V600E mutation as detected by an FDA-approved test.", + "contributions": [ + { + "id": "ctrb:vanallenlab:2024-10-30:0", + "type": "Contribution", + "description": "Initial access of FDA approvals", + "date": "2024-10-30", + "contributor": { + "id": "agent:user:vanallenlab", + "type": "Agent", + "agentType": "contributor", + "name": "Van Allen lab", + "description": "Van Allen lab, Dana-Farber Cancer Institute" + } + }, + { + "id": "ctrb:fda:2013-05-29:0", + "type": "Contribution", + "description": "Indication received traditional approval.", + "date": "2013-05-29", + "contributor": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + } + } + ], + "reportedIn": [ + { + "id": "doc:fda:tafinlar", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf. Revised March 2024. Accessed October 30, 2024.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2024-03-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Active", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + }, + { + "id": "doc:fda:tafinlar:2013-05-29", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2013/202806s000lbl.pdf. Revised May 2013. Accessed October 6, 2026.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2013/202806s000lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2013-05-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Deprecated", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + } + ], + "extensions": [ + { + "name": "status", + "value": "Approved", + "description": "Current approval status." + } + ] + } + ] + }, + "Indication.Indication": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ind:(fda|ema|hse|hc|hpra):.+$", + "examples": [ + "ind:string" + ] + }, + "type": { + "const": "Indication" + }, + "description": { + "type": "string", + "description": "Regulatory approval text, verbatim." + }, + "contributions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contribution" + } + }, + "reportedIn": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "extensions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Extension" + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + } + ] + } + }, + "required": [ + "id", + "type", + "description", + "contributions", + "reportedIn", + "extensions" + ], + "description": "Root type shared by every organization. Organization-specific types below extend it; the top-level schema closes the record with unevaluatedProperties." + }, + "Indication.FDAIndication": { + "description": "Indication from the organization `fda`. `reportedIn` lists the evergreen FDA document (`doc:fda:{drug}`) first, followed by the dated, Deprecated FDA document (`doc:fda:{drug}:{YYYY-MM-DD}`) for the label in which the indication was initially approved.", + "allOf": [ + { + "$ref": "#/components/schemas/Indication.Indication" + }, + { + "properties": { + "id": { + "pattern": "^ind:fda:", + "examples": [ + "ind:fda:string" + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + } + ] + }, + "reportedIn": { + "type": "array", + "minItems": 2, + "maxItems": 2, + "prefixItems": [ + { + "$ref": "#/components/schemas/Document", + "properties": { + "id": { + "pattern": "^doc:fda:[^:]+$", + "examples": [ + "doc:fda:string" + ] + } + } + }, + { + "$ref": "#/components/schemas/Document", + "properties": { + "id": { + "pattern": "^doc:fda:[^:]+:\\d{4}-\\d{2}-\\d{2}$", + "examples": [ + "doc:fda:string" + ] + }, + "extensions": { + "contains": { + "type": "object", + "properties": { + "name": { + "const": "status" + }, + "value": { + "const": "Deprecated" + } + }, + "required": [ + "name", + "value" + ] + } + } + } + } + ], + "description": "The evergreen document, then the dated document for the initial approval." + } + } + } + ] + }, + "Indication.EMAIndication": { + "description": "Indication from the organization `ema`.", + "allOf": [ + { + "$ref": "#/components/schemas/Indication.Indication" + }, + { + "properties": { + "id": { + "pattern": "^ind:ema:", + "examples": [ + "ind:ema:string" + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + } + ] + } + } + } + ] + }, + "Indication.HCIndication": { + "description": "Indication from the organization `hc`.", + "allOf": [ + { + "$ref": "#/components/schemas/Indication.Indication" + }, + { + "properties": { + "id": { + "pattern": "^ind:hc:", + "examples": [ + "ind:hc:string" + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + } + ] + } + } + } + ] + }, + "Indication.HPRAIndication": { + "description": "Indication from the organization `hpra`.", + "allOf": [ + { + "$ref": "#/components/schemas/Indication.Indication" + }, + { + "properties": { + "id": { + "pattern": "^ind:hpra:", + "examples": [ + "ind:hpra:string" + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + } + ] + } + } + } + ] + }, + "Indication.HSEIndication": { + "description": "Indication from the Health Service Executive (HSE). Unlike other organizations, carries reimbursement information as extensions.", + "allOf": [ + { + "$ref": "#/components/schemas/Indication.Indication" + }, + { + "properties": { + "id": { + "pattern": "^ind:hse:", + "examples": [ + "ind:hse:string" + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reimbursement_scheme" + }, + "value": { + "enum": [ + "CDS", + "ODMS", + "Incomplete Reimbursement", + "Hospital", + "N/A", + "Hybrid" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reimbursement_comment" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Approved", + "Accelerated", + "Superseded", + "Withdrawn" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reimbursement_scheme" + }, + "value": { + "enum": [ + "CDS", + "ODMS", + "Incomplete Reimbursement", + "Hospital", + "N/A", + "Hybrid" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "reimbursement_comment" + }, + "value": { + "type": [ + "string", + "null" + ] + } + } + } + } + ] + } + } + } + ] + }, + "Mapping": { + "title": "Mapping", + "description": "A concept mapping as stored in a mappings file: a coding plus a SKOS relation, with the join record's `id`. Embedded in concepts as `ConceptMapping` (no `id`).", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^map:.+::.+$", + "examples": [ + "map:string" + ] + }, + "relation": { + "enum": [ + "broadMatch", + "closeMatch", + "exactMatch", + "narrowMatch", + "relatedMatch" + ] + }, + "coding": { + "$ref": "#/components/schemas/Coding" + } + }, + "required": [ + "id", + "relation", + "coding" + ], + "additionalProperties": false, + "examples": [ + { + "id": "map:hgnc:1097::ncbi:673", + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + } + ] + }, + "Mapping.ConceptMapping": { + "type": "object", + "properties": { + "relation": { + "enum": [ + "broadMatch", + "closeMatch", + "exactMatch", + "narrowMatch", + "relatedMatch" + ] + }, + "coding": { + "$ref": "#/components/schemas/Coding" + } + }, + "required": [ + "relation", + "coding" + ], + "additionalProperties": false, + "description": "Mapping as embedded within a concept's `mappings` list." + }, + "Proposition": { + "title": "Proposition", + "description": "A VariantTherapeuticResponseProposition. Because Cat-VRS does not yet support sets of categorical variants, `subjectVariant` is a placeholder and the biomarker criteria are held in the `biomarkers` extension.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^prop:vtxr:\\d+$", + "examples": [ + "prop:vtxr:string" + ] + }, + "type": { + "const": "VariantTherapeuticResponseProposition" + }, + "predicate": { + "enum": [ + "predictsSensitivityTo", + "predictsResistanceTo" + ] + }, + "subjectVariant": { + "type": "object", + "properties": { + "type": { + "const": "CategoricalVariant" + }, + "description": { + "type": "string" + } + }, + "required": [ + "type", + "description" + ], + "additionalProperties": false + }, + "conditionQualifier": { + "$ref": "#/components/schemas/Disease" + }, + "objectTherapeutic": { + "oneOf": [ + { + "$ref": "#/components/schemas/Therapy" + }, + { + "$ref": "#/components/schemas/TherapyGroup" + } + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarkers" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BiomarkerCriterion" + }, + "minItems": 1 + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarkers" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BiomarkerCriterion" + }, + "minItems": 1 + } + } + } + } + ] + } + }, + "required": [ + "id", + "type", + "predicate", + "subjectVariant", + "conditionQualifier", + "objectTherapeutic", + "extensions" + ], + "additionalProperties": false, + "examples": [ + { + "id": "prop:vtxr:88", + "type": "VariantTherapeuticResponseProposition", + "predicate": "predictsSensitivityTo", + "subjectVariant": { + "type": "CategoricalVariant", + "description": "Placeholder. Cat-VRS does not yet support sets of categorical variants. See the 'biomarkers' extension for biomarkers associated with this Proposition." + }, + "conditionQualifier": { + "id": "dis:ncit:C3224", + "conceptType": "Disease", + "name": "Melanoma", + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:oncotree:MEL", + "code": "MEL", + "name": "Melanoma", + "system": "https://oncotree.mskcc.org", + "systemVersion": "oncotree_2025_10_03", + "iris": [ + "https://oncotree.mskcc.org/?version=oncotree_2025_10_03&field=NAME&search=Melanoma+%28MEL%29" + ] + } + } + ], + "extensions": [ + { + "name": "solid_tumor", + "value": true, + "description": "Boolean value for if this tumor type is categorized as a solid tumor." + } + ], + "primaryCoding": { + "id": "coding:ncit:C3224", + "code": "C3224", + "name": "Melanoma", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C3224" + ] + } + }, + "objectTherapeutic": { + "id": "tx:ncit:C82386", + "conceptType": "Therapy", + "name": "Dabrafenib", + "mappings": [ + { + "relation": "relatedMatch", + "coding": { + "id": "coding:rxcui:1424911", + "code": "1424911", + "name": "dabrafenib", + "system": "RxNorm", + "systemVersion": "02-Mar-2026", + "iris": [ + "https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=1424911" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:omop:43532299", + "code": "43532299", + "name": "dabrafenib", + "system": "OMOP", + "systemVersion": "v20260227", + "iris": [ + "https://athena.ohdsi.org/search-terms/terms/43532299" + ] + } + } + ], + "extensions": [ + { + "name": "therapy_strategy", + "value": [ + "B-RAF inhibition" + ], + "description": "Associated therapeutic strategy or mechanism of action of the therapy." + }, + { + "name": "therapy_type", + "value": "Targeted therapy", + "description": "Type of cancer treatment from cancer.gov: https://www.cancer.gov/about-cancer/treatment/types" + } + ], + "primaryCoding": { + "id": "coding:ncit:C82386", + "code": "C82386", + "name": "Dabrafenib", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C82386" + ] + } + }, + "extensions": [ + { + "name": "biomarkers", + "value": [ + { + "id": "bmkr.criterion:16", + "present": true, + "subject": { + "id": "bmkr:16", + "type": "CategoricalVariant", + "name": "BRAF p.V600E", + "constraints": [ + { + "type": "DefiningAlleleConstraint", + "allele": { + "id": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "type": "Allele", + "name": "NP_004324.2:p.Val600Glu", + "aliases": [ + "NP_004324.2:p.V600E", + "BRAF p.V600E" + ], + "description": "VRS variation of NP_004324.2:p.Val600Glu", + "digest": "j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "expressions": [ + { + "syntax": "hgvs.p", + "value": "NP_004324.2:p.Val600Glu", + "extensions": [ + { + "name": "hgvs.p_short", + "value": "p.V600E" + } + ] + } + ], + "location": { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + }, + "state": { + "type": "LiteralSequenceExpression", + "sequence": "E" + } + }, + "relations": [] + }, + { + "type": "FeatureContextConstraint", + "featureContext": { + "id": "gene:hgnc:1097", + "conceptType": "Gene", + "name": "BRAF", + "primaryCoding": { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + }, + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:ensembl:ensg00000157764", + "code": "ENSG00000157764", + "system": "https://www.ensembl.org", + "iris": [ + "https://www.ensembl.org/id/ENSG00000157764" + ] + } + }, + { + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:refseq:NM_004333.6", + "code": "NM_004333.6", + "system": "https://www.ncbi.nlm.nih.gov/nuccore", + "iris": [ + "https://www.ncbi.nlm.nih.gov/nuccore/NM_004333.6" + ] + } + } + ] + } + } + ], + "extensions": [ + { + "name": "biomarker_type", + "value": "Somatic variant" + }, + { + "name": "chromosome", + "value": "7" + }, + { + "name": "start_position", + "value": 140453136 + }, + { + "name": "end_position", + "value": 140453136 + }, + { + "name": "reference_allele", + "value": "A" + }, + { + "name": "alternate_allele", + "value": "T" + }, + { + "name": "cdna_change", + "value": "c.1799T>A" + }, + { + "name": "protein_change", + "value": "p.V600E" + }, + { + "name": "variant_annotation", + "value": "Missense" + }, + { + "name": "exon", + "value": 15 + }, + { + "name": "rsid", + "value": "rs113488022" + }, + { + "name": "hgvsg", + "value": "7:g.140453136A>T" + }, + { + "name": "hgvsc", + "value": "ENST00000288602.6:c.1799T>A" + } + ] + } + } + ], + "description": "The biomarkers associated with this Proposition, each with a `present` flag indicating if the biomarker is present (true) or absent (false). Multiple biomarkers are combined with implied AND logic." + } + ] + } + ] + }, + "SequenceLocation": { + "title": "SequenceLocation", + "description": "A VRS SequenceLocation with its SequenceReference embedded.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ga4gh:SL\\.[A-Za-z0-9_-]{32}$", + "examples": [ + "ga4gh:SL.string" + ] + }, + "type": { + "const": "SequenceLocation" + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "digest": { + "type": "string" + }, + "sequenceReference": { + "$ref": "#/components/schemas/SequenceReference" + }, + "start": { + "type": "integer", + "minimum": 0 + }, + "end": { + "type": "integer", + "minimum": 0 + }, + "sequence": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "id", + "type", + "name", + "aliases", + "description", + "digest", + "sequenceReference", + "start", + "end", + "sequence" + ], + "additionalProperties": false, + "examples": [ + { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + } + ] + }, + "SequenceReference": { + "title": "SequenceReference", + "description": "A VRS SequenceReference: a reference sequence (protein, transcript, or chromosome).", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ga4gh:SQ\\.[A-Za-z0-9_-]{32}$", + "examples": [ + "ga4gh:SQ.string" + ] + }, + "type": { + "const": "SequenceReference" + }, + "name": { + "type": "string" + }, + "aliases": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "moleculeType": { + "enum": [ + "protein", + "mRNA", + "genomic" + ] + }, + "refgetAccession": { + "type": "string", + "pattern": "^SQ\\.[A-Za-z0-9_-]{32}$", + "examples": [ + "SQ.string" + ] + }, + "residueAlphabet": { + "enum": [ + "aa", + "na" + ] + } + }, + "required": [ + "id", + "type", + "name", + "aliases", + "description", + "moleculeType", + "refgetAccession", + "residueAlphabet" + ], + "additionalProperties": false, + "examples": [ + { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + } + ] + }, + "Statement": { + "title": "Statement", + "description": "A knowledge claim, with contributions, documents, proposition, and strength embedded. `status` and the underlying `indication` are extensions.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^stmt:(fda|ema|hse|hc|hpra):.+$", + "examples": [ + "stmt:string" + ] + }, + "type": { + "const": "Statement" + }, + "description": { + "type": "string" + }, + "contributions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Contribution" + } + }, + "reportedIn": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "direction": { + "enum": [ + "supports", + "disputes", + "neutral" + ] + }, + "proposition": { + "$ref": "#/components/schemas/Proposition" + }, + "strength": { + "$ref": "#/components/schemas/Strength" + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Active", + "Superseded", + "Deprecated" + ] + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "indication" + }, + "value": { + "$ref": "#/components/schemas/Indication" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "status" + }, + "value": { + "enum": [ + "Active", + "Superseded", + "Deprecated" + ] + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "indication" + }, + "value": { + "$ref": "#/components/schemas/Indication" + } + } + } + } + ] + } + }, + "required": [ + "id", + "type", + "description", + "contributions", + "reportedIn", + "direction", + "proposition", + "strength", + "extensions" + ], + "additionalProperties": false, + "examples": [ + { + "id": "stmt:fda:tafinlar:0:0", + "type": "Statement", + "description": "The U.S. Food and Drug Administration granted approval to dabrafenib for the treatment of patients with unresectable or metastatic melanoma with BRAF V600E mutation, as detected by an FDA-approved test.", + "contributions": [ + { + "id": "ctrb:vanallenlab:2024-10-30:0", + "type": "Contribution", + "description": "Initial access of FDA approvals", + "date": "2024-10-30", + "contributor": { + "id": "agent:user:vanallenlab", + "type": "Agent", + "agentType": "contributor", + "name": "Van Allen lab", + "description": "Van Allen lab, Dana-Farber Cancer Institute" + } + }, + { + "id": "ctrb:fda:2013-05-29:0", + "type": "Contribution", + "description": "Indication received traditional approval.", + "date": "2013-05-29", + "contributor": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + } + } + ], + "reportedIn": [ + { + "id": "doc:fda:tafinlar", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf. Revised March 2024. Accessed October 30, 2024.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2024-03-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Active", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + }, + { + "id": "doc:fda:tafinlar:2013-05-29", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2013/202806s000lbl.pdf. Revised May 2013. Accessed October 6, 2026.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2013/202806s000lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2013-05-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Deprecated", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + } + ], + "direction": "supports", + "proposition": { + "id": "prop:vtxr:88", + "type": "VariantTherapeuticResponseProposition", + "predicate": "predictsSensitivityTo", + "subjectVariant": { + "type": "CategoricalVariant", + "description": "Placeholder. Cat-VRS does not yet support sets of categorical variants. See the 'biomarkers' extension for biomarkers associated with this Proposition." + }, + "conditionQualifier": { + "id": "dis:ncit:C3224", + "conceptType": "Disease", + "name": "Melanoma", + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:oncotree:MEL", + "code": "MEL", + "name": "Melanoma", + "system": "https://oncotree.mskcc.org", + "systemVersion": "oncotree_2025_10_03", + "iris": [ + "https://oncotree.mskcc.org/?version=oncotree_2025_10_03&field=NAME&search=Melanoma+%28MEL%29" + ] + } + } + ], + "extensions": [ + { + "name": "solid_tumor", + "value": true, + "description": "Boolean value for if this tumor type is categorized as a solid tumor." + } + ], + "primaryCoding": { + "id": "coding:ncit:C3224", + "code": "C3224", + "name": "Melanoma", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C3224" + ] + } + }, + "objectTherapeutic": { + "id": "tx:ncit:C82386", + "conceptType": "Therapy", + "name": "Dabrafenib", + "mappings": [ + { + "relation": "relatedMatch", + "coding": { + "id": "coding:rxcui:1424911", + "code": "1424911", + "name": "dabrafenib", + "system": "RxNorm", + "systemVersion": "02-Mar-2026", + "iris": [ + "https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=1424911" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:omop:43532299", + "code": "43532299", + "name": "dabrafenib", + "system": "OMOP", + "systemVersion": "v20260227", + "iris": [ + "https://athena.ohdsi.org/search-terms/terms/43532299" + ] + } + } + ], + "extensions": [ + { + "name": "therapy_strategy", + "value": [ + "B-RAF inhibition" + ], + "description": "Associated therapeutic strategy or mechanism of action of the therapy." + }, + { + "name": "therapy_type", + "value": "Targeted therapy", + "description": "Type of cancer treatment from cancer.gov: https://www.cancer.gov/about-cancer/treatment/types" + } + ], + "primaryCoding": { + "id": "coding:ncit:C82386", + "code": "C82386", + "name": "Dabrafenib", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C82386" + ] + } + }, + "extensions": [ + { + "name": "biomarkers", + "value": [ + { + "id": "bmkr.criterion:16", + "present": true, + "subject": { + "id": "bmkr:16", + "type": "CategoricalVariant", + "name": "BRAF p.V600E", + "constraints": [ + { + "type": "DefiningAlleleConstraint", + "allele": { + "id": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "type": "Allele", + "name": "NP_004324.2:p.Val600Glu", + "aliases": [ + "NP_004324.2:p.V600E", + "BRAF p.V600E" + ], + "description": "VRS variation of NP_004324.2:p.Val600Glu", + "digest": "j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "expressions": [ + { + "syntax": "hgvs.p", + "value": "NP_004324.2:p.Val600Glu", + "extensions": [ + { + "name": "hgvs.p_short", + "value": "p.V600E" + } + ] + } + ], + "location": { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + }, + "state": { + "type": "LiteralSequenceExpression", + "sequence": "E" + } + }, + "relations": [] + }, + { + "type": "FeatureContextConstraint", + "featureContext": { + "id": "gene:hgnc:1097", + "conceptType": "Gene", + "name": "BRAF", + "primaryCoding": { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + }, + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:ensembl:ensg00000157764", + "code": "ENSG00000157764", + "system": "https://www.ensembl.org", + "iris": [ + "https://www.ensembl.org/id/ENSG00000157764" + ] + } + }, + { + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:refseq:NM_004333.6", + "code": "NM_004333.6", + "system": "https://www.ncbi.nlm.nih.gov/nuccore", + "iris": [ + "https://www.ncbi.nlm.nih.gov/nuccore/NM_004333.6" + ] + } + } + ] + } + } + ], + "extensions": [ + { + "name": "biomarker_type", + "value": "Somatic variant" + }, + { + "name": "chromosome", + "value": "7" + }, + { + "name": "start_position", + "value": 140453136 + }, + { + "name": "end_position", + "value": 140453136 + }, + { + "name": "reference_allele", + "value": "A" + }, + { + "name": "alternate_allele", + "value": "T" + }, + { + "name": "cdna_change", + "value": "c.1799T>A" + }, + { + "name": "protein_change", + "value": "p.V600E" + }, + { + "name": "variant_annotation", + "value": "Missense" + }, + { + "name": "exon", + "value": 15 + }, + { + "name": "rsid", + "value": "rs113488022" + }, + { + "name": "hgvsg", + "value": "7:g.140453136A>T" + }, + { + "name": "hgvsc", + "value": "ENST00000288602.6:c.1799T>A" + } + ] + } + } + ], + "description": "The biomarkers associated with this Proposition, each with a `present` flag indicating if the biomarker is present (true) or absent (false). Multiple biomarkers are combined with implied AND logic." + } + ] + }, + "strength": { + "id": "str:ncit:C25425", + "conceptType": "Evidence", + "name": "Approval", + "mappings": [], + "primaryCoding": { + "id": "coding:ncit:C25425", + "code": "C25425", + "name": "Approval", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C25425" + ] + } + }, + "extensions": [ + { + "name": "status", + "value": "Active", + "description": "Whether this Statement is Active, Superseded, or Deprecated within moalmanac-db." + }, + { + "name": "indication", + "value": { + "id": "ind:fda:tafinlar:0", + "type": "Indication", + "description": "TAFINLAR is a kinase inhibitor indicated as a single agent for the treatment of patients with unresectable or metastatic melanoma with BRAF V600E mutation as detected by an FDA-approved test.", + "contributions": [ + { + "id": "ctrb:vanallenlab:2024-10-30:0", + "type": "Contribution", + "description": "Initial access of FDA approvals", + "date": "2024-10-30", + "contributor": { + "id": "agent:user:vanallenlab", + "type": "Agent", + "agentType": "contributor", + "name": "Van Allen lab", + "description": "Van Allen lab, Dana-Farber Cancer Institute" + } + }, + { + "id": "ctrb:fda:2013-05-29:0", + "type": "Contribution", + "description": "Indication received traditional approval.", + "date": "2013-05-29", + "contributor": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + } + } + ], + "reportedIn": [ + { + "id": "doc:fda:tafinlar", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf. Revised March 2024. Accessed October 30, 2024.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2024/202806s030lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2024-03-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Active", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + }, + { + "id": "doc:fda:tafinlar:2013-05-29", + "type": "Document", + "documentType": "Regulatory approval", + "name": "Tafinlar (dabrafenib) [package insert]. FDA.", + "title": null, + "aliases": [], + "description": "Novartis Pharmaceuticals Corporation. Tafinlar (dabrafenib) [package insert]. U.S. Food and Drug Administration website. https://www.accessdata.fda.gov/drugsatfda_docs/label/2013/202806s000lbl.pdf. Revised May 2013. Accessed October 6, 2026.", + "urls": [ + "https://www.accessdata.fda.gov/drugsatfda_docs/label/2013/202806s000lbl.pdf", + "https://www.accessdata.fda.gov/scripts/cder/daf/index.cfm?event=overview.process&ApplNo=202806" + ], + "doi": null, + "pmid": null, + "extensions": [ + { + "name": "agent", + "value": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + }, + "description": "The organization that published this document." + }, + { + "name": "company", + "value": "Novartis Pharmaceuticals Corporation.", + "description": "The company that manufactures the cancer drug. Only applicable to market authorization documents." + }, + { + "name": "drug_name_brand", + "value": "Tafinlar", + "description": "The brand name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "drug_name_generic", + "value": "dabrafenib", + "description": "The generic name of the cancer drug, per this document. Only applicable to market authorization documents." + }, + { + "name": "first_publication_date", + "value": null, + "description": "The publication date for the initial version of this document." + }, + { + "name": "publication_date", + "value": "2013-05-29", + "description": "The publication date for the document." + }, + { + "name": "regulatory_identifier", + "value": "NDA202806", + "description": "Identifier assigned by the regulatory agency, such as an FDA application number (e.g. NDA208716, BLA125427) or an EMA product number (e.g. EMEA/H/C/006184)." + }, + { + "name": "status", + "value": "Deprecated", + "description": "Whether this document is Active or Deprecated within moalmanac-db." + } + ] + } + ], + "extensions": [ + { + "name": "status", + "value": "Approved", + "description": "Current approval status." + } + ] + }, + "description": "The underlying Indication supporting this Statement." + } + ] + } + ] + }, + "Strength": { + "title": "Strength", + "description": "The category of evidence supporting a statement, with its primary coding embedded.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^str:ncit:C\\d+$", + "examples": [ + "str:ncit:Cstring" + ] + }, + "conceptType": { + "const": "Evidence" + }, + "name": { + "type": "string" + }, + "primaryCoding": { + "$ref": "#/components/schemas/Coding" + }, + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mapping.ConceptMapping" + } + } + }, + "required": [ + "id", + "conceptType", + "name", + "primaryCoding", + "mappings" + ], + "additionalProperties": false, + "examples": [ + { + "id": "str:ncit:C25425", + "conceptType": "Evidence", + "name": "Approval", + "mappings": [], + "primaryCoding": { + "id": "coding:ncit:C25425", + "code": "C25425", + "name": "Approval", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C25425" + ] + } + } + ] + }, + "Therapy": { + "title": "Therapy", + "description": "A therapeutic agent concept with its primary coding and mappings embedded.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^tx:ncit:C\\d+$", + "examples": [ + "tx:ncit:Cstring" + ] + }, + "conceptType": { + "const": "Therapy" + }, + "name": { + "type": "string" + }, + "primaryCoding": { + "$ref": "#/components/schemas/Coding" + }, + "mappings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Mapping.ConceptMapping" + } + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "therapy_strategy" + }, + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "therapy_type" + }, + "value": { + "type": "string" + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "therapy_strategy" + }, + "value": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "therapy_type" + }, + "value": { + "type": "string" + } + } + } + } + ] + } + }, + "required": [ + "id", + "conceptType", + "name", + "primaryCoding", + "mappings", + "extensions" + ], + "additionalProperties": false, + "examples": [ + { + "id": "tx:ncit:C82386", + "conceptType": "Therapy", + "name": "Dabrafenib", + "mappings": [ + { + "relation": "relatedMatch", + "coding": { + "id": "coding:rxcui:1424911", + "code": "1424911", + "name": "dabrafenib", + "system": "RxNorm", + "systemVersion": "02-Mar-2026", + "iris": [ + "https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=1424911" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:omop:43532299", + "code": "43532299", + "name": "dabrafenib", + "system": "OMOP", + "systemVersion": "v20260227", + "iris": [ + "https://athena.ohdsi.org/search-terms/terms/43532299" + ] + } + } + ], + "extensions": [ + { + "name": "therapy_strategy", + "value": [ + "B-RAF inhibition" + ], + "description": "Associated therapeutic strategy or mechanism of action of the therapy." + }, + { + "name": "therapy_type", + "value": "Targeted therapy", + "description": "Type of cancer treatment from cancer.gov: https://www.cancer.gov/about-cancer/treatment/types" + } + ], + "primaryCoding": { + "id": "coding:ncit:C82386", + "code": "C82386", + "name": "Dabrafenib", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C82386" + ] + } + } + ] + }, + "TherapyGroup": { + "title": "TherapyGroup", + "description": "A set of therapies administered together, with each therapy embedded.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^txgrp:\\d+$", + "examples": [ + "txgrp:string" + ] + }, + "membershipOperator": { + "enum": [ + "AND", + "OR" + ] + }, + "therapies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Therapy" + }, + "minItems": 1 + } + }, + "required": [ + "id", + "membershipOperator", + "therapies" + ], + "additionalProperties": false, + "examples": [ + { + "id": "txgrp:18", + "membershipOperator": "AND", + "therapies": [ + { + "id": "tx:ncit:C82386", + "conceptType": "Therapy", + "name": "Dabrafenib", + "mappings": [ + { + "relation": "relatedMatch", + "coding": { + "id": "coding:rxcui:1424911", + "code": "1424911", + "name": "dabrafenib", + "system": "RxNorm", + "systemVersion": "02-Mar-2026", + "iris": [ + "https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=1424911" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:omop:43532299", + "code": "43532299", + "name": "dabrafenib", + "system": "OMOP", + "systemVersion": "v20260227", + "iris": [ + "https://athena.ohdsi.org/search-terms/terms/43532299" + ] + } + } + ], + "extensions": [ + { + "name": "therapy_strategy", + "value": [ + "B-RAF inhibition" + ], + "description": "Associated therapeutic strategy or mechanism of action of the therapy." + }, + { + "name": "therapy_type", + "value": "Targeted therapy", + "description": "Type of cancer treatment from cancer.gov: https://www.cancer.gov/about-cancer/treatment/types" + } + ], + "primaryCoding": { + "id": "coding:ncit:C82386", + "code": "C82386", + "name": "Dabrafenib", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C82386" + ] + } + }, + { + "id": "tx:ncit:C77908", + "conceptType": "Therapy", + "name": "Trametinib", + "mappings": [ + { + "relation": "relatedMatch", + "coding": { + "id": "coding:rxcui:1425099", + "code": "1425099", + "name": "trametinib", + "system": "RxNorm", + "systemVersion": "02-Mar-2026", + "iris": [ + "https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=1425099" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:omop:43532497", + "code": "43532497", + "name": "trametinib", + "system": "OMOP", + "systemVersion": "v20260227", + "iris": [ + "https://athena.ohdsi.org/search-terms/terms/43532497" + ] + } + } + ], + "extensions": [ + { + "name": "therapy_strategy", + "value": [ + "MEK inhibition" + ], + "description": "Associated therapeutic strategy or mechanism of action of the therapy." + }, + { + "name": "therapy_type", + "value": "Targeted therapy", + "description": "Type of cancer treatment from cancer.gov: https://www.cancer.gov/about-cancer/treatment/types" + } + ], + "primaryCoding": { + "id": "coding:ncit:C77908", + "code": "C77908", + "name": "Trametinib", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C77908" + ] + } + } + ] + } + ] + }, + "About": { + "title": "About", + "description": "Database metadata from about.json. Unlike every other referenced file, this is a single object, and it becomes the root `about` key of the dereferenced database.", + "type": "object", + "properties": { + "github": { + "type": "string", + "format": "uri" + }, + "name": { + "type": "string" + }, + "license": { + "type": "string" + }, + "release": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + }, + "last_updated": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$" + } + }, + "required": [ + "github", + "name", + "license", + "release", + "url", + "last_updated" + ], + "additionalProperties": false, + "examples": [ + { + "github": "https://github.com/vanallenlab/moalmanac-db", + "name": "Molecular Oncology Almanac", + "license": "GPL-2.0", + "release": "draft", + "url": "https://moalmanac.org", + "last_updated": "2026-10-08" + } + ] + }, + "SearchResult": { + "title": "SearchResult", + "description": "A Proposition with aggregated information about the statements made about it.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^prop:vtxr:\\d+$", + "examples": [ + "prop:vtxr:string" + ] + }, + "type": { + "const": "VariantTherapeuticResponseProposition" + }, + "predicate": { + "enum": [ + "predictsSensitivityTo", + "predictsResistanceTo" + ] + }, + "subjectVariant": { + "type": "object", + "properties": { + "type": { + "const": "CategoricalVariant" + }, + "description": { + "type": "string" + } + }, + "required": [ + "type", + "description" + ], + "additionalProperties": false + }, + "conditionQualifier": { + "$ref": "#/components/schemas/Disease" + }, + "objectTherapeutic": { + "oneOf": [ + { + "$ref": "#/components/schemas/Therapy" + }, + { + "$ref": "#/components/schemas/TherapyGroup" + } + ] + }, + "extensions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarkers" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BiomarkerCriterion" + }, + "minItems": 1 + } + } + } + ] + }, + "allOf": [ + { + "contains": { + "$ref": "#/components/schemas/Extension", + "properties": { + "name": { + "const": "biomarkers" + }, + "value": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BiomarkerCriterion" + }, + "minItems": 1 + } + } + } + } + ] + }, + "aggregates": { + "title": "Search aggregates", + "description": "Counts of Active statements made about this proposition, narrowed by the `document`, `indication`, and `agent_id` filters.", + "type": "object", + "required": [ + "statement_count", + "by_direction", + "by_document", + "by_agent", + "by_strength" + ], + "properties": { + "statement_count": { + "type": "integer" + }, + "by_direction": { + "type": "array", + "items": { + "type": "object", + "required": [ + "direction", + "count" + ], + "properties": { + "direction": { + "type": [ + "string", + "null" + ] + }, + "count": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "by_document": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "count" + ], + "properties": { + "id": { + "type": "string", + "description": "Document id." + }, + "count": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "by_agent": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "count" + ], + "properties": { + "id": { + "type": "string", + "description": "Agent id." + }, + "count": { + "type": "integer" + } + }, + "additionalProperties": false + } + }, + "by_strength": { + "type": "array", + "items": { + "type": "object", + "required": [ + "id", + "count" + ], + "properties": { + "id": { + "type": "string", + "description": "Strength id." + }, + "count": { + "type": "integer" + } + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "predicate", + "subjectVariant", + "conditionQualifier", + "objectTherapeutic", + "extensions", + "aggregates" + ], + "additionalProperties": false, + "examples": [ + { + "id": "prop:vtxr:88", + "type": "VariantTherapeuticResponseProposition", + "predicate": "predictsSensitivityTo", + "subjectVariant": { + "type": "CategoricalVariant", + "description": "Placeholder. Cat-VRS does not yet support sets of categorical variants. See the 'biomarkers' extension for biomarkers associated with this Proposition." + }, + "conditionQualifier": { + "id": "dis:ncit:C3224", + "conceptType": "Disease", + "name": "Melanoma", + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:oncotree:MEL", + "code": "MEL", + "name": "Melanoma", + "system": "https://oncotree.mskcc.org", + "systemVersion": "oncotree_2025_10_03", + "iris": [ + "https://oncotree.mskcc.org/?version=oncotree_2025_10_03&field=NAME&search=Melanoma+%28MEL%29" + ] + } + } + ], + "extensions": [ + { + "name": "solid_tumor", + "value": true, + "description": "Boolean value for if this tumor type is categorized as a solid tumor." + } + ], + "primaryCoding": { + "id": "coding:ncit:C3224", + "code": "C3224", + "name": "Melanoma", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C3224" + ] + } + }, + "objectTherapeutic": { + "id": "tx:ncit:C82386", + "conceptType": "Therapy", + "name": "Dabrafenib", + "mappings": [ + { + "relation": "relatedMatch", + "coding": { + "id": "coding:rxcui:1424911", + "code": "1424911", + "name": "dabrafenib", + "system": "RxNorm", + "systemVersion": "02-Mar-2026", + "iris": [ + "https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=1424911" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:omop:43532299", + "code": "43532299", + "name": "dabrafenib", + "system": "OMOP", + "systemVersion": "v20260227", + "iris": [ + "https://athena.ohdsi.org/search-terms/terms/43532299" + ] + } + } + ], + "extensions": [ + { + "name": "therapy_strategy", + "value": [ + "B-RAF inhibition" + ], + "description": "Associated therapeutic strategy or mechanism of action of the therapy." + }, + { + "name": "therapy_type", + "value": "Targeted therapy", + "description": "Type of cancer treatment from cancer.gov: https://www.cancer.gov/about-cancer/treatment/types" + } + ], + "primaryCoding": { + "id": "coding:ncit:C82386", + "code": "C82386", + "name": "Dabrafenib", + "system": "https://evsexplore.semantics.cancer.gov", + "systemVersion": "26.08e", + "iris": [ + "https://evsexplore.semantics.cancer.gov/evsexplore/concept/ncit/C82386" + ] + } + }, + "extensions": [ + { + "name": "biomarkers", + "value": [ + { + "id": "bmkr.criterion:16", + "present": true, + "subject": { + "id": "bmkr:16", + "type": "CategoricalVariant", + "name": "BRAF p.V600E", + "constraints": [ + { + "type": "DefiningAlleleConstraint", + "allele": { + "id": "ga4gh:VA.j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "type": "Allele", + "name": "NP_004324.2:p.Val600Glu", + "aliases": [ + "NP_004324.2:p.V600E", + "BRAF p.V600E" + ], + "description": "VRS variation of NP_004324.2:p.Val600Glu", + "digest": "j4XnsLZcdzDIYa5pvvXM7t1wn9OITr0L", + "expressions": [ + { + "syntax": "hgvs.p", + "value": "NP_004324.2:p.Val600Glu", + "extensions": [ + { + "name": "hgvs.p_short", + "value": "p.V600E" + } + ] + } + ], + "location": { + "id": "ga4gh:SL.t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "type": "SequenceLocation", + "name": null, + "aliases": [], + "description": "Amino acid position 600 of the Refseq protein NP_004324.2, which is the protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6).", + "digest": "t-3DrWALhgLdXHsupI-e-M00aL3HgK3y", + "sequenceReference": { + "id": "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "type": "SequenceReference", + "name": "NP_004324.2", + "aliases": [ + "ensembl:ENSP00000288602.6", + "ga4gh:SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "refseq:NP_004324.2" + ], + "description": "The protein product of the MANE Select coding transcript for BRAF (refseq:NM_004333.6), corresponding to the Refseq protein accession NP_004324.2.", + "moleculeType": "protein", + "refgetAccession": "SQ.cQvw4UsHHRRlogxbWCB8W-mKD4AraM9y", + "residueAlphabet": "aa" + }, + "start": 599, + "end": 600, + "sequence": "V" + }, + "state": { + "type": "LiteralSequenceExpression", + "sequence": "E" + } + }, + "relations": [] + }, + { + "type": "FeatureContextConstraint", + "featureContext": { + "id": "gene:hgnc:1097", + "conceptType": "Gene", + "name": "BRAF", + "primaryCoding": { + "id": "coding:hgnc:1097", + "code": "HGNC:1097", + "system": "https://genenames.org", + "iris": [ + "https://www.genenames.org/data/gene-symbol-report/#!/hgnc_id/HGNC:1097" + ] + }, + "mappings": [ + { + "relation": "exactMatch", + "coding": { + "id": "coding:ensembl:ensg00000157764", + "code": "ENSG00000157764", + "system": "https://www.ensembl.org", + "iris": [ + "https://www.ensembl.org/id/ENSG00000157764" + ] + } + }, + { + "relation": "exactMatch", + "coding": { + "id": "coding:ncbi:673", + "code": "673", + "system": "https://www.ncbi.nlm.nih.gov/gene", + "iris": [ + "https://www.ncbi.nlm.nih.gov/gene/673" + ] + } + }, + { + "relation": "relatedMatch", + "coding": { + "id": "coding:refseq:NM_004333.6", + "code": "NM_004333.6", + "system": "https://www.ncbi.nlm.nih.gov/nuccore", + "iris": [ + "https://www.ncbi.nlm.nih.gov/nuccore/NM_004333.6" + ] + } + } + ] + } + } + ], + "extensions": [ + { + "name": "biomarker_type", + "value": "Somatic variant" + }, + { + "name": "chromosome", + "value": "7" + }, + { + "name": "start_position", + "value": 140453136 + }, + { + "name": "end_position", + "value": 140453136 + }, + { + "name": "reference_allele", + "value": "A" + }, + { + "name": "alternate_allele", + "value": "T" + }, + { + "name": "cdna_change", + "value": "c.1799T>A" + }, + { + "name": "protein_change", + "value": "p.V600E" + }, + { + "name": "variant_annotation", + "value": "Missense" + }, + { + "name": "exon", + "value": 15 + }, + { + "name": "rsid", + "value": "rs113488022" + }, + { + "name": "hgvsg", + "value": "7:g.140453136A>T" + }, + { + "name": "hgvsc", + "value": "ENST00000288602.6:c.1799T>A" + } + ] + } + } + ], + "description": "The biomarkers associated with this Proposition, each with a `present` flag indicating if the biomarker is present (true) or absent (false). Multiple biomarkers are combined with implied AND logic." + } + ], + "aggregates": { + "statement_count": 1, + "by_direction": [ + { + "direction": "supports", + "count": 1 + } + ], + "by_document": [ + { + "id": "doc:fda:tafinlar", + "count": 1 + }, + { + "id": "doc:fda:tafinlar:2013-05-29", + "count": 1 + } + ], + "by_agent": [ + { + "id": "agent:org:fda", + "count": 1 + } + ], + "by_strength": [ + { + "id": "str:ncit:C25425", + "count": 1 + } + ] + } + } + ] + }, + "ContributionResult": { + "title": "ContributionResult", + "description": "A Contribution, with a `records` extension when requested with `include_records=true`.", + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^ctrb:[a-z]+:\\d{4}-\\d{2}-\\d{2}:\\d+$", + "examples": [ + "ctrb:string" + ] + }, + "type": { + "const": "Contribution" + }, + "description": { + "type": "string" + }, + "date": { + "type": "string", + "pattern": "^\\d{4}-\\d{2}-\\d{2}$" + }, + "contributor": { + "$ref": "#/components/schemas/Agent", + "not": { + "required": [ + "extensions" + ] + } + }, + "extensions": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "value", + "description" + ], + "properties": { + "name": { + "const": "records" + }, + "value": { + "type": "array", + "description": "Indications and statements this contribution was made to.", + "items": { + "type": "object", + "required": [ + "id", + "type", + "name", + "description" + ], + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "Indication", + "Statement" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "description": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "required": [ + "id", + "type", + "description", + "date", + "contributor" + ], + "additionalProperties": false, + "examples": [ + { + "id": "ctrb:fda:2013-05-29:0", + "type": "Contribution", + "description": "Indication received traditional approval.", + "date": "2013-05-29", + "contributor": { + "id": "agent:org:fda", + "type": "Agent", + "agentType": "organization", + "name": "Food and Drug Administration", + "description": "Regulatory agency that approves drugs for use in the United States." + } + } + ] + }, + "Meta": { + "title": "Meta", + "description": "Information about the request and response.", + "type": "object", + "required": [ + "data_length", + "message", + "request_url", + "status", + "status_code", + "timestamp_elapsed", + "timestamp_received", + "timestamp_returned", + "trace_id" + ], + "properties": { + "data_length": { + "type": "integer", + "description": "Number of records in `data`, or 1 for a single object." + }, + "message": { + "type": "string", + "description": "Human-readable status message." + }, + "request_url": { + "type": [ + "string", + "null" + ], + "description": "The full URL of the request." + }, + "status": { + "type": "string", + "enum": [ + "success", + "error" + ] + }, + "status_code": { + "type": "integer", + "examples": [ + 200 + ] + }, + "timestamp_elapsed": { + "type": "number", + "description": "Seconds between receiving the request and returning it." + }, + "timestamp_received": { + "type": "string", + "format": "date-time", + "description": "When the request was received, in UTC.", + "examples": [ + "2026-10-16T14:03:12.123456Z" + ] + }, + "timestamp_returned": { + "type": "string", + "format": "date-time", + "description": "When the response was returned, in UTC.", + "examples": [ + "2026-10-16T14:03:12.123456Z" + ] + }, + "trace_id": { + "type": "string", + "format": "uuid", + "description": "Unique id for this response." + } + }, + "additionalProperties": false + } + } + }, + "tags": [ + { + "name": "Service Info", + "description": "Get metadata about the API service." + }, + { + "name": "Search", + "description": "Search across database records. Primarily uses /propositions endpoint with additional aggregated information." + }, + { + "name": "Entities", + "description": "Access to the database content." + } + ] +} diff --git a/moalmanac-db b/moalmanac-db deleted file mode 160000 index df7b204..0000000 --- a/moalmanac-db +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df7b2046423adfbbf23c9d220687b7efd0e94a30 diff --git a/moalmanac_db b/moalmanac_db new file mode 160000 index 0000000..e8179c4 --- /dev/null +++ b/moalmanac_db @@ -0,0 +1 @@ +Subproject commit e8179c4641a1f5c3345e5ec6c6ca6239548605ed diff --git a/run.py b/run.py index 3ab9fef..676f9d1 100644 --- a/run.py +++ b/run.py @@ -1,5 +1,6 @@ -import dotenv import os + +import dotenv import uvicorn from app.main import create_app diff --git a/service/README.md b/service/README.md index 9045661..794b5f2 100644 --- a/service/README.md +++ b/service/README.md @@ -35,7 +35,7 @@ Use `sudo -u moalmanac -H bash -c '...'` for multi-line commands like this one. 2. Create a static ip address to associate with the VM 3. Add A and CNAME to zone under network services > cloud dns > and your zone, if you haven't already created one 4. Create the `moalmanac` account and its conda install, as described in [Service account](#service-account). -5. As `moalmanac` (`sudo -iu moalmanac`), clone this repository with its `moalmanac-db` submodule and build its environment. The application imports `moalmanac-db/utils/dereference.py` directly at every startup to build the dereferenced record cache it serves, so it will fail to start without the submodule checked out. +5. As `moalmanac` (`sudo -iu moalmanac`), clone this repository with its `moalmanac-db` submodule and build its environment. The application imports `moalmanac_db/utils/dereference.py` directly at every startup to build the dereferenced record cache it serves, so it will fail to start without the submodule checked out. ```bash git clone --recurse-submodules https://github.com/vanallenlab/moalmanac-api.git /srv/moalmanac/moalmanac-api diff --git a/tests/conftest.py b/tests/conftest.py index a83e71c..8997076 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -12,7 +12,7 @@ from app.main import create_app REPO_ROOT = pathlib.Path(__file__).resolve().parents[1] -MOALMANAC_DB_ROOT = REPO_ROOT / "moalmanac-db" +MOALMANAC_DB_ROOT = REPO_ROOT / "moalmanac_db" REFERENCED_ROOT = MOALMANAC_DB_ROOT / "referenced" DEREFERENCED_ROOT = MOALMANAC_DB_ROOT / "dereferenced" SCHEMA_ROOT = MOALMANAC_DB_ROOT / "schemas" @@ -35,7 +35,7 @@ def load_json(path: pathlib.Path) -> dict[str, typing.Any]: def config_path(tmp_path_factory: pytest.TempPathFactory) -> str: """ Writes a config file pointing at a SQLite file in a temporary directory, and - populates that database from moalmanac-db/referenced. + populates that database from moalmanac_db/referenced. Args: tmp_path_factory (pytest.TempPathFactory): Pytest's session temp directory factory. @@ -118,10 +118,10 @@ def client(app: fastapi.FastAPI) -> fastapi.testclient.TestClient: def load_dereferenced(entity: str) -> dict[str, dict]: """ - Loads every record for one entity from moalmanac-db/dereferenced, keyed by id. + Loads every record for one entity from moalmanac_db/dereferenced, keyed by id. Args: - entity (str): The entity's directory name under moalmanac-db/dereferenced. + entity (str): The entity's directory name under moalmanac_db/dereferenced. Returns: dict[str, dict]: The entity's records, keyed by `id`, in the same order diff --git a/tests/test_endpoints.py b/tests/test_endpoints.py index 3a75f00..5bbd5c0 100644 --- a/tests/test_endpoints.py +++ b/tests/test_endpoints.py @@ -1,6 +1,6 @@ """ Each entity endpoint's `data` equals the records in -moalmanac-db/dereferenced//*.json exactly, and every record it returns +moalmanac_db/dereferenced//*.json exactly, and every record it returns validates against schemas/dereferenced/.schema.json. This is the plan's definition of done for the migration. """ @@ -65,7 +65,7 @@ def validator(entity: str, registry: Registry) -> jsonschema.Draft202012Validato def test_every_dereferenced_directory_has_an_endpoint(): """ - Ensures every moalmanac-db/dereferenced// directory has a matching + Ensures every moalmanac_db/dereferenced// directory has a matching endpoint, so a new upstream entity is not silently left unserved. """ from tests.conftest import DEREFERENCED_ROOT diff --git a/tests/test_filters.py b/tests/test_filters.py index 4a093ec..bb3202a 100644 --- a/tests/test_filters.py +++ b/tests/test_filters.py @@ -257,7 +257,7 @@ def test_search_by_document_narrows_aggregates_not_selection( "path, id_param, record_id", [ ("/biomarkers", "biomarker_id", "bmkr:12"), - ("/diseases", "disease_id", "dis:oncotree:ALL"), + ("/diseases", "disease_id", "dis:ncit:C3167"), ("/genes", "gene_id", "gene:hgnc:76"), ("/therapies", "therapy_id", "tx:ncit:C62528"), ], @@ -287,7 +287,7 @@ def test_id_parameter_returns_single_record( [ ("/agents", "agent_name", "Food and Drug Administration", "agent:org:fda"), ("/biomarkers", "biomarker_name", "BCR::ABL1", "bmkr:12"), - ("/diseases", "disease_name", "Acute Lymphoid Leukemia", "dis:oncotree:ALL"), + ("/diseases", "disease_name", "Acute Lymphoblastic Leukemia", "dis:ncit:C3167"), ("/genes", "gene_name", "BRAF", "gene:hgnc:1097"), ("/strengths", "strength_name", "Approval", "str:ncit:C25425"), ("/therapies", "therapy_name", "Imatinib", "tx:ncit:C62035"), @@ -355,6 +355,31 @@ def test_include_deprecated_returns_deprecated_records( assert [record["id"] for record in response.json()["data"]] == [deprecated_id] +@pytest.mark.parametrize( + "path, params", + [ + ("/documents", {"agent_id": "agent:org:fda"}), + ("/indications", {"agent_id": "agent:org:fda"}), + ("/statements", {"agent_id": "agent:org:fda", "gene": "BRAF"}), + ], +) +def test_agent_type_is_ignored_by_document_filters( + path: str, + params: dict[str, str], + client: fastapi.testclient.TestClient, +): + """ + Ensures agent_type, which is not a filter on these endpoints, does not change + their results, even alongside an agent filter that is. + """ + expected = client.get(path, params=params).json()["data"] + assert expected + + response = client.get(path, params={**params, "agent_type": "contributor"}) + assert response.status_code == 200 + assert [r["id"] for r in response.json()["data"]] == [r["id"] for r in expected] + + def test_contributions_include_records_lists_contributed_records( client: fastapi.testclient.TestClient, ): diff --git a/tests/test_roundtrip.py b/tests/test_roundtrip.py index 606a820..f81c977 100644 --- a/tests/test_roundtrip.py +++ b/tests/test_roundtrip.py @@ -1,5 +1,5 @@ """ -The SQLite database mirrors moalmanac-db/schemas/referenced: rebuilding each table +The SQLite database mirrors moalmanac_db/schemas/referenced: rebuilding each table from the database gives back referenced/.json exactly (record order, list order, values, and which keys are present; dict key order is not compared). """ diff --git a/update_submodule_to_commit.sh b/update_submodule_to_commit.sh index 4c072b3..2b49f11 100644 --- a/update_submodule_to_commit.sh +++ b/update_submodule_to_commit.sh @@ -1,7 +1,17 @@ #!/bin/bash -SUBMODULE_PATH=moalmanac-db +SUBMODULE_PATH=moalmanac_db COMMIT_HASH=$1 +# The Python used to regenerate docs/openapi.json; it needs this repo's requirements. +PYTHON=${PYTHON:-python} + +# docs/openapi.json is generated from the working tree, so uncommitted changes in +# app/ would end up in the committed spec without the code that produced them. +if [[ -n "$(git status --porcelain -- app/)" ]]; then + echo "app/ has uncommitted changes. Commit or stash them first, so docs/openapi.json" + echo "matches the committed code." + exit 1 +fi # Navigate to the submodule directory cd "$SUBMODULE_PATH" || { echo "Submodule path not found"; exit 1; } @@ -18,8 +28,16 @@ fi # Navigate back to the main repository cd - || exit -# Stage the submodule change -git add "$SUBMODULE_PATH" +# Regenerate the OpenAPI schema, whose response schemas and examples come from +# moalmanac-db, so it is committed together with the submodule update +"$PYTHON" utils/export_openapi.py || { + echo "Failed to export docs/openapi.json; nothing was committed. $SUBMODULE_PATH is" + echo "checked out at the new commit but not staged. Fix the error and rerun." + exit 1 +} + +# Stage the submodule change and the regenerated schema +git add "$SUBMODULE_PATH" docs/openapi.json # Commit the change if [[ -n "$COMMIT_HASH" ]]; then diff --git a/utils/export_openapi.py b/utils/export_openapi.py new file mode 100644 index 0000000..53336f3 --- /dev/null +++ b/utils/export_openapi.py @@ -0,0 +1,80 @@ +""" +Writes the API's OpenAPI schema to docs/openapi.json. + +The committed docs/openapi.json is what the documentation site renders, so it +must match the code. Regenerate it whenever routes, their docstrings or +parameters, or the moalmanac-db submodule change: + + python utils/export_openapi.py + +With `--check`, nothing is written; the script exits with status 1 if the +committed file is out of date. CI runs it this way. +""" + +import argparse +import importlib +import json +import os +import pathlib +import sys + +REPOSITORY_ROOT = pathlib.Path(__file__).resolve().parents[1] +OUTPUT_PATH = REPOSITORY_ROOT / "docs" / "openapi.json" + + +def main() -> int: + """ + Generates the OpenAPI schema and writes it, or checks it against the + committed file. + + Returns: + int: The exit status: 0 on success, 1 if `--check` found the committed + file out of date. + """ + parser = argparse.ArgumentParser(description=__doc__.strip().splitlines()[0]) + parser.add_argument( + "--check", + action="store_true", + help="Exit with status 1 if docs/openapi.json is out of date.", + ) + arguments = parser.parse_args() + + serialized = render_schema() + current = OUTPUT_PATH.read_text() if OUTPUT_PATH.exists() else None + + if arguments.check: + if serialized != current: + print( + f"{OUTPUT_PATH.relative_to(REPOSITORY_ROOT)} is out of date. Run " + "`python utils/export_openapi.py` and commit the result.", + file=sys.stderr, + ) + return 1 + print(f"{OUTPUT_PATH.relative_to(REPOSITORY_ROOT)} is up to date.") + return 0 + + OUTPUT_PATH.parent.mkdir(parents=True, exist_ok=True) + OUTPUT_PATH.write_text(serialized) + print(f"Wrote {OUTPUT_PATH.relative_to(REPOSITORY_ROOT)}.") + return 0 + + +def render_schema() -> str: + """ + Builds the application and serializes its OpenAPI schema. + + `app.main` creates the application when imported, reading `config.ini` from + the working directory, so this runs from the repository root. + + Returns: + str: The schema as indented JSON, ending with a newline. + """ + os.chdir(REPOSITORY_ROOT) + if str(REPOSITORY_ROOT) not in sys.path: + sys.path.insert(0, str(REPOSITORY_ROOT)) + application = importlib.import_module("app.main").app + return json.dumps(application.openapi(), indent=2, ensure_ascii=False) + "\n" + + +if __name__ == "__main__": + sys.exit(main())