diff --git a/examples/canonicalAllele-ex1.yaml b/examples/canonicalAllele-ex1.yaml index a4cb947..fbdcc9e 100644 --- a/examples/canonicalAllele-ex1.yaml +++ b/examples/canonicalAllele-ex1.yaml @@ -2,8 +2,8 @@ id: clinvar:662001 label: NM_004958.4(MTOR):c.5992_5993del (p.Met1998fs) type: CategoricalVariant constraints: - - type: DefiningContextConstraint - definingContext: + - type: DefiningAlleleContext + allele: id: ga4gh:VA.PN-6_l2_yI1UPBRCtFnWkR52iZXKVJ8b type: Allele digest: PN-6_l2_yI1UPBRCtFnWkR52iZXKVJ8b @@ -42,8 +42,8 @@ constraints: - name: clinvar hgvs type value: genomic, top-level relations: - - sequence_liftover - - transcript_projection + - liftover_to + - transcribes_to mappings: - coding: code: CA915941124 diff --git a/examples/categoricalCnv-ex1.yaml b/examples/categoricalCnv-ex1.yaml index 29d11f4..b6a9637 100644 --- a/examples/categoricalCnv-ex1.yaml +++ b/examples/categoricalCnv-ex1.yaml @@ -4,8 +4,8 @@ label: GRCh38/hg38 7p22.1(chr7:5905831-6014161)x3 constraints: - type: CopyCountConstraint copies: 3 - - type: DefiningContextConstraint - definingContext: + - type: DefiningLocationContext + location: type: SequenceLocation start: [null, 5945462] end: [6053792, null] @@ -14,6 +14,9 @@ constraints: type: SequenceReference refgetAccession: SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO residueAlphabet: na + relations: + - liftover_to + matchCharacteristic: exact extensions: - name: vrs processing errors value: "NC_000007.14:g.(?_5905831)_(6014161_?)dup: char 26: expected one of '=', 'con', 'copy', 'del', 'dup', 'ins', or 'inv'" diff --git a/examples/categoricalCnv-ex2.yaml b/examples/categoricalCnv-ex2.yaml index 421c3af..114f57d 100644 --- a/examples/categoricalCnv-ex2.yaml +++ b/examples/categoricalCnv-ex2.yaml @@ -7,8 +7,8 @@ constraints: system: https://www.ebi.ac.uk/ols4/search?ontology=efo&q= code: EFO:0030070 label: Copy Number Gain - - type: DefiningContextConstraint - definingContext: + - type: DefiningLocationContext + location: type: SequenceLocation start: [null, 5945462] end: [6053792, null] @@ -17,6 +17,9 @@ constraints: type: SequenceReference refgetAccession: SQ.Ya6Rs7DHhDeg7YaOSg1EoNi3U_nQ9SvO residueAlphabet: na + relations: + - liftover_to + matchCharacteristic: exact extensions: - name: vrs processing errors value: "NC_000007.14:g.(?_5905831)_(6014161_?)dup: char 26: expected one of '=', 'con', 'copy', 'del', 'dup', 'ins', or 'inv'" diff --git a/examples/proteinSequenceConsequence-ex1.yaml b/examples/proteinSequenceConsequence-ex1.yaml index 633ac4f..91cdda7 100644 --- a/examples/proteinSequenceConsequence-ex1.yaml +++ b/examples/proteinSequenceConsequence-ex1.yaml @@ -11,8 +11,8 @@ description: >- treating patients that failed to respond to earlier generation TKI therapies. label: EGFR L858R constraints: - - type: "DefiningContextConstraint" - definingContext: vrs.json#/ga4gh:VA.kgjrhgf84CEndyLjKdAO0RxN-e3pJjxA + - type: "DefiningAlleleContext" + allele: vrs.json#/ga4gh:VA.kgjrhgf84CEndyLjKdAO0RxN-e3pJjxA members: - vrs.json#/ga4gh:VA.7jX7fHgVEqx4C4jMRyZOH0ZBHnLn7_gJ - vrs.json#/ga4gh:VA.3_FsKSUHEdurPIw5gqpw6g0_Ga0TEXQh diff --git a/schema/cat-vrs/cat-vrs-source.yaml b/schema/cat-vrs/cat-vrs-source.yaml index 0f87a7a..b4eb2ef 100644 --- a/schema/cat-vrs/cat-vrs-source.yaml +++ b/schema/cat-vrs/cat-vrs-source.yaml @@ -16,7 +16,7 @@ $defs: CategoricalVariant: type: object - inherits: gks-core:DomainEntity + inherits: gks-core:Entity maturity: draft description: >- A representation of a categorically-defined domain for variation, in which individual @@ -42,6 +42,14 @@ $defs: ordered: false items: $ref: "#/$defs/Constraint" + mappings: + type: array + ordered: false + items: + $ref: "/ga4gh/schema/gks-core/1.x/json/ConceptMapping" + description: >- + A list of mappings to concepts in terminologies or code systems. Each mapping should + include a coding and a relation. # ============================================================================= # Constraint Definitions @@ -52,7 +60,8 @@ $defs: description: >- Constraints are used to construct an intensional semantics of categorical variant types. oneOf: - - $ref: "#/$defs/DefiningContextConstraint" + - $ref: "#/$defs/DefiningAlleleContext" + - $ref: "#/$defs/DefiningLocationContext" - $ref: "#/$defs/CopyCountConstraint" - $ref: "#/$defs/CopyChangeConstraint" heritableProperties: @@ -61,23 +70,60 @@ $defs: heritableRequired: - type - DefiningContextConstraint: + DefiningAlleleContext: + maturity: draft + type: object + inherits: Constraint + description: >- + The defining allele and its associated relationships that are congruent + with member variants. + properties: + type: + extends: type + const: DefiningAlleleContext + default: DefiningAlleleContext + description: 'MUST be "DefiningAlleleContext"' + allele: + oneOf: + - $ref: /ga4gh/schema/vrs/2.x/json/Allele + - $ref: /ga4gh/schema/gks-core/1.x/json/IRI + relations: + type: array + ordered: false + items: + type: string + enum: + - translates_from + - translates_from_reading_frame + - liftover_to + - transcribes_to + - translates_to + - translates_through + description: >- + Defined relationships from which members relate to the defining context. + ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a + human genome (e.g. "GRCh37" and "GRCh38") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` + refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` + refers to variants or locations that translate from the codon(s) represented by the defined concept. + required: + - allele + + DefiningLocationContext: maturity: draft type: object inherits: Constraint description: >- - The location or location-state, congruent with other reference sequences, - about which categorical variation is being described. + The defining location and its associated relationships that are congruent + with member locations. properties: type: extends: type - const: DefiningContextConstraint - default: DefiningContextConstraint - description: 'MUST be "DefiningContextConstraint"' - definingContext: + const: DefiningLocationContext + default: DefiningLocationContext + description: 'MUST be "DefiningLocationContext"' + location: oneOf: - - $ref: /ga4gh/schema/vrs/2.x/json/Variation - - $ref: /ga4gh/schema/vrs/2.x/json/Location + - $ref: /ga4gh/schema/vrs/2.x/json/SequenceLocation - $ref: /ga4gh/schema/gks-core/1.x/json/IRI relations: type: array @@ -85,17 +131,30 @@ $defs: items: type: string enum: - - sequence_liftover - - transcript_projection - - codon_translation + - translates_from + - translates_from_reading_frame + - liftover_to + - transcribes_to + - translates_to + - translates_through description: >- - Defined relationships between members of the categorical variant and the defining context. + Defined relationships from which members relate to the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. "GRCh37" and "GRCh38") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept. + matchCharacteristic: + type: string + description: >- + A characteristic of the location that is used to match the defining location to member locations. + enum: + - exact + - encompass + - within + - overlap required: - - definingContext + - location + - matchCharacteristic CopyCountConstraint: maturity: draft diff --git a/schema/cat-vrs/def/CanonicalAlleleProperties.rst b/schema/cat-vrs/def/CanonicalAlleleProperties.rst deleted file mode 100644 index 7aa176f..0000000 --- a/schema/cat-vrs/def/CanonicalAlleleProperties.rst +++ /dev/null @@ -1,27 +0,0 @@ - -.. warning:: This data class is at a **draft** maturity level and may change - significantly in future releases. Maturity levels are described in - the :ref:`maturity-model`. - - -**Computational Definition** - -Cat-VRS Constraints found in Canonical Alleles. - -**Information Model** - - -.. list-table:: - :class: clean-wrap - :header-rows: 1 - :align: left - :widths: auto - - * - Field - - Type - - Limits - - Description - * - constraints - - _Not Specified_ - - 1..1 - - diff --git a/schema/cat-vrs/def/CategoricalCnvProperties.rst b/schema/cat-vrs/def/CategoricalCnvProperties.rst deleted file mode 100644 index 271e301..0000000 --- a/schema/cat-vrs/def/CategoricalCnvProperties.rst +++ /dev/null @@ -1,27 +0,0 @@ - -.. warning:: This data class is at a **draft** maturity level and may change - significantly in future releases. Maturity levels are described in - the :ref:`maturity-model`. - - -**Computational Definition** - -Cat-VRS Constraints found in CategoricalCnvs. - -**Information Model** - - -.. list-table:: - :class: clean-wrap - :header-rows: 1 - :align: left - :widths: auto - - * - Field - - Type - - Limits - - Description - * - constraints - - _Not Specified_ - - 1..1 - - diff --git a/schema/cat-vrs/def/CategoricalVariant.rst b/schema/cat-vrs/def/CategoricalVariant.rst index 314f2b5..dc9252d 100644 --- a/schema/cat-vrs/def/CategoricalVariant.rst +++ b/schema/cat-vrs/def/CategoricalVariant.rst @@ -10,7 +10,7 @@ A representation of a categorically-defined domain for variation, in which indiv **Information Model** -Some CategoricalVariant attributes are inherited from :ref:`gks-core:DomainEntity`. +Some CategoricalVariant attributes are inherited from :ref:`gks-core:Entity`. .. list-table:: :class: clean-wrap @@ -42,10 +42,6 @@ Some CategoricalVariant attributes are inherited from :ref:`gks-core:DomainEntit - :ref:`Extension` - 0..m - A list of extensions to the Entity, that allow for capture of information not directly supported by elements defined in the model. - * - mappings - - :ref:`ConceptMapping` - - 0..m - - A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation. * - type - string - 1..1 @@ -58,3 +54,7 @@ Some CategoricalVariant attributes are inherited from :ref:`gks-core:DomainEntit - :ref:`Constraint` - 0..m - + * - mappings + - :ref:`ConceptMapping` + - 0..m + - A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation. diff --git a/schema/cat-vrs/def/DefiningAlleleContext.rst b/schema/cat-vrs/def/DefiningAlleleContext.rst new file mode 100644 index 0000000..fb2ba55 --- /dev/null +++ b/schema/cat-vrs/def/DefiningAlleleContext.rst @@ -0,0 +1,36 @@ + +.. warning:: This data class is at a **draft** maturity level and may change + significantly in future releases. Maturity levels are described in + the :ref:`maturity-model`. + + +**Computational Definition** + +The defining allele and its associated relationships that are congruent with member variants. + +**Information Model** + +Some DefiningAlleleContext attributes are inherited from :ref:`Constraint`. + +.. list-table:: + :class: clean-wrap + :header-rows: 1 + :align: left + :widths: auto + + * - Field + - Type + - Limits + - Description + * - type + - string + - 1..1 + - MUST be "DefiningAlleleContext" + * - allele + - :ref:`Allele` | :ref:`IRI` + - 1..1 + - + * - relations + - string + - 0..m + - Defined relationships from which members relate to the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. "GRCh37" and "GRCh38") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept. diff --git a/schema/cat-vrs/def/DefiningContextConstraint.rst b/schema/cat-vrs/def/DefiningContextConstraint.rst deleted file mode 100644 index e385556..0000000 --- a/schema/cat-vrs/def/DefiningContextConstraint.rst +++ /dev/null @@ -1,36 +0,0 @@ - -.. warning:: This data class is at a **draft** maturity level and may change - significantly in future releases. Maturity levels are described in - the :ref:`maturity-model`. - - -**Computational Definition** - -The location or location-state, congruent with other reference sequences, about which categorical variation is being described. - -**Information Model** - -Some DefiningContextConstraint attributes are inherited from :ref:`Constraint`. - -.. list-table:: - :class: clean-wrap - :header-rows: 1 - :align: left - :widths: auto - - * - Field - - Type - - Limits - - Description - * - type - - string - - 1..1 - - MUST be "DefiningContextConstraint" - * - definingContext - - :ref:`Variation` | :ref:`Location` | :ref:`IRI` - - 1..1 - - - * - relations - - string - - 0..m - - Defined relationships between members of the categorical variant and the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. "GRCh37" and "GRCh38") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept. diff --git a/schema/cat-vrs/def/DefiningLocationContext.rst b/schema/cat-vrs/def/DefiningLocationContext.rst new file mode 100644 index 0000000..0c68a77 --- /dev/null +++ b/schema/cat-vrs/def/DefiningLocationContext.rst @@ -0,0 +1,40 @@ + +.. warning:: This data class is at a **draft** maturity level and may change + significantly in future releases. Maturity levels are described in + the :ref:`maturity-model`. + + +**Computational Definition** + +The defining location and its associated relationships that are congruent with member locations. + +**Information Model** + +Some DefiningLocationContext attributes are inherited from :ref:`Constraint`. + +.. list-table:: + :class: clean-wrap + :header-rows: 1 + :align: left + :widths: auto + + * - Field + - Type + - Limits + - Description + * - type + - string + - 1..1 + - MUST be "DefiningLocationContext" + * - location + - :ref:`SequenceLocation` | :ref:`IRI` + - 1..1 + - + * - relations + - string + - 0..m + - Defined relationships from which members relate to the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. "GRCh37" and "GRCh38") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept. + * - matchCharacteristic + - string + - 1..1 + - A characteristic of the location that is used to match the defining location to member locations. diff --git a/schema/cat-vrs/def/ProteinSequenceConsequenceProperties.rst b/schema/cat-vrs/def/ProteinSequenceConsequenceProperties.rst deleted file mode 100644 index f0660e3..0000000 --- a/schema/cat-vrs/def/ProteinSequenceConsequenceProperties.rst +++ /dev/null @@ -1,27 +0,0 @@ - -.. warning:: This data class is at a **draft** maturity level and may change - significantly in future releases. Maturity levels are described in - the :ref:`maturity-model`. - - -**Computational Definition** - -Cat-VRS Constraints found in Protein Sequence Consequences. - -**Information Model** - - -.. list-table:: - :class: clean-wrap - :header-rows: 1 - :align: left - :widths: auto - - * - Field - - Type - - Limits - - Description - * - constraints - - _Not Specified_ - - 1..1 - - diff --git a/schema/cat-vrs/json/CanonicalAllele b/schema/cat-vrs/json/CanonicalAllele index 19eff05..345b877 100644 --- a/schema/cat-vrs/json/CanonicalAllele +++ b/schema/cat-vrs/json/CanonicalAllele @@ -7,10 +7,40 @@ "description": "A canonical allele is defined by an [Allele](https://vrs.ga4gh.org/en/2.x/concepts/MolecularVariation/Allele.html#) that is representative of a collection of congruent Alleles, each of which depict the same nucleic acid change on different underlying reference sequences. Congruent representations of an Allele often exist across different genome assemblies and associated cDNA transcript representations.", "allOf": [ { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CanonicalAlleleProperties" + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" }, { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" + "properties": { + "constraints": { + "contains": { + "allOf": [ + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext" + }, + { + "type": "object", + "properties": { + "relations": { + "allOf": [ + { + "contains": { + "const": "liftover_to" + } + }, + { + "contains": { + "const": "transcribes_to" + } + } + ], + "maxContains": 2 + } + } + } + ] + } + } + } } ] } \ No newline at end of file diff --git a/schema/cat-vrs/json/CanonicalAlleleProperties b/schema/cat-vrs/json/CanonicalAlleleProperties deleted file mode 100644 index 38215a5..0000000 --- a/schema/cat-vrs/json/CanonicalAlleleProperties +++ /dev/null @@ -1,42 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/CanonicalAlleleProperties", - "title": "CanonicalAlleleProperties", - "type": "object", - "maturity": "draft", - "description": "Cat-VRS Constraints found in Canonical Alleles.", - "properties": { - "constraints": { - "contains": { - "allOf": [ - { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" - }, - { - "type": "object", - "properties": { - "relations": { - "allOf": [ - { - "contains": { - "const": "sequence_liftover" - } - }, - { - "contains": { - "const": "transcript_projection" - } - } - ], - "maxContains": 2 - } - } - } - ] - } - } - }, - "required": [ - "constraints" - ] -} \ No newline at end of file diff --git a/schema/cat-vrs/json/CategoricalCnv b/schema/cat-vrs/json/CategoricalCnv index 86ea53b..890decd 100644 --- a/schema/cat-vrs/json/CategoricalCnv +++ b/schema/cat-vrs/json/CategoricalCnv @@ -7,10 +7,46 @@ "description": "A representation of the constraints for matching knowledge about CNVs.", "allOf": [ { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalCnvProperties" + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" }, { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" + "properties": { + "constraints": { + "allOf": [ + { + "contains": { + "allOf": [ + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationContext" + }, + { + "type": "object", + "properties": { + "relations": { + "contains": { + "const": "liftover_to" + } + } + } + } + ] + } + }, + { + "contains": { + "anyOf": [ + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CopyCountConstraint" + }, + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CopyChangeConstraint" + } + ] + } + } + ] + } + } } ] } \ No newline at end of file diff --git a/schema/cat-vrs/json/CategoricalCnvProperties b/schema/cat-vrs/json/CategoricalCnvProperties deleted file mode 100644 index c0762dc..0000000 --- a/schema/cat-vrs/json/CategoricalCnvProperties +++ /dev/null @@ -1,48 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/CategoricalCnvProperties", - "title": "CategoricalCnvProperties", - "type": "object", - "maturity": "draft", - "description": "Cat-VRS Constraints found in CategoricalCnvs.", - "properties": { - "constraints": { - "allOf": [ - { - "contains": { - "allOf": [ - { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" - }, - { - "type": "object", - "properties": { - "relations": { - "contains": { - "const": "sequence_liftover" - } - } - } - } - ] - } - }, - { - "contains": { - "anyOf": [ - { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CopyCountConstraint" - }, - { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CopyChangeConstraint" - } - ] - } - } - ] - } - }, - "required": [ - "constraints" - ] -} \ No newline at end of file diff --git a/schema/cat-vrs/json/CategoricalVariant b/schema/cat-vrs/json/CategoricalVariant index 29b2d5e..b8b27e1 100644 --- a/schema/cat-vrs/json/CategoricalVariant +++ b/schema/cat-vrs/json/CategoricalVariant @@ -36,14 +36,6 @@ "description": "A list of extensions to the Entity, that allow for capture of information not directly supported by elements defined in the model.", "$comment": "Extension objects have a key-value data structure that allows definition of custom fields in the data itself. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems." }, - "mappings": { - "type": "array", - "ordered": false, - "items": { - "$ref": "/ga4gh/schema/gks-core/1.x/json/ConceptMapping" - }, - "description": "A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation." - }, "type": { "type": "string", "description": "MUST be \"CategoricalVariant\"", @@ -78,10 +70,21 @@ "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CopyCountConstraint" }, { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext" + }, + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationContext" } ] } + }, + "mappings": { + "type": "array", + "ordered": false, + "items": { + "$ref": "/ga4gh/schema/gks-core/1.x/json/ConceptMapping" + }, + "description": "A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation." } }, "required": [ diff --git a/schema/cat-vrs/json/Constraint b/schema/cat-vrs/json/Constraint index f7ddbdb..21d49c5 100644 --- a/schema/cat-vrs/json/Constraint +++ b/schema/cat-vrs/json/Constraint @@ -13,7 +13,10 @@ "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CopyCountConstraint" }, { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext" + }, + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationContext" } ] } \ No newline at end of file diff --git a/schema/cat-vrs/json/DefiningAlleleContext b/schema/cat-vrs/json/DefiningAlleleContext new file mode 100644 index 0000000..c894d40 --- /dev/null +++ b/schema/cat-vrs/json/DefiningAlleleContext @@ -0,0 +1,47 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext", + "title": "DefiningAlleleContext", + "type": "object", + "maturity": "draft", + "description": "The defining allele and its associated relationships that are congruent with member variants.", + "properties": { + "type": { + "type": "string", + "const": "DefiningAlleleContext", + "default": "DefiningAlleleContext", + "description": "MUST be \"DefiningAlleleContext\"" + }, + "allele": { + "oneOf": [ + { + "$ref": "/ga4gh/schema/gks-core/1.x/json/IRI" + }, + { + "$ref": "/ga4gh/schema/vrs/2.x/json/Allele" + } + ] + }, + "relations": { + "type": "array", + "ordered": false, + "items": { + "type": "string", + "enum": [ + "translates_from", + "translates_from_reading_frame", + "liftover_to", + "transcribes_to", + "translates_to", + "translates_through" + ] + }, + "description": "Defined relationships from which members relate to the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. \"GRCh37\" and \"GRCh38\") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept." + } + }, + "required": [ + "allele", + "type" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schema/cat-vrs/json/DefiningContextConstraint b/schema/cat-vrs/json/DefiningContextConstraint deleted file mode 100644 index 867dc28..0000000 --- a/schema/cat-vrs/json/DefiningContextConstraint +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint", - "title": "DefiningContextConstraint", - "type": "object", - "maturity": "draft", - "description": "The location or location-state, congruent with other reference sequences, about which categorical variation is being described.", - "properties": { - "type": { - "type": "string", - "const": "DefiningContextConstraint", - "default": "DefiningContextConstraint", - "description": "MUST be \"DefiningContextConstraint\"" - }, - "definingContext": { - "oneOf": [ - { - "$ref": "/ga4gh/schema/gks-core/1.x/json/IRI" - }, - { - "$ref": "/ga4gh/schema/vrs/2.x/json/Location" - }, - { - "$ref": "/ga4gh/schema/vrs/2.x/json/Variation" - } - ] - }, - "relations": { - "type": "array", - "ordered": false, - "items": { - "type": "string", - "enum": [ - "sequence_liftover", - "transcript_projection", - "codon_translation" - ] - }, - "description": "Defined relationships between members of the categorical variant and the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. \"GRCh37\" and \"GRCh38\") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept." - } - }, - "required": [ - "definingContext", - "type" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/schema/cat-vrs/json/DefiningLocationContext b/schema/cat-vrs/json/DefiningLocationContext new file mode 100644 index 0000000..45e2c3e --- /dev/null +++ b/schema/cat-vrs/json/DefiningLocationContext @@ -0,0 +1,58 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationContext", + "title": "DefiningLocationContext", + "type": "object", + "maturity": "draft", + "description": "The defining location and its associated relationships that are congruent with member locations.", + "properties": { + "type": { + "type": "string", + "const": "DefiningLocationContext", + "default": "DefiningLocationContext", + "description": "MUST be \"DefiningLocationContext\"" + }, + "location": { + "oneOf": [ + { + "$ref": "/ga4gh/schema/gks-core/1.x/json/IRI" + }, + { + "$ref": "/ga4gh/schema/vrs/2.x/json/SequenceLocation" + } + ] + }, + "relations": { + "type": "array", + "ordered": false, + "items": { + "type": "string", + "enum": [ + "translates_from", + "translates_from_reading_frame", + "liftover_to", + "transcribes_to", + "translates_to", + "translates_through" + ] + }, + "description": "Defined relationships from which members relate to the defining context. ``sequence_liftover`` refers to variants or locations that represent a congruent concept on a differing assembly of a human genome (e.g. \"GRCh37\" and \"GRCh38\") or gene (e.g. Locus Reference Genomic) sequence. ``transcript_projection`` refers to variants or locations that occur on transcripts projected from the defined genomic concept. ``codon_translation`` refers to variants or locations that translate from the codon(s) represented by the defined concept." + }, + "matchCharacteristic": { + "type": "string", + "description": "A characteristic of the location that is used to match the defining location to member locations. ", + "enum": [ + "exact", + "encompass", + "within", + "overlap" + ] + } + }, + "required": [ + "location", + "matchCharacteristic", + "type" + ], + "additionalProperties": false +} \ No newline at end of file diff --git a/schema/cat-vrs/json/ProteinSequenceConsequence b/schema/cat-vrs/json/ProteinSequenceConsequence index cbd25cf..de89a74 100644 --- a/schema/cat-vrs/json/ProteinSequenceConsequence +++ b/schema/cat-vrs/json/ProteinSequenceConsequence @@ -6,10 +6,40 @@ "description": "A change that occurs in a protein sequence as a result of genomic changes. Due to the degenerate nature of the genetic code, there are often several genomic changes that can cause a protein sequence consequence. The protein sequence consequence, like a CanonicalAllele, is defined by an [Allele](https://vrs.ga4gh.org/en/2.x/concepts/MolecularVariation/Allele.html#) that is representative of a collection of congruent Protein Alleles that share the same altered codon(s).", "allOf": [ { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/ProteinSequenceConsequenceProperties" + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" }, { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" + "properties": { + "constraints": { + "contains": { + "allOf": [ + { + "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext" + }, + { + "type": "object", + "properties": { + "relations": { + "allOf": [ + { + "contains": { + "const": "translates_from" + } + }, + { + "contains": { + "const": "translates_from_reading_frame" + } + } + ], + "maxContains": 2 + } + } + } + ] + } + } + } } ] } \ No newline at end of file diff --git a/schema/cat-vrs/json/ProteinSequenceConsequenceProperties b/schema/cat-vrs/json/ProteinSequenceConsequenceProperties deleted file mode 100644 index e4fd32a..0000000 --- a/schema/cat-vrs/json/ProteinSequenceConsequenceProperties +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/ProteinSequenceConsequenceProperties", - "title": "ProteinSequenceConsequenceProperties", - "type": "object", - "maturity": "draft", - "description": "Cat-VRS Constraints found in Protein Sequence Consequences.", - "properties": { - "constraints": { - "contains": { - "allOf": [ - { - "$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" - }, - { - "type": "object", - "properties": { - "relations": { - "contains": { - "const": "codon_translation" - }, - "maxContains": 1 - } - } - } - ] - } - } - }, - "required": [ - "constraints" - ] -} \ No newline at end of file diff --git a/schema/cat-vrs/recipes-source.yaml b/schema/cat-vrs/recipes-source.yaml index eca45b5..ecb3224 100644 --- a/schema/cat-vrs/recipes-source.yaml +++ b/schema/cat-vrs/recipes-source.yaml @@ -9,25 +9,6 @@ imports: cat-vrs: ./cat-vrs-source.yaml $defs: - ProteinSequenceConsequenceProperties: - type: object - maturity: draft - description: >- - Cat-VRS Constraints found in Protein Sequence Consequences. - properties: - constraints: - contains: - allOf: - - $ref: "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" - - type: object - properties: - relations: - contains: - const: codon_translation - maxContains: 1 - required: - - constraints - ProteinSequenceConsequence: description: >- A change that occurs in a protein sequence as a result of genomic changes. Due to the degenerate nature @@ -36,31 +17,21 @@ $defs: `Allele `_ that is representative of a collection of congruent Protein Alleles that share the same altered codon(s). allOf: - - $ref: "#/$defs/ProteinSequenceConsequenceProperties" - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" - - CanonicalAlleleProperties: - type: object - maturity: draft - description: >- - Cat-VRS Constraints found in Canonical Alleles. - properties: - constraints: - contains: - allOf: - - $ref: "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" - - type: object - properties: - relations: - allOf: - - contains: - const: sequence_liftover - - contains: - const: transcript_projection - maxContains: 2 - required: - - constraints - + - properties: + constraints: + contains: + allOf: + - $ref: "/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext" + - type: object + properties: + relations: + allOf: + - contains: + const: translates_from + - contains: + const: translates_from_reading_frame + maxContains: 2 CanonicalAllele: maturity: draft @@ -70,37 +41,40 @@ $defs: change on different underlying reference sequences. Congruent representations of an Allele often exist across different genome assemblies and associated cDNA transcript representations. allOf: - - $ref: "#/$defs/CanonicalAlleleProperties" - $ref: "/ga4gh/schema/cat-vrs/1.x/core/CategoricalVariant" - - CategoricalCnvProperties: - type: object - maturity: draft - description: >- - Cat-VRS Constraints found in CategoricalCnvs. - properties: - constraints: - allOf: - - contains: + - properties: + constraints: + contains: allOf: - - $ref: "/ga4gh/schema/cat-vrs/1.x/json/DefiningContextConstraint" + - $ref: "/ga4gh/schema/cat-vrs/1.x/json/DefiningAlleleContext" - type: object properties: relations: - contains: - const: sequence_liftover - - contains: - anyOf: - - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CopyCountConstraint" - - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CopyChangeConstraint" - required: - - constraints - + allOf: + - contains: + const: liftover_to + - contains: + const: transcribes_to + maxContains: 2 CategoricalCnv: maturity: draft description: >- A representation of the constraints for matching knowledge about CNVs. allOf: - - $ref: "#/$defs/CategoricalCnvProperties" - - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" \ No newline at end of file + - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CategoricalVariant" + - properties: + constraints: + allOf: + - contains: + allOf: + - $ref: "/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationContext" + - type: object + properties: + relations: + contains: + const: liftover_to + - contains: + anyOf: + - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CopyCountConstraint" + - $ref: "/ga4gh/schema/cat-vrs/1.x/json/CopyChangeConstraint" \ No newline at end of file