{
  "openapi": "3.0.1",
  "info": {
    "title": "FireProtDB Backend API",
    "description": "FireProtDB Backend API",
    "version": "2.0.3"
  },
  "servers": [
    {
      "url": "https://loschmidt.chemi.muni.cz/fireprotdb"
    }
  ],
  "tags": [
    {
      "name": "1_search",
      "description": "The search endpoint + available domains."
    },
    {
      "name": "2_sequence",
      "description": "Data for the sequence page."
    },
    {
      "name": "3_mutant",
      "description": "Data for the mutant page."
    },
    {
      "name": "4_app",
      "description": "General endpoints for the application."
    }
  ],
  "paths": {
    "/api/sequences/{id}": {
      "get": {
        "tags": [
          "2_sequence"
        ],
        "operationId": "sequence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SequenceDetailEntry"
                }
              }
            }
          }
        }
      }
    },
    "/api/sequences/{id}/sequence": {
      "get": {
        "tags": [
          "2_sequence"
        ],
        "operationId": "rawSequence",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "tags": [
          "1_search"
        ],
        "operationId": "search",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchQuery"
                }
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "json"
            }
          },
          {
            "name": "inline",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Sort"
            }
          },
          {
            "name": "If-Modified-Since",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SearchEntry"
                  }
                }
              },
              "application/jsonlines": {
                "schema": {
                  "type": "string"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/tab-separated-values": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/mutants/{id}": {
      "get": {
        "tags": [
          "3_mutant"
        ],
        "operationId": "mutant",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MutantDetailEntry"
                }
              }
            }
          }
        }
      }
    },
    "/api/domains/protein-name": {
      "get": {
        "tags": [
          "1_search"
        ],
        "operationId": "proteinNameDomain",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/domains/organism": {
      "get": {
        "tags": [
          "1_search"
        ],
        "operationId": "organismDomain",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/domains/measure": {
      "get": {
        "tags": [
          "1_search"
        ],
        "operationId": "measureDomain",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/domains/interpro": {
      "get": {
        "tags": [
          "1_search"
        ],
        "operationId": "interproDomain",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/domains/dataset": {
      "get": {
        "tags": [
          "1_search"
        ],
        "operationId": "datasetDomain",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/app/types/protein-reference": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "proteinReferenceTypes",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/app/types/measurement": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "measurementTypes",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/app/types/experiment-annotation": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "experimentAnnotationTypes",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/app/statistics": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "statistics",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/StatisticsDTO"
                }
              }
            }
          }
        }
      }
    },
    "/api/app/state": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "appState",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AppState"
                }
              }
            }
          }
        }
      }
    },
    "/api/app/schemas/search-query": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "searchQuerySchemas",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/api/app/charts": {
      "get": {
        "tags": [
          "4_app"
        ],
        "operationId": "charts",
        "parameters": [
          {
            "name": "example",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ChartsDTO"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Author": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "orcid": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Experiment": {
        "required": [
          "annotations",
          "dataset",
          "id",
          "measurements"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "publication": {
            "$ref": "#/components/schemas/Publication"
          },
          "dataset": {
            "type": "string"
          },
          "measurements": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Measurement"
            }
          },
          "annotations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExperimentAnnotation"
            }
          }
        }
      },
      "ExperimentAnnotation": {
        "required": [
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "numValue": {
            "type": "number",
            "format": "double"
          },
          "strValue": {
            "type": "string"
          }
        }
      },
      "Measurement": {
        "required": [
          "datasets",
          "id",
          "type"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string"
          },
          "numValue": {
            "type": "number",
            "format": "double"
          },
          "strValue": {
            "type": "string"
          },
          "datasets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "references": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MeasurementReference"
            }
          }
        }
      },
      "MeasurementReference": {
        "required": [
          "accession",
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "accession": {
            "type": "string"
          }
        }
      },
      "Pocket": {
        "required": [
          "number",
          "residues",
          "spheres"
        ],
        "type": "object",
        "properties": {
          "number": {
            "type": "integer",
            "format": "int32"
          },
          "spheres": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Sphere"
            }
          },
          "residues": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "druggability": {
            "type": "number",
            "format": "double"
          },
          "relevance": {
            "type": "number",
            "format": "double"
          },
          "volume": {
            "type": "number",
            "format": "double"
          },
          "centerX": {
            "type": "number",
            "format": "double"
          },
          "centerY": {
            "type": "number",
            "format": "double"
          },
          "centerZ": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Protein": {
        "required": [
          "id",
          "references"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "organism": {
            "type": "string"
          },
          "references": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProteinReference"
            }
          }
        }
      },
      "ProteinLink": {
        "required": [
          "protein"
        ],
        "type": "object",
        "properties": {
          "protein": {
            "$ref": "#/components/schemas/Protein"
          },
          "isoform": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ProteinReference": {
        "required": [
          "accession",
          "type"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "accession": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "Publication": {
        "required": [
          "authors",
          "id",
          "type"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "journal": {
            "type": "string"
          },
          "year": {
            "type": "string"
          },
          "doi": {
            "type": "string"
          },
          "pmid": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "authors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Author"
            }
          }
        }
      },
      "Residue": {
        "required": [
          "aminoAcid",
          "chainName",
          "id",
          "insertionCode",
          "seqPosition",
          "structPosition"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "chainName": {
            "type": "string"
          },
          "structPosition": {
            "type": "integer",
            "format": "int32"
          },
          "insertionCode": {
            "type": "string"
          },
          "aminoAcid": {
            "type": "string"
          },
          "seqPosition": {
            "type": "integer",
            "format": "int32"
          },
          "asa": {
            "type": "number",
            "format": "double"
          },
          "secondaryStructure": {
            "type": "string"
          },
          "inTunnel": {
            "type": "boolean"
          },
          "inPocket": {
            "type": "boolean"
          },
          "bFactor": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "SequenceDetailEntry": {
        "required": [
          "experiments",
          "features",
          "id",
          "length",
          "proteinLinks",
          "sequence",
          "structures"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "length": {
            "type": "integer",
            "format": "int32"
          },
          "proteinLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProteinLink"
            }
          },
          "sequence": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SequenceFeature"
            }
          },
          "structures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Structure"
            }
          },
          "experiments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Experiment"
            }
          }
        }
      },
      "SequenceFeature": {
        "required": [
          "id",
          "type"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "positionRange": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "positionArray": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "numValue": {
            "type": "number",
            "format": "double"
          },
          "strValue": {
            "type": "string"
          }
        }
      },
      "Sphere": {
        "required": [
          "radius",
          "x",
          "y",
          "z"
        ],
        "type": "object",
        "properties": {
          "x": {
            "type": "number",
            "format": "double"
          },
          "y": {
            "type": "number",
            "format": "double"
          },
          "z": {
            "type": "number",
            "format": "double"
          },
          "radius": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Structure": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "wwpdb": {
            "type": "string"
          },
          "afdb": {
            "type": "string"
          },
          "method": {
            "type": "string"
          },
          "resolution": {
            "type": "number",
            "format": "double"
          },
          "residues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Residue"
            }
          },
          "tunnels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tunnel"
            }
          },
          "pockets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Pocket"
            }
          }
        }
      },
      "Tunnel": {
        "required": [
          "number",
          "residues",
          "spheres"
        ],
        "type": "object",
        "properties": {
          "number": {
            "type": "integer",
            "format": "int32"
          },
          "spheres": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Sphere"
            }
          },
          "residues": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "curvature": {
            "type": "number",
            "format": "double"
          },
          "distanceToSurface": {
            "type": "number",
            "format": "double"
          },
          "length": {
            "type": "number",
            "format": "double"
          },
          "throughput": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "Sort": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "Deletion": {
        "required": [
          "aminoAcids",
          "position"
        ],
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "aminoAcids": {
            "type": "string"
          }
        }
      },
      "Insertion": {
        "required": [
          "aminoAcids",
          "position"
        ],
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "aminoAcids": {
            "type": "string"
          }
        }
      },
      "MutantSearchEntry": {
        "required": [
          "experiment",
          "features",
          "id",
          "sourceSequence",
          "structures",
          "targetSequence"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "substitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Substitution"
            }
          },
          "insertions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Insertion"
            }
          },
          "deletions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deletion"
            }
          },
          "sourceSequence": {
            "$ref": "#/components/schemas/SequenceBaseEntry"
          },
          "targetSequence": {
            "$ref": "#/components/schemas/SequenceBaseEntry"
          },
          "structures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Structure"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SequenceFeature"
            }
          },
          "experiment": {
            "$ref": "#/components/schemas/Experiment"
          }
        }
      },
      "SearchEntry": {
        "type": "object",
        "properties": {
          "sequence": {
            "$ref": "#/components/schemas/SequenceSearchEntry"
          },
          "mutant": {
            "$ref": "#/components/schemas/MutantSearchEntry"
          }
        }
      },
      "SequenceBaseEntry": {
        "required": [
          "id",
          "length",
          "proteinLinks"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "length": {
            "type": "integer",
            "format": "int32"
          },
          "proteinLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProteinLink"
            }
          }
        }
      },
      "SequenceSearchEntry": {
        "required": [
          "experiment",
          "id",
          "length",
          "proteinLinks",
          "structures"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "length": {
            "type": "integer",
            "format": "int32"
          },
          "proteinLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProteinLink"
            }
          },
          "experiment": {
            "$ref": "#/components/schemas/Experiment"
          },
          "structures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Structure"
            }
          }
        }
      },
      "Substitution": {
        "required": [
          "position",
          "sourceAa",
          "targetAa"
        ],
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "sourceAa": {
            "type": "string"
          },
          "targetAa": {
            "type": "string"
          }
        }
      },
      "MutantDetailEntry": {
        "required": [
          "experiments",
          "features",
          "id",
          "sourceSequence",
          "structures",
          "targetSequence"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "substitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Substitution"
            }
          },
          "insertions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Insertion"
            }
          },
          "deletions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Deletion"
            }
          },
          "sourceSequence": {
            "$ref": "#/components/schemas/SequenceBaseEntry"
          },
          "targetSequence": {
            "$ref": "#/components/schemas/SequenceBaseEntry"
          },
          "structures": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Structure"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SequenceFeature"
            }
          },
          "experiments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Experiment"
            }
          }
        }
      },
      "StatisticsDTO": {
        "required": [
          "experiments",
          "mutants",
          "proteins",
          "structures",
          "updated"
        ],
        "type": "object",
        "properties": {
          "experiments": {
            "type": "integer",
            "format": "int32"
          },
          "mutants": {
            "type": "integer",
            "format": "int32"
          },
          "proteins": {
            "type": "integer",
            "format": "int32"
          },
          "structures": {
            "type": "integer",
            "format": "int32"
          },
          "updated": {
            "type": "string"
          }
        }
      },
      "AppState": {
        "required": [
          "version"
        ],
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "visitors": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "AminoAcidsSubstitution": {
        "required": [
          "aminoAcid",
          "fromSubstitutions",
          "toSubstitutions"
        ],
        "type": "object",
        "properties": {
          "aminoAcid": {
            "type": "string"
          },
          "toSubstitutions": {
            "type": "integer",
            "format": "int32"
          },
          "fromSubstitutions": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "ChartsDTO": {
        "required": [
          "aminoAcidsSubstitutions",
          "aminoAcidsSubstitutionsMap",
          "aminoAcidsSubstitutionsReducedMap",
          "ddgHistogram",
          "dtmHistogram",
          "topFamilies",
          "topProteins",
          "wildTypeChargeSubstitutions",
          "wildTypeHydropathySubstitutions",
          "wildTypePolaritySubstitutions",
          "wildTypeVolumeSubstitutions"
        ],
        "type": "object",
        "properties": {
          "topProteins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopProteins"
            }
          },
          "topFamilies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopInterProFamilies"
            }
          },
          "ddgHistogram": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DdgHistogramEntry"
            }
          },
          "dtmHistogram": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DtmHistogramEntry"
            }
          },
          "aminoAcidsSubstitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AminoAcidsSubstitution"
            }
          },
          "aminoAcidsSubstitutionsMap": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WildTypeSubstitution"
            }
          },
          "aminoAcidsSubstitutionsReducedMap": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WildTypeSubstitution"
            }
          },
          "wildTypeChargeSubstitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WildTypeSubstitution"
            }
          },
          "wildTypePolaritySubstitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WildTypeSubstitution"
            }
          },
          "wildTypeVolumeSubstitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WildTypeSubstitution"
            }
          },
          "wildTypeHydropathySubstitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WildTypeSubstitution"
            }
          }
        }
      },
      "DdgHistogramEntry": {
        "required": [
          "count",
          "id",
          "intervalMax",
          "intervalMin"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "intervalMin": {
            "type": "string"
          },
          "intervalMax": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "DtmHistogramEntry": {
        "required": [
          "count",
          "id",
          "intervalMax",
          "intervalMin"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "intervalMin": {
            "type": "string"
          },
          "intervalMax": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "TopInterProFamilies": {
        "required": [
          "experimentsCount",
          "familyName",
          "id",
          "percentageCoverage"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "familyName": {
            "type": "string"
          },
          "experimentsCount": {
            "type": "integer",
            "format": "int32"
          },
          "percentageCoverage": {
            "type": "number"
          }
        }
      },
      "TopProteins": {
        "required": [
          "experimentsCount",
          "id",
          "percentageCoverage",
          "proteinName"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "proteinName": {
            "type": "string"
          },
          "experimentsCount": {
            "type": "integer",
            "format": "int32"
          },
          "percentageCoverage": {
            "type": "number"
          }
        }
      },
      "WildTypeSubstitution": {
        "required": [
          "counts",
          "from"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "Node": {
        "title": "Node",
        "description": "General node representing a tree and its subtrees.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AndOrNode"
          },
          {
            "$ref": "#/components/schemas/NotNode"
          },
          {
            "$ref": "#/components/schemas/ArrayNode"
          },
          {
            "$ref": "#/components/schemas/ScalarNode"
          }
        ]
      },
      "NotNode": {
        "title": "NotNode",
        "type": "object",
        "properties": {
          "operator": {
            "title": "NotOperator",
            "type": "string",
            "enum": [
              "NOT"
            ]
          },
          "children": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "$ref": "#/components/schemas/Node"
            }
          }
        },
        "required": [
          "operator",
          "children"
        ],
        "additionalProperties": false
      },
      "AndOrNode": {
        "title": "AndOrNode",
        "type": "object",
        "properties": {
          "operator": {
            "title": "AndOrOperator",
            "type": "string",
            "enum": [
              "AND",
              "OR"
            ]
          },
          "children": {
            "type": "array",
            "minItems": 2,
            "items": {
              "$ref": "#/components/schemas/Node"
            }
          }
        },
        "required": [
          "operator",
          "children"
        ],
        "additionalProperties": false
      },
      "SearchQuery": {
        "title": "SearchQuery",
        "description": "Search query: an expression tree or fulltext.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "tree": {
                "$ref": "#/components/schemas/Node"
              }
            },
            "required": [
              "tree"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "fulltext": {
                "type": "string"
              }
            },
            "required": [
              "fulltext"
            ],
            "additionalProperties": false
          }
        ]
      },
      "IsEmptyOperator": {
        "title": "IsEmptyOperator",
        "description": "IS_EMPTY operator.",
        "type": "string",
        "enum": [
          "IS_EMPTY"
        ]
      },
      "ComparisonOperator": {
        "title": "ComparisonOperator",
        "oneOf": [
          {
            "title": "GreaterLessOperator",
            "description": "Operators >, >=, <, <= able to compare: 1) number variable to number value, and 2) number array to number value with (implicit or explicit) quantifier.",
            "type": "string",
            "enum": [
              "GREATER_THAN",
              "GREATER_THAN_OR_EQUAL_TO",
              "LESS_THAN",
              "LESS_THAN_OR_EQUAL_TO"
            ]
          },
          {
            "$ref": "#/components/schemas/EqualityOperator"
          }
        ]
      },
      "EqualityOperator": {
        "title": "EqualityOperator",
        "description": "Equality operators able to compare: 1) scalar variable to scalar value, 2) array variable to scalar value with (implicit or explicit) quantifier, and 3) array variable to array value.",
        "type": "string",
        "enum": [
          "EQUAL_TO"
        ]
      },
      "NumberNode": {
        "title": "NumberNode",
        "description": "Expression: Number variable meets a condition.",
        "type": "object",
        "properties": {
          "variable": {
            "$ref": "#/components/schemas/NumberVariable"
          },
          "operator": {
            "$ref": "#/components/schemas/ComparisonOperator"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "variable",
          "operator",
          "value"
        ],
        "additionalProperties": false
      },
      "StringVariable": {
        "title": "StringVariable",
        "description": "Variables with type: string.",
        "type": "string",
        "enum": [
          "SEQUENCE"
        ]
      },
      "ScalarNode": {
        "title": "ScalarNode",
        "description": "Expression: Scalar (string, number, or boolean) variable meets a condition.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/StringNode"
          },
          {
            "$ref": "#/components/schemas/NumberNode"
          },
          {
            "$ref": "#/components/schemas/BooleanNode"
          },
          {
            "type": "object",
            "properties": {
              "variable": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/StringVariable"
                  },
                  {
                    "$ref": "#/components/schemas/NumberVariable"
                  }
                ]
              },
              "operator": {
                "$ref": "#/components/schemas/IsEmptyOperator"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "variable",
              "operator",
              "value"
            ],
            "additionalProperties": false
          }
        ]
      },
      "NumberVariable": {
        "title": "NumberVariable",
        "description": "Variables with type: number.",
        "type": "string",
        "enum": [
          "SOURCE_SEQUENCE_ID",
          "SEQUENCE_LENGTH"
        ]
      },
      "BooleanNode": {
        "title": "BooleanNode",
        "description": "Expression: Boolean variable meets a condition.",
        "type": "object",
        "properties": {
          "variable": {
            "$ref": "#/components/schemas/BooleanVariable"
          },
          "operator": {
            "$ref": "#/components/schemas/EqualityOperator"
          },
          "value": {
            "type": "boolean"
          }
        },
        "required": [
          "variable",
          "operator",
          "value"
        ],
        "additionalProperties": false
      },
      "BooleanVariable": {
        "title": "BooleanVariable",
        "description": "Variables with type: boolean.",
        "type": "string",
        "enum": [
          "IN_TUNNEL",
          "IN_POCKET"
        ]
      },
      "StringNode": {
        "title": "StringNode",
        "description": "Expression: String variable meets a condition.",
        "type": "object",
        "properties": {
          "variable": {
            "$ref": "#/components/schemas/StringVariable"
          },
          "operator": {
            "$ref": "#/components/schemas/EqualityOperator"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "variable",
          "operator",
          "value"
        ],
        "additionalProperties": false
      },
      "ArrayStringNode": {
        "title": "ArrayStringNode",
        "description": "Expression: ANY item / ALL items in an array meet a condition. Quantifier is optional, the default quantifier is ANY.",
        "type": "object",
        "properties": {
          "variable": {
            "$ref": "#/components/schemas/ArrayStringVariable"
          },
          "operator": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EqualityOperator"
              }
            ]
          },
          "quantifier": {
            "$ref": "#/components/schemas/Quantifier"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "variable",
          "operator",
          "value"
        ],
        "additionalProperties": false
      },
      "Quantifier": {
        "title": "Quantifier",
        "type": "string",
        "enum": [
          "ANY",
          "ALL"
        ],
        "default": "ANY"
      },
      "ArrayNumberVariable": {
        "title": "ArrayNumberVariable",
        "description": "Variables with type: array of numbers.",
        "type": "string",
        "enum": [
          "MUTATED_POSITION",
          "CONSERVATION",
          "B_FACTOR",
          "DG",
          "DDG",
          "DOMAINOME_DDG",
          "DOMAINOME_FITNESS",
          "TM",
          "DTM",
          "PH"
        ]
      },
      "ArrayNode": {
        "title": "ArrayNode",
        "description": "Expression: Array (of strings or numbers) variable meets a condition.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/ArrayStringNode"
          },
          {
            "$ref": "#/components/schemas/ArrayNumberNode"
          },
          {
            "type": "object",
            "properties": {
              "variable": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ArrayStringVariable"
                  },
                  {
                    "$ref": "#/components/schemas/ArrayNumberVariable"
                  }
                ]
              },
              "operator": {
                "$ref": "#/components/schemas/IsEmptyOperator"
              },
              "value": {
                "type": "boolean"
              }
            },
            "required": [
              "variable",
              "operator",
              "value"
            ],
            "additionalProperties": false
          }
        ]
      },
      "ArrayNumberNode": {
        "title": "ArrayNumberNode",
        "description": "Expression: ANY item / ALL items in an array meet a condition. Quantifier is optional, the default quantifier is ANY.",
        "type": "object",
        "properties": {
          "variable": {
            "$ref": "#/components/schemas/ArrayNumberVariable"
          },
          "operator": {
            "$ref": "#/components/schemas/ComparisonOperator"
          },
          "quantifier": {
            "$ref": "#/components/schemas/Quantifier"
          },
          "value": {
            "type": "number"
          }
        },
        "required": [
          "variable",
          "operator",
          "value"
        ],
        "additionalProperties": false
      },
      "ArrayStringVariable": {
        "title": "ArrayStringVariable",
        "description": "Variables with type: array of strings.",
        "type": "string",
        "enum": [
          "MUTATION_TYPE",
          "SOURCE_AMINO_ACID",
          "TARGET_AMINO_ACID",
          "ACTIVE_SITE",
          "BINDING_SITE",
          "PROTEIN_NAME",
          "ORGANISM",
          "EC_NUMBER",
          "UNIPROTKB",
          "INTERPRO",
          "PUBLICATION_DOI_PMID",
          "DATASET",
          "WWPDB",
          "MEASURE"
        ]
      }
    }
  }
}