openapi: 3.0.3

servers:
  - url: https://grch38.togovar.org/api

info:
  title: TogoVar API
  version: "0.9.1"
  description: TogoVar API version 0.9.1 specification

paths:
  /search/variant:
    post:
      tags:
        - search
      parameters:
        - $ref: '#/components/parameters/Pretty'
        - $ref: '#/components/parameters/Stat'
        - $ref: '#/components/parameters/Data'
      requestBody:
        $ref: '#/components/requestBodies/SearchVariant'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchVariant'
        '400':
          $ref: '#/components/responses/bad_request'
        '500':
          $ref: '#/components/responses/internal_server_error'
        '501':
          $ref: '#/components/responses/not_implemented'

  /search/gene:
    get:
      tags:
        - search
      parameters:
        - $ref: '#/components/parameters/Pretty'
        - $ref: '#/components/parameters/GeneTerm'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchGene'
        '400':
          description: >
            `Bad Request`<br/>
            Your query contains grammatical mistakes. See errors in the response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            `Internal Server Error`<br/>
            Unexpected errors occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: >
            `Not Implemented`<br/>
            Responder for given mime type are not implemented.
            Provide the correct accept header (e.g. `Accept: application/json`).
          content:
            text/plain:
              schema:
                type: string
                example: Not implemented
    post:
      tags:
        - search
      parameters:
        - $ref: '#/components/parameters/Pretty'
      requestBody:
        $ref: '#/components/requestBodies/SearchGene'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchGene'
        '400':
          description: >
            `Bad Request`<br/>
            Your query contains grammatical mistakes. See errors in the response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            `Internal Server Error`<br/>
            Unexpected errors occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: >
            `Not Implemented`<br/>
            Responder for given mime type are not implemented.
            Provide the correct accept header (e.g. `Accept: application/json`).
          content:
            text/plain:
              schema:
                type: string
                example: Not implemented

  /search/disease:
    get:
      tags:
        - search
      parameters:
        - $ref: '#/components/parameters/Pretty'
        - $ref: '#/components/parameters/DiseaseTerm'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchDisease'
        '400':
          description: >
            `Bad Request`<br/>
            Your query contains grammatical mistakes. See errors in the response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            `Internal Server Error`<br/>
            Unexpected errors occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: >
            `Not Implemented`<br/>
            Responder for given mime type are not implemented.
            Provide the correct accept header (e.g. `Accept: application/json`).
          content:
            text/plain:
              schema:
                type: string
                example: Not implemented
    post:
      tags:
        - search
      parameters:
        - $ref: '#/components/parameters/Pretty'
      requestBody:
        $ref: '#/components/requestBodies/SearchDisease'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchDisease'
        '400':
          description: >
            `Bad Request`<br/>
            Your query contains grammatical mistakes. See errors in the response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            `Internal Server Error`<br/>
            Unexpected errors occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: >
            `Not Implemented`<br/>
            Responder for given mime type are not implemented.
            Provide the correct accept header (e.g. `Accept: application/json`).
          content:
            text/plain:
              schema:
                type: string
                example: Not implemented

  /inspect/disease:
    get:
      tags:
        - inspect
      parameters:
        - $ref: '#/components/parameters/Pretty'
        - $ref: '#/components/parameters/DiseaseMondo'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InspectDisease'
        '400':
          description: >
            `Bad Request`<br/>
            Your query contains grammatical mistakes. See errors in the response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            `Internal Server Error`<br/>
            Unexpected errors occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: >
            `Not Implemented`<br/>
            Responder for given mime type are not implemented.
            Provide the correct accept header (e.g. `Accept: application/json`).
          content:
            text/plain:
              schema:
                type: string
                example: Not implemented
    post:
      tags:
        - inspect
      parameters:
        - $ref: '#/components/parameters/Pretty'
      requestBody:
        $ref: '#/components/requestBodies/InspectDisease'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InspectDisease'
        '400':
          description: >
            `Bad Request`<br/>
            Your query contains grammatical mistakes. See errors in the response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >
            `Internal Server Error`<br/>
            Unexpected errors occurred.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '501':
          description: >
            `Not Implemented`<br/>
            Responder for given mime type are not implemented.
            Provide the correct accept header (e.g. `Accept: application/json`).
          content:
            text/plain:
              schema:
                type: string
                example: Not implemented

  /download/variant:
    post:
      tags:
        - download
      requestBody:
        $ref: '#/components/requestBodies/SearchVariant'
      responses:
        '200':
          description: >
            `OK`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DownloadVariant'
            text/csv:
              schema:
                type: string
            text/plain:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/bad_request'
        '500':
          $ref: '#/components/responses/internal_server_error'
        '501':
          $ref: '#/components/responses/not_implemented'

