$schema: 'https://json-schema.org/draft/2020-12/schema'

title: 'Variant Annotation Format'

description: >-
  The variant annotation/interpretation format stores associations of
  variation with annotations/intreptations.

type: object
required:
  - _version
  - findings
properties:
  _version: 
    $ref: "../../core.json#/definitions/Version"
  findings:
    items:
      $ref: "#/definitions/Interpretation"
    minItems: 1
    maxItems: 2
    type: 'array'

definitions: 
  Interpretation:
    type: object
    properties:
      classification:
        type: object
        properties:
          scheme:
            type: string
            enum: [ACMG]
          value:
            type: string
            anyOf:
              - $ref: "../../core.json#/definitions/ACMGClassification"
              - const: "NEGATIVE"
      condition:
        type: ["string", "null"]
        example: "Spinocerebellar ataxia 3 (SCA3)"
      evidence:
        type: object
        properties:
          summary:
            type: string
            description: Interpretation summary 
            example: "lorem ipsum"
      gene_symbol:
        type: string
        description: Gene symbol
        example: "ATXN3"
      inheritance:
        description: Who the variant is inherited from
        $ref: "../../core.json#/definitions/VariantInheritance"
      zygosity:
        description: Zygosity of the variant in the individual
        $ref: "../../core.json#/definitions/Zygosity" 
      variation:
        $ref: "../../structs.json#/definitions/TREVariation"
      gene_info:
        type: string
        description: Information text about the gene
        example: "This gene encodes a member of the AAA ATPase family, a large group of ATPases associated with diverse cellular activities. This protein is cytoplasmic but is often anchored to a peroxisomal membrane where it forms a heteromeric complex and plays a role in the import of proteins into peroxisomes and peroxisome biogenesis. Mutations in this gene have been associated with complementation group 1 peroxisomal disorders such as neonatal adrenoleukodystrophy, infantile Refsum disease, and Zellweger syndrome. Alternatively spliced transcript variants have been found for this gene. [provided by RefSeq, Sep 2013]"
      mode_of_inheritance:
        description: Mode of inheritance of the condition
        $ref: "../../core.json#/definitions/Inheritance"
