# VRS uses yaml as the source document for json schema # # To convert vr.yaml to vr.json: # make vr.json # You'll probably have to `pip install pyyaml` first. # # To watch for changes and update automatically: # make watch & # https://json-schema.org/understanding-json-schema/reference/schema.html $schema: "http://json-schema.org/draft-04/schema" title: "GA4GH-VR-Definitions" type: object definitions: # VRS definitions are presented top-down. Everything rolls up to # Variation, which is a polymorphic abstraction of many kinds of # variation. ############################################################################ # Locations Location: additionalProperties: false description: >- A Location represents a span on a specific sequence. oneOf: - $ref: "#/definitions/ChromosomeLocation" - $ref: "#/definitions/SequenceLocation" discriminator: propertyName: type ChromosomeLocation: description: >- A region of a chromosomed specified by species and name using cytogenetic naming conventions type: object properties: type: type: string enum: [ChromosomeLocation] default: ChromosomeLocation _id: $ref: "#/definitions/CURIE" species_id: $ref: "#/definitions/CURIE" default: "taxonomy:9606" chr: type: string interval: $ref: "#/definitions/CytobandInterval" additionalProperties: false required: - type - species_id - chr - interval SequenceLocation: additionalProperties: false description: >- A specified subsequence within another sequence that is used as a reference sequence. type: object properties: _id: $ref: "#/definitions/CURIE" type: type: string enum: [SequenceLocation] default: SequenceLocation sequence_id: $ref: "#/definitions/CURIE" interval: $ref: "#/definitions/SequenceInterval" ############################################################################ # SequenceInterval # * SimpleInterval SequenceInterval: additionalProperties: false oneOf: - $ref: '#/definitions/SimpleInterval' discriminator: propertyName: type SimpleInterval: description: >- A SimpleInterval represents a span of sequence. Positions are always represented by contiguous spans using interbase coordinates. This definition of SequenceInterval is intended to be compatible with that in Sequence Ontology ([SO:0000001](http://www.sequenceontology.org/browser/current_svn/term/SO:0000001)), with the exception that the GA4GH VRS SequenceInterval may be zero-width. The SO definition is for an "extent greater than zero". additionalProperties: false type: object properties: type: type: string enum: [SimpleInterval] default: SimpleInterval start: type: integer nullable: true end: type: integer nullable: true required: - start - end example: type: SimpleInterval start: 11 end: 22 CytobandInterval: description: >- A contiguous region specified by chromosomal bands features. additionalProperties: false type: object properties: type: type: string enum: [CytobandInterval] default: CytobandInterval start: $ref: "#/definitions/Cytoband" end: $ref: "#/definitions/Cytoband" required: - start - end example: type: CytobandInterval start: q22.2 end: q22.3 ############################################################################ # Variation Variation: additionalProperties: false description: >- The root class of all Variation types oneOf: - $ref: "#/definitions/Allele" - $ref: "#/definitions/Haplotype" - $ref: "#/definitions/Text" - $ref: "#/definitions/VariationSet" discriminator: propertyName: type Text: description: >- A textual description of variation, typically not parseable but understood by humans. additionalProperties: false type: object properties: _id: $ref: "#/definitions/CURIE" type: type: string enum: [Text] default: Text definition: type: string description: >- An textual representation of variation intended to capture variation descriptions that cannot be parsed, but still treated as variation. Allele: description: >- An assertion of a sequence state at a Location. additionalProperties: false type: object properties: _id: $ref: "#/definitions/CURIE" type: type: string enum: [Allele] default: Allele location: oneOf: - $ref: "#/definitions/CURIE" - $ref: "#/definitions/Location" state: $ref: "#/definitions/State" VariationSet: description: >- A set of Variation objects. Members may be specified inline or by reference (with CURIEs) type: "object" properties: _id: $ref: "#/definitions/CURIE" type: type: string enum: ["VariationSet"] default: "VariationSet" members: type: array uniqueItems: true items: oneOf: - $ref: "#/definitions/Variation" - $ref: "#/definitions/CURIE" Haplotype: description: >- A set of zero or more Alleles additionalProperties: false type: "object" properties: _id: $ref: "#/definitions/CURIE" type: type: string enum: ["Haplotype"] default: "Haplotype" members: type: array minItems: 1 uniqueItems: true items: oneOf: - $ref: "#/definitions/Allele" - $ref: "#/definitions/CURIE" ############################################################################ # States State: oneOf: - $ref: "#/definitions/SequenceState" SequenceState: description: >- An assertion of the state of a sequence, typically at a Sequence Location within an Allele additionalProperties: false type: object properties: type: type: string enum: [SequenceState] default: SequenceState sequence: type: string nullable: false required: - type - sequence example: type: SequenceState sequence: C ############################################################################ # Basic types # These types are used solely within other definitions. DateTime: additionalProperties: false type: string format: "date-time" CURIE: additionalProperties: false description: >- A string that refers to an object uniquely. The lifetime and scope of an id is defined by the sender. VRS does not impose any contraints on strings used as ids in messages. However, to maximize sharability of data, the VR Specification RECOMMENDS that implementations use [W3C Compact URI (CURIE)](https://www.w3.org/TR/curie/) syntax. String CURIEs are represented as `prefix`:`reference` (W3C terminology), but often referred to as `namespace`:`accession` or `namespace`:`local id` colloquially. The VR specification also RECOMMENDS that `prefix` be defined in identifiers.org. The `reference` component is an unconstrained string. A CURIE is a URI. URIs may *locate* objects (i.e., specify where to retrieve them) or *name* objects conceptually. VRS uses CURIEs primarily as a naming mechanism. Implementations MAY provide CURIE resolution mechanisms for prefixes to make these objects locatable. Using internal ids in public messages is strongly discouraged. type: string pattern: '^\w[^:]*:.+$' example: "ensembl:ENSG00000139618" Cytoband: description: >- A feature referencing a giesma-stained band on an unspecified human chromosome. type: string pattern: '^cen|[pq](ter|([1-9][0-9]*(\.[1-9][0-9]*)?))$' example: "q22.3"