components:
  parameters:
    Pretty:
      in: query
      name: pretty
      description: If set, response body will be nicely formatted.
      schema:
        type: boolean
        nullable: true

    Stat:
      in: query
      name: stat
      description: If set to `0`, do not collect statistics
      schema:
        type: integer
        nullable: true
        enum:
          - 1
          - 0

    Data:
      in: query
      name: data
      description: If set to `0`, do not return result records
      schema:
        type: integer
        nullable: true
        enum:
          - 1
          - 0

    GeneTerm:
      in: query
      name: term
      description: A term to search
      schema:
        type: string
      required: true
      example: ALDH2

    DiseaseTerm:
      in: query
      name: term
      description: A term to search
      schema:
        type: string
      required: true
      example: breast ovarian cancer

    DiseaseMondo:
      in: query
      name: node
      description: A node ID
      schema:
        type: string
      required: false
      example: MONDO_0003582

  requestBodies:
    SearchVariant:
      description: Schema for searching variant
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            properties:
              version:
                type: string
                description: (Optional) Set version number if you would like to use old version.
                enum:
                  - "1"
              formatter:
                type: string
                description: (Optional) Formatter for response data.
                enum:
                  - "html"
              query:
                oneOf:
                  - $ref: '#/components/schemas/ID'
                  - $ref: '#/components/schemas/Location'
                  - $ref: '#/components/schemas/VariantType'
                  - $ref: '#/components/schemas/VariantConsequence'
                  - $ref: '#/components/schemas/VariantFrequency'
                  - $ref: '#/components/schemas/ClinicalSignificance'
                  - $ref: '#/components/schemas/Sift'
                  - $ref: '#/components/schemas/Polyphen'
                  - $ref: '#/components/schemas/AlphaMissense'
                  - $ref: '#/components/schemas/Gene'
                  - $ref: '#/components/schemas/Disease'
                  - $ref: '#/components/schemas/And'
                  - $ref: '#/components/schemas/Or'
              limit:
                type: integer
                description: (Optional) Default is 100.
                minimum: 0
                maximum: 1000
              offset:
                oneOf:
                  - type: integer
                    minimum: 0
                    maximum: 10000
                  - type: array
                    description: >
                      Set [{chromosome}, {position}, {reference}, {alternative}] in case you would like to
                      paginate over 10,000 records. {reference} and {alternative} can be omitted.
                    minItems: 2
                    maxItems: 4
              column:
                type: array
                description: >
                  This option is only valid for the download API.
                items:
                  type: string
                  enum:
                    - id
                    - rs
                    - position
                    - ref_alt
                    - type
                    - gene
                    - frequency
                    - consequence
                    - condition
                    - sift
                    - polyphen
                    - alphamissense

          examples:
            Example1:
              $ref: '#/components/examples/SearchVariant-1'
            Example2:
              $ref: '#/components/examples/SearchVariant-2'
            Example3:
              $ref: '#/components/examples/SearchVariant-3'
            Example4:
              $ref: '#/components/examples/SearchVariant-4'
            Example5:
              $ref: '#/components/examples/SearchVariant-5'
            Example6:
              $ref: '#/components/examples/SearchVariant-6'
            Example7:
              $ref: '#/components/examples/SearchVariant-7'
            Example8:
              $ref: '#/components/examples/SearchVariant-8'
            Example9:
              $ref: '#/components/examples/SearchVariant-9'
            Example10:
              $ref: '#/components/examples/SearchVariant-10'
            Example11:
              $ref: '#/components/examples/SearchVariant-11'

    SearchGene:
      description: Schema for searching gene
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            properties:
              term:
                type: string
                description: A term to search
                example: ALDH2
            required:
              - term

    SearchDisease:
      description: Schema for searching disease
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            properties:
              term:
                type: string
                description: A term to search
                example: breast ovarian cancer
            required:
              - term

    InspectDisease:
      description: Schema for inspecting disease
      content:
        application/json:
          schema:
            type: object
            additionalProperties: false
            properties:
              node:
                type: string
                description: A node ID
                example: MONDO_0003582

  responses:
    bad_request:
      description: >
        `Bad Request`<br/>
        Your query contains grammatical mistakes. See errors in the response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    internal_server_error:
      description: >
        `Internal Server Error`<br/>
        Unexpected errors occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    not_implemented:
      description: >
        `Not Implemented`<br/>
        Responder for given mime type are not implemented.
        Provide the correct accept header (e.g. `Accept: application/json`).
      content:
        text/plain:
          schema:
            type: string
            example: Not implemented

  schemas:
    ID:
      type: object
      additionalProperties: false
      required:
        - id
      properties:
        id:
          type: array
          items:
            type: string
            description: tgv ID

    Location:
      type: object
      additionalProperties: false
      required:
        - location
      properties:
        location:
          type: object
          additionalProperties: false
          required:
            - chromosome
            - position
          properties:
            chromosome:
              type: string
              description: chromosome name
              enum:
                - "1"
                - "2"
                - "3"
                - "4"
                - "5"
                - "6"
                - "7"
                - "8"
                - "9"
                - "10"
                - "11"
                - "12"
                - "13"
                - "14"
                - "15"
                - "16"
                - "17"
                - "18"
                - "19"
                - "20"
                - "21"
                - "22"
                - X
                - Y
                - MT
            position:
              oneOf:
                - type: integer
                - $ref: '#/components/schemas/Range'

    VariantType:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: object
          additionalProperties: false
          required:
            - relation
            - terms
          properties:
            relation:
              type: string
              description: >
                Available values
                 * `eq` - Equals to any of term in the list
                 * `ne` - Not equals to all of term in the list
              enum:
                - eq
                - ne

            terms:
              type: array
              items:
                type: string
                description: >
                  Available values
                  
                  * `SO_0001483` - SNV
                  
                  * `SO_0000667` - Insertion
                  
                  * `SO_0000159` - Deletion
                  
                  * `SO_1000032` - Indel
                  
                  * `SO_1000002` - Substitution
                  
                enum:
                  
                  - SO_0001483
                  
                  - SO_0000667
                  
                  - SO_0000159
                  
                  - SO_1000032
                  
                  - SO_1000002
                  
                  - snv
                  - ins
                  - del
                  - indel
                  - sub

    VariantConsequence:
      type: object
      additionalProperties: false
      required:
        - consequence
      properties:
        consequence:
          type: object
          additionalProperties: false
          required:
            - relation
            - terms
          properties:
            relation:
              type: string
              description: >
                Available values
                 * `eq` - Equals to any of term in the list
                 * `ne` - Not equals to all of term in the list
              enum:
                - eq
                - ne

            terms:
              type: array
              items:
                type: string
                description: >
                  Both SO terms and its label are acceptable
                  
                  * `SO_0001893` - Transcript ablation
                  
                  * `SO_0001574` - Splice acceptor variant
                  
                  * `SO_0001575` - Splice donor variant
                  
                  * `SO_0001587` - Stop gained
                  
                  * `SO_0001589` - Frameshift variant
                  
                  * `SO_0001578` - Stop lost
                  
                  * `SO_0002012` - Start lost
                  
                  * `SO_0001889` - Transcript amplification
                  
                  * `SO_0001821` - Inframe insertion
                  
                  * `SO_0001822` - Inframe deletion
                  
                  * `SO_0001583` - Missense variant
                  
                  * `SO_0001818` - Protein altering variant
                  
                  * `SO_0001630` - Splice region variant
                  
                  * `SO_0001626` - Incomplete terminal codon variant
                  
                  * `SO_0002019` - Start retained variant
                  
                  * `SO_0001567` - Stop retained variant
                  
                  * `SO_0001819` - Synonymous variant
                  
                  * `SO_0001580` - Coding sequence variant
                  
                  * `SO_0001620` - Mature miRNA variant
                  
                  * `SO_0001623` - 5 prime UTR variant
                  
                  * `SO_0001624` - 3 prime UTR variant
                  
                  * `SO_0001792` - Non coding transcript exon variant
                  
                  * `SO_0001627` - Intron variant
                  
                  * `SO_0001621` - NMD transcript variant
                  
                  * `SO_0001619` - Non coding transcript variant
                  
                  * `SO_0001631` - Upstream gene variant
                  
                  * `SO_0001632` - Downstream gene variant
                  
                  * `SO_0001895` - TFBS ablation
                  
                  * `SO_0001892` - TFBS amplification
                  
                  * `SO_0001782` - TF binding site variant
                  
                  * `SO_0001894` - Regulatory region ablation
                  
                  * `SO_0001891` - Regulatory region amplification
                  
                  * `SO_0001907` - Feature elongation
                  
                  * `SO_0001566` - Regulatory region variant
                  
                  * `SO_0001906` - Feature truncation
                  
                  * `SO_0001628` - Intergenic variant
                  

                  see [this documentation](https://ensembl.org/info/genome/variation/prediction/predicted_data.html) for details

                enum:
                  
                  - SO_0001893
                  
                  - SO_0001574
                  
                  - SO_0001575
                  
                  - SO_0001587
                  
                  - SO_0001589
                  
                  - SO_0001578
                  
                  - SO_0002012
                  
                  - SO_0001889
                  
                  - SO_0001821
                  
                  - SO_0001822
                  
                  - SO_0001583
                  
                  - SO_0001818
                  
                  - SO_0001630
                  
                  - SO_0001626
                  
                  - SO_0002019
                  
                  - SO_0001567
                  
                  - SO_0001819
                  
                  - SO_0001580
                  
                  - SO_0001620
                  
                  - SO_0001623
                  
                  - SO_0001624
                  
                  - SO_0001792
                  
                  - SO_0001627
                  
                  - SO_0001621
                  
                  - SO_0001619
                  
                  - SO_0001631
                  
                  - SO_0001632
                  
                  - SO_0001895
                  
                  - SO_0001892
                  
                  - SO_0001782
                  
                  - SO_0001894
                  
                  - SO_0001891
                  
                  - SO_0001907
                  
                  - SO_0001566
                  
                  - SO_0001906
                  
                  - SO_0001628
                  
                  - transcript_ablation
                  - splice_acceptor_variant
                  - splice_donor_variant
                  - stop_gained
                  - frameshift_variant
                  - stop_lost
                  - start_lost
                  - transcript_amplification
                  - inframe_insertion
                  - inframe_deletion
                  - missense_variant
                  - protein_altering_variant
                  - splice_region_variant
                  - incomplete_terminal_codon_variant
                  - start_retained_variant
                  - stop_retained_variant
                  - synonymous_variant
                  - coding_sequence_variant
                  - mature_miRNA_variant
                  - 5_prime_UTR_variant
                  - 3_prime_UTR_variant
                  - non_coding_transcript_exon_variant
                  - intron_variant
                  - NMD_transcript_variant
                  - non_coding_transcript_variant
                  - upstream_gene_variant
                  - downstream_gene_variant
                  - TFBS_ablation
                  - TFBS_amplification
                  - TF_binding_site_variant
                  - regulatory_region_ablation
                  - regulatory_region_amplification
                  - feature_elongation
                  - regulatory_region_variant
                  - feature_truncation
                  - intergenic_variant

    VariantFrequency:
      type: object
      additionalProperties: false
      required:
        - frequency
      properties:
        frequency:
          type: object
          additionalProperties: false
          required:
            - frequency
          oneOf:
            - type: object
              additionalProperties: false
              required:
                - frequency
              properties:
                dataset:
                  $ref: '#/components/schemas/Dataset'
                frequency:
                  $ref: '#/components/schemas/Range'
                filtered:
                  type: boolean
                  description: if `true`, exclude variants with a FILTER flag other than PASS

            - type: object
              additionalProperties: false
              required:
                - count
              properties:
                dataset:
                  $ref: '#/components/schemas/Dataset'
                count:
                  $ref: '#/components/schemas/Range'
                filtered:
                  type: boolean
                  description: if `true`, exclude variants with a FILTER flag other than PASS

    ClinicalSignificance:
      type: object
      additionalProperties: false
      required:
        - significance
      properties:
        significance:
          type: object
          additionalProperties: false
          required:
            - relation
            - terms
          properties:
            relation:
              type: string
              description: >
                Available values
                 * `eq` - Equals to any of term in the list
                 * `ne` - Not equals to all of term in the list
              enum:
                - eq
                - ne

            terms:
              type: array
              items:
                type: string
                description: >
                  Both short keys and its label are acceptable
                  
                  * `NC` - Not in ClinVar
                  
                  * `P` - Pathogenic
                  
                  * `PLP` - Pathogenic, low penetrance
                  
                  * `LP` - Likely pathogenic
                  
                  * `LPLP` - Likely pathogenic, low penetrance
                  
                  * `DR` - Drug response
                  
                  * `ERA` - Established risk allele
                  
                  * `LRA` - Likely risk allele
                  
                  * `URA` - Uncertain risk allele
                  
                  * `CS` - Confers sensitivity
                  
                  * `A` - Association
                  
                  * `RF` - Risk factor
                  
                  * `AF` - Affects
                  
                  * `PR` - Protective
                  
                  * `B` - Benign
                  
                  * `LB` - Likely benign
                  
                  * `CI` - Conflicting interpretations of pathogenicity
                  
                  * `AN` - Association not found
                  
                  * `O` - Other
                  
                  * `US` - Uncertain significance
                  
                  * `NP` - Not provided
                  
                enum:
                  
                  - NC
                  
                  - P
                  
                  - PLP
                  
                  - LP
                  
                  - LPLP
                  
                  - DR
                  
                  - ERA
                  
                  - LRA
                  
                  - URA
                  
                  - CS
                  
                  - A
                  
                  - RF
                  
                  - AF
                  
                  - PR
                  
                  - B
                  
                  - LB
                  
                  - CI
                  
                  - AN
                  
                  - O
                  
                  - US
                  
                  - NP
                  
                  
                  - not_in_clinvar
                  
                  - pathogenic
                  
                  - pathogenic_low_penetrance
                  
                  - likely_pathogenic
                  
                  - likely_pathogenic_low_penetrance
                  
                  - drug_response
                  
                  - established_risk_allele
                  
                  - likely_risk_allele
                  
                  - uncertain_risk_allele
                  
                  - confers_sensitivity
                  
                  - association
                  
                  - risk_factor
                  
                  - affects
                  
                  - protective
                  
                  - benign
                  
                  - likely_benign
                  
                  - conflicting_interpretations_of_pathogenicity
                  
                  - association_not_found
                  
                  - other
                  
                  - uncertain_significance
                  
                  - not_provided
                  

            source:
              type: array
              items:
                type: string
                description: >
                  Available values
                  
                  * `clinvar` - [Clinical significance of variants](https://ftp.ncbi.nlm.nih.gov/pub/clinvar/)
                  
                  * `mgend` - [Clinical significance of variants](https://mgend.ncgm.go.jp)
                  
                enum:
                  
                  - clinvar
                  
                  - mgend
                  

    Sift:
      type: object
      additionalProperties: false
      required:
        - sift
      properties:
        sift:
          type: object
          additionalProperties: false
          required:
            - score
          properties:
            score:
              oneOf:
                - $ref: '#/components/schemas/Range'
                - title: Terms
                  type: array
                  items:
                    type: string
                    description: >
                      Available values
                       * `unassigned`
                    enum:
                      - unassigned

    Polyphen:
      type: object
      additionalProperties: false
      required:
        - polyphen
      properties:
        polyphen:
          type: object
          additionalProperties: false
          required:
            - score
          properties:
            score:
              oneOf:
                - $ref: '#/components/schemas/Range'
                - title: Terms
                  type: array
                  items:
                    type: string
                    description: >
                      Available values
                       * `unassigned`
                       * `unknown`
                    enum:
                      - unassigned
                      - unknown

    AlphaMissense:
      type: object
      additionalProperties: false
      required:
        - alphamissense
      properties:
        alphamissense:
          type: object
          additionalProperties: false
          required:
            - score
          properties:
            score:
              oneOf:
                - $ref: '#/components/schemas/Range'
                - title: Terms
                  type: array
                  items:
                    type: string
                    description: >
                      Available values
                       * `unassigned`
                    enum:
                      - unassigned

    Gene:
      type: object
      additionalProperties: false
      required:
        - gene
      properties:
        gene:
          type: object
          additionalProperties: false
          required:
            - relation
            - terms
          properties:
            relation:
              type: string
              description: >
                Available values
                 * `eq` - Equals to any of term in the list
                 * `ne` - Not equals to all of term in the list
              enum:
                - eq
                - ne

            terms:
              type: array
              items:
                type: integer
                description: HGNC ID

    Disease:
      type: object
      additionalProperties: false
      required:
        - disease
      properties:
        disease:
          type: object
          additionalProperties: false
          required:
            - relation
            - terms
          properties:
            relation:
              type: string
              description: >
                Available values
                 * `eq` - Equals to any of term in the list
                 * `ne` - Not equals to all of term in the list
              enum:
                - eq
                - ne
            terms:
              type: array
              items:
                type: string
                description: MedGen ID or Mondo ID
            sub_concepts:
              type: boolean
              description: "Include diseases of subordinate concepts in the Mondo Disease Ontology (default: true)"
              example: true
            source:
              type: array
              items:
                type: string
                description: >
                  Available values
                  
                  * `clinvar` - [Clinical significance of variants](https://ftp.ncbi.nlm.nih.gov/pub/clinvar/)
                  
                  * `mgend` - [Clinical significance of variants](https://mgend.ncgm.go.jp)
                  
                enum:
                  
                  - clinvar
                  
                  - mgend
                  

    Dataset:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          description: >
            Available values
            
            * `gem_j_wga` - [GEM Japan Whole Genome Aggregation (GEM-J WGA) Panel](https://togovar.org/doc/datasets/gem_j_wga)
            
            * `jga_wgs` - ** DDBJ account required **
            
            * `jga_wes` - [Japanese Genotype-phenotype Archive (JGA)](https://togovar.org/doc/datasets/jga_wes)
            
            * `jga_snp` - [SNP-chip data in the NBDC Human Database/Japanese Genotype-phenotype Archive (JGA)](https://togovar.org/doc/datasets/jga_snp)
            
            * `tommo` - [ToMMo 54KJPN Allele Frequency Panel](https://jmorp.megabank.tohoku.ac.jp/downloads/tommo-54kjpn-20230626-af_snvindelall)
            
            * `ncbn` - 
            
            * `gnomad_genomes` - [The Genome Aggregation Database (gnomAD Genomes)](https://gnomad.broadinstitute.org)
            
            * `gnomad_exomes` - [The Genome Aggregation Database (gnomAD Exomes)](https://gnomad.broadinstitute.org)
            
          enum:
          
            - gem_j_wga
            
          
            - jga_wgs
            
              
            - jga_wgs.jgad000670
              
            - jga_wgs.jgad000687
              
            - jga_wgs.jgad000688
              
            - jga_wgs.jgad000689
              
            
          
            - jga_wes
            
          
            - jga_snp
            
              
            - bbj_riken.mpheno1
              
            - bbj_riken.mpheno1.male
              
            - bbj_riken.mpheno1.female
              
            - bbj_riken.mpheno2
              
            - bbj_riken.mpheno2.male
              
            - bbj_riken.mpheno2.female
              
            - bbj_riken.mpheno3
              
            - bbj_riken.mpheno3.male
              
            - bbj_riken.mpheno3.female
              
            - bbj_riken.mpheno4
              
            - bbj_riken.mpheno4.male
              
            - bbj_riken.mpheno4.female
              
            - bbj_riken.mpheno5
              
            - bbj_riken.mpheno5.male
              
            - bbj_riken.mpheno5.female
              
            - bbj_riken.mpheno6
              
            - bbj_riken.mpheno6.male
              
            - bbj_riken.mpheno6.female
              
            - bbj_riken.mpheno7
              
            - bbj_riken.mpheno7.male
              
            - bbj_riken.mpheno7.female
              
            - bbj_riken.mpheno8
              
            - bbj_riken.mpheno8.male
              
            - bbj_riken.mpheno9
              
            - bbj_riken.mpheno9.female
              
            - bbj_riken.mpheno10
              
            - bbj_riken.mpheno10.female
              
            - bbj_riken.mpheno11
              
            - bbj_riken.mpheno11.female
              
            - bbj_riken.mpheno12
              
            - bbj_riken.mpheno12.female
              
            - bbj_riken.mpheno13
              
            - bbj_riken.mpheno13.male
              
            - bbj_riken.mpheno13.female
              
            - bbj_riken.mpheno14
              
            - bbj_riken.mpheno14.male
              
            - bbj_riken.mpheno14.female
              
            - bbj_riken.mpheno15
              
            - bbj_riken.mpheno15.male
              
            - bbj_riken.mpheno15.female
              
            - bbj_riken.mpheno16
              
            - bbj_riken.mpheno16.male
              
            - bbj_riken.mpheno16.female
              
            - bbj_riken.mpheno17
              
            - bbj_riken.mpheno17.male
              
            - bbj_riken.mpheno17.female
              
            - bbj_riken.mpheno18
              
            - bbj_riken.mpheno18.male
              
            - bbj_riken.mpheno18.female
              
            - bbj_riken.mpheno19
              
            - bbj_riken.mpheno19.male
              
            - bbj_riken.mpheno19.female
              
            - bbj_riken.mpheno20
              
            - bbj_riken.mpheno20.male
              
            - bbj_riken.mpheno20.female
              
            - bbj_riken.mpheno21
              
            - bbj_riken.mpheno21.male
              
            - bbj_riken.mpheno21.female
              
            - bbj_riken.mpheno22
              
            - bbj_riken.mpheno22.male
              
            - bbj_riken.mpheno22.female
              
            - bbj_riken.mpheno23
              
            - bbj_riken.mpheno23.male
              
            - bbj_riken.mpheno23.female
              
            - bbj_riken.mpheno24
              
            - bbj_riken.mpheno24.male
              
            - bbj_riken.mpheno24.female
              
            - bbj_riken.mpheno25
              
            - bbj_riken.mpheno25.male
              
            - bbj_riken.mpheno25.female
              
            - bbj_riken.mpheno26
              
            - bbj_riken.mpheno26.male
              
            - bbj_riken.mpheno26.female
              
            - bbj_riken.mpheno27
              
            - bbj_riken.mpheno27.male
              
            - bbj_riken.mpheno27.female
              
            - bbj_riken.mpheno28
              
            - bbj_riken.mpheno28.male
              
            - bbj_riken.mpheno28.female
              
            - bbj_riken.mpheno29
              
            - bbj_riken.mpheno29.male
              
            - bbj_riken.mpheno29.female
              
            - bbj_riken.mpheno30
              
            - bbj_riken.mpheno30.male
              
            - bbj_riken.mpheno30.female
              
            - bbj_riken.mpheno31
              
            - bbj_riken.mpheno31.male
              
            - bbj_riken.mpheno31.female
              
            - bbj_riken.mpheno32
              
            - bbj_riken.mpheno32.male
              
            - bbj_riken.mpheno32.female
              
            - bbj_riken.mpheno33
              
            - bbj_riken.mpheno33.male
              
            - bbj_riken.mpheno33.female
              
            - bbj_riken.mpheno34
              
            - bbj_riken.mpheno34.male
              
            - bbj_riken.mpheno34.female
              
            - bbj_riken.mpheno35
              
            - bbj_riken.mpheno35.male
              
            - bbj_riken.mpheno35.female
              
            - bbj_riken.mpheno36
              
            - bbj_riken.mpheno36.male
              
            - bbj_riken.mpheno36.female
              
            - bbj_riken.mpheno37
              
            - bbj_riken.mpheno37.male
              
            - bbj_riken.mpheno37.female
              
            - bbj_riken.mpheno38
              
            - bbj_riken.mpheno38.male
              
            - bbj_riken.mpheno38.female
              
            - bbj_riken.mpheno39
              
            - bbj_riken.mpheno39.male
              
            - bbj_riken.mpheno39.female
              
            - bbj_riken.mpheno40
              
            - bbj_riken.mpheno40.male
              
            - bbj_riken.mpheno40.female
              
            - bbj_riken.mpheno41
              
            - bbj_riken.mpheno41.female
              
            - bbj_riken.mpheno42
              
            - bbj_riken.mpheno42.female
              
            - bbj_riken.mpheno44
              
            - bbj_riken.mpheno44.male
              
            - bbj_riken.mpheno44.female
              
            - bbj_riken.mpheno45
              
            - bbj_riken.mpheno45.male
              
            - bbj_riken.mpheno45.female
              
            - bbj_riken.mpheno46
              
            - bbj_riken.mpheno46.male
              
            - bbj_riken.mpheno46.female
              
            
          
            - tommo
            
          
            - ncbn
            
              
            - ncbn.jpn
              
            - ncbn.jpn.hondo
              
            - ncbn.jpn.ryukyu
              
            - ncbn.acb
              
            - ncbn.asw
              
            - ncbn.beb
              
            - ncbn.gbr
              
            - ncbn.cdx
              
            - ncbn.ceu
              
            - ncbn.clm
              
            - ncbn.esn
              
            - ncbn.fin
              
            - ncbn.gwd
              
            - ncbn.gih
              
            - ncbn.chb
              
            - ncbn.chs
              
            - ncbn.ibs
              
            - ncbn.itu
              
            - ncbn.jpt
              
            - ncbn.khv
              
            - ncbn.lwk
              
            - ncbn.msl
              
            - ncbn.mxl
              
            - ncbn.pel
              
            - ncbn.pur
              
            - ncbn.pjl
              
            - ncbn.stu
              
            - ncbn.tsi
              
            - ncbn.yri
              
            
          
            - gnomad_genomes
            
              
            - gnomad_genomes.afr
              
            - gnomad_genomes.ami
              
            - gnomad_genomes.amr
              
            - gnomad_genomes.asj
              
            - gnomad_genomes.eas
              
            - gnomad_genomes.fin
              
            - gnomad_genomes.mid
              
            - gnomad_genomes.nfe
              
            - gnomad_genomes.remaining
              
            - gnomad_genomes.sas
              
            
          
            - gnomad_exomes
            
              
            - gnomad_exomes.afr
              
            - gnomad_exomes.amr
              
            - gnomad_exomes.asj
              
            - gnomad_exomes.eas
              
            - gnomad_exomes.fin
              
            - gnomad_exomes.mid
              
            - gnomad_exomes.nfe
              
            - gnomad_exomes.remaining
              
            - gnomad_exomes.sas
              
            
          

    Range:
      description: >
        Available keys
         * `gte` - Greater than or equal to
         * `te` - Greater than
         * `lte` - Less than or equal to
         * `le` - Less than
      oneOf:
        - type: object
          description: Both-closed<br/>(a, b) = {x | a &le; x &le; b}
          additionalProperties: false
          required:
            - gte
            - lte
          properties:
            gte:
              type: number
            lte:
              type: number
        - type: object
          description: Both-open<br/>(a, b) = {x | a &lt; x &lt; b}
          additionalProperties: false
          required:
            - gt
            - lt
          properties:
            gt:
              type: number
            lt:
              type: number
        - type: object
          description: Left-open, right-closed<br/>(a, b) = {x | a &lt; x &le; b}
          additionalProperties: false
          required:
            - gt
            - lte
          properties:
            gt:
              type: number
            lte:
              type: number
        - type: object
          description: Left-closed, right-open<br/>(a, b) = {x | a &le; x &lt; b}
          additionalProperties: false
          required:
            - gte
            - lt
          properties:
            gte:
              type: number
            lt:
              type: number
        - type: object
          description: Left-closed, right-unbounded<br/>(a, +&infin;) = {x | x &ge; a}
          additionalProperties: false
          required:
            - gte
          properties:
            gte:
              type: number
        - type: object
          description: Left-open, right-unbounded<br/>(a, +&infin;) = {x | x &gt; a}
          additionalProperties: false
          required:
            - gt
          properties:
            gt:
              type: number
        - type: object
          description: Right-closed, left-unbounded<br/>(-&infin;, b) = {x | x &le; b}
          additionalProperties: false
          required:
            - lte
          properties:
            lte:
              type: number
        - type: object
          description: Right-open, left-unbounded<br/>(-&infin;, b) = {x | x &lt; b}
          additionalProperties: false
          required:
            - lt
          properties:
            lt:
              type: number

    And:
      type: object
      additionalProperties: false
      required:
        - and
      properties:
        and:
          type: array
          minItems: 2
          items:
            type: object
            oneOf:
              - $ref: '#/components/schemas/ID'
              - $ref: '#/components/schemas/Location'
              - $ref: '#/components/schemas/VariantType'
              - $ref: '#/components/schemas/VariantConsequence'
              - $ref: '#/components/schemas/VariantFrequency'
              - $ref: '#/components/schemas/ClinicalSignificance'
              - $ref: '#/components/schemas/Sift'
              - $ref: '#/components/schemas/Polyphen'
              - $ref: '#/components/schemas/AlphaMissense'
              - $ref: '#/components/schemas/Gene'
              - $ref: '#/components/schemas/Disease'
              - $ref: '#/components/schemas/And'
              - $ref: '#/components/schemas/Or'

    Or:
      type: object
      additionalProperties: false
      required:
        - or
      properties:
        or:
          type: array
          minItems: 2
          items:
            type: object
            oneOf:
              - $ref: '#/components/schemas/ID'
              - $ref: '#/components/schemas/Location'
              - $ref: '#/components/schemas/VariantType'
              - $ref: '#/components/schemas/VariantConsequence'
              - $ref: '#/components/schemas/VariantFrequency'
              - $ref: '#/components/schemas/ClinicalSignificance'
              - $ref: '#/components/schemas/Sift'
              - $ref: '#/components/schemas/Polyphen'
              - $ref: '#/components/schemas/AlphaMissense'
              - $ref: '#/components/schemas/Gene'
              - $ref: '#/components/schemas/Disease'
              - $ref: '#/components/schemas/And'
              - $ref: '#/components/schemas/Or'

    SearchVariant:
      type: object
      properties:
        scroll:
          type: object
          properties:
            offset:
              type: integer
            limit:
              type: integer
            max_rows:
              type: integer

        statistics:
          type: object
          properties:
            total:
              type: integer
            filtered:
              type: integer
            dataset:
              type: object
              properties:
                dataset_name:
                  type: integer
            type:
              type: object
              properties:
                so_term:
                  type: integer
            significance:
              type: object
              properties:
                significance_key:
                  type: integer
            consequence:
              type: object
              properties:
                so_term:
                  type: integer

        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
              chromosome:
                type: string
              start:
                type: integer
              stop:
                type: integer
              reference:
                type: string
              alternative:
                type: string
              most_severe_consequence:
                type: string
              sift:
                type: number
              polyphen:
                type: number
              existing_variations:
                type: array
                items:
                  type: string
              external_link:
                type: array
                items:
                  type: object
                  properties:
                    db_name:
                      type: array
                      items:
                        type: string
              significance:
                type: array
                items:
                  type: object
                  properties:
                    condition:
                      type: string
                    interpretations:
                      type: array
                      items:
                        type: string
              transcripts:
                type: object
                properties:
                  transcript_id:
                    type: string
                  gene_id:
                    type: string
                  consequence:
                    type: array
                    items:
                      type: string
                  sift:
                    type: number
                  polyphen:
                    type: number
                  hgnc_id:
                    type: integer
                  symbol:
                    type: object
                    properties:
                      source:
                        type: string
                      label:
                        type: string
                  hgvs_p:
                    type: string
                  hgvs_c:
                    type: string
                  hgvs_g:
                    type: string
              frequencies:
                type: object
                properties:
                  source:
                    type: string
                  filter:
                    type: array
                    items:
                      type: string
                  quality:
                    type: number
                  allele:
                    type: object
                    properties:
                      number:
                        type: integer
                      count:
                        type: integer
                      frequency:
                        type: number
                  genotype:
                    type: object
                    properties:
                      ref_homo_count:
                        type: integer
                      hetero_count:
                        type: integer
                      alt_homo_count:
                        type: integer

    DownloadVariant:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              tgv_id:
                type: string
              rs:
                type: array
                items:
                  type: string
              chromosome:
                type: string
              position_grch38:
                type: integer
              reference:
                type: string
              alternate:
                type: string
              type:
                type: string
              gene:
                type: object
                properties:
                  name:
                    type: string
                  id:
                    type: string
                  synonyms:
                    type: array
                    items:
                      type: string
              consequence:
                type: array
                items:
                  type: string
              condition:
                type: array
                items:
                  type: object
              sift_qualitative_prediction:
                type: string
              sift_score:
                type: number
              polyphen2_qualitative_prediction:
                type: string
              polyphen_score:
                type: number
              alphamissense_pathogenicity:
                type: string
              alphamissense_score:
                type: number
              jga_wgs_allele_alt:
                type: number
              jga_wgs_allele_total:
                type: number
              jga_wgs_alt_allele_freq:
                type: number
              jga_wgs_qc_status:
                type: array
                items:
                  type: string
              jga_wes_allele_alt:
                type: number
              jga_wes_allele_total:
                type: number
              jga_wes_alt_allele_freq:
                type: number
              jga_wes_qc_status:
                type: array
                items:
                  type: string
              jga_snp_allele_alt:
                type: number
              jga_snp_allele_total:
                type: number
              jga_snp_alt_allele_freq:
                type: number
              jga_snp_genotype_alt_alt:
                type: number
              jga_snp_genotype_ref_alt:
                type: number
              jga_snp_genotype_ref_ref:
                type: number
              jga_snp_qc_status:
                type: array
                items:
                  type: string
              tommo_allele_alt:
                type: number
              tommo_allele_total:
                type: number
              tommo_alt_allele_freq:
                type: number
              tommo_qc_status:
                type: array
                items:
                  type: string
              hgvd_allele_alt:
                type: number
              hgvd_allele_total:
                type: number
              hgvd_alt_allele_freq:
                type: number
              hgvd_qc_status:
                type: array
                items:
                  type: string
              gem_j_wga_allele_alt:
                type: number
              gem_j_wga_allele_total:
                type: number
              gem_j_wga_alt_allele_freq:
                type: number
              gem_j_wga_qc_status:
                type: array
                items:
                  type: string
              gnomad_genomes_allele_alt:
                type: number
              gnomad_genomes_allele_total:
                type: number
              gnomad_genomes_alt_allele_freq:
                type: number
              gnomad_genomes_qc_status:
                type: array
                items:
                  type: string


    SearchGene:
      type: array
      items:
        type: object
        properties:
          id:
            type: integer
            example: 404
          symbol:
            type: string
            example: ALDH2
          name:
            type: string
            example: aldehyde dehydrogenase 2 family member
          alias_of:
            type: string
            example: null
          highlight:
            type: string
            example: <em>ALDH2</em>

    SearchDisease:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            example: MONDO_0003582
          cui:
            type: string
            example: C0677776
          label:
            type: string
            example: Hereditary breast and ovarian cancer syndrome
          highlight:
            type: string
            example: Hereditary <em>breast</em> and <em>ovarian</em> <em>cancer</em> syndrome

    InspectDisease:
      type: array
      items:
        type: object
        properties:
          id:
            type: string
            example: MONDO_0003582
          cui:
            type: string
            example: C0677776
          label:
            type: string
            example: Hereditary breast and ovarian cancer syndrome
          root:
            type: boolean
            example: false
          leaf:
            type: boolean
            example: false
          parents:
            type: array
            items:
              type: object
              properties:
                id:
                  type: string
                  example: MONDO_0016248
                cui:
                  type: string
                  example: CN201036
                label:
                  type: string
                  example: Familial ovarian cancer
                root:
                  type: boolean
                  example: false
          children:
            type: array
            items:
              type: object
              properties:
                id:
                  type: string
                  example: MONDO_0012933
                cui:
                  type: string
                  example: C2675520
                label:
                  type: string
                  example: Breast-ovarian cancer, familial 2
                leaf:
                  type: boolean
                  example: true

    Error:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
            example: "error message"

  examples:
    SearchVariant-1:
      summary: List variants whose class is any of insertion, deletion and indel.
      value:
        query:
          type:
            relation: eq
            terms:
              - ins
              - del
              - indel

    SearchVariant-2:
      summary: List variants by identifiers (tgv, rs)
      value:
        query:
          id:
            - tgv421843
            - rs114202595

    SearchVariant-3:
      summary: List variants exist on an exact position
      value:
        query:
          location:
            chromosome: "16"
            position: 48258198

    SearchVariant-4:
      summary: List variants exist in a certain range
      value:
        query:
          location:
            chromosome: "10"
            position:
              gte: 73270743
              lte: 73376976

    SearchVariant-5:
      summary: List variants range from 0.05 to 0.95 in frequency in JGA-WES.
      value:
        query:
          or:
            - frequency:
                dataset:
                  name: jga_wes
                frequency:
                  gte: 0
                  lte: 0.05
                filtered: true
            - frequency:
                dataset:
                  name: jga_wes
                frequency:
                  gte: 0.95
                  lte: 1.0
                filtered: true

    SearchVariant-6:
      summary: List variants exist on ALDH2 (Aldehyde Dehydrogenase 2 family member).
      value:
        query:
          gene:
            relation: eq
            terms:
              - 404

    SearchVariant-7:
      summary: List variants associated with C2675520 (Breast-ovarian cancer, familial 2).
      value:
        query:
          disease:
            relation: eq
            terms:
              - C2675520

    SearchVariant-8:
      summary: List variants associated with MONDO_0003582 (hereditary breast ovarian cancer syndrome).
      value:
        query:
          disease:
            relation: eq
            terms:
              - MONDO_0003582

    SearchVariant-9:
      summary: Paginate result over 10,000 records.
      value:
        offset:
          - "12"
          - "112204719"
          - G
          - A
        limit: 100

    SearchVariant-10:
      summary: List variants by prediction score
      value:
        query:
          and:
            - sift:
                score:
                  gte: 0
                  lt: 0.05
            - polyphen:
                score:
                  gt: 0.908
                  lte: 1
            - alphamissense:
                score:
                  gt: 0.564
                  lte: 1

    SearchVariant-11:
      summary: List variants by prediction score unassigned or unknown
      value:
        query:
          and:
            - sift:
                score:
                  - unassigned
            - polyphen:
                score:
                  - unassigned
                  - unknown
            - alphamissense:
                score:
                  - unassigned
