Skip to content

Commit

Permalink
#98: Adding FeatureContextConstraint (#108)
Browse files Browse the repository at this point in the history
* Reimplemented FeatureContextConstraint, other branch got very messy when rebasing post- merge of commit 11848ce / pull request 102

* Added empty line at end of cat-vrs-source.yaml

* Added compiled schema def and json files that were missed in pull request 102. I believe these not being committed were why tests were failing through github actions.

* Ran pre-commit hook locally, which fixed trailing whitepsace errors
  • Loading branch information
brendanreardon authored Feb 14, 2025
1 parent 11848ce commit f766d7d
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/source/concepts/catvrs_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ CopyChangeConstraint
####################

.. include:: ../def/cat-vrs/CopyChangeConstraint.rst

FeatureContextConstraint
########################

.. include:: ../def/cat-vrs/FeatureContextConstraint.rst
25 changes: 25 additions & 0 deletions examples/proteinMarker-ex1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
id: pr:p03372
type: CategoricalVariant
description: >-
An estrogen receptor that is encoded in the genome of human.
label: Estrogen receptor
constraints:
- type: FeatureContextConstraint
featureContext:
id: pr:p03372
conceptType: Protein
label: Estrogen receptor
primaryCode: hgnc:3236
mappings:
- coding:
system: https://proconsortium.org
code: pr:p03372
relation: exactMatch
- coding:
system: https://www.uniprot.org
code: p03372
relation: relatedMatch
- coding:
system: https://www.genenames.org
code: hgnc:3467
relation: relatedMatch
24 changes: 24 additions & 0 deletions examples/proteinSequenceConsequence-ex1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@ constraints:
allele: vrs.json#/ga4gh:VA.kgjrhgf84CEndyLjKdAO0RxN-e3pJjxA
relations:
- primaryCode: translates_from
- type: FeatureContextConstraint
featureContext:
id: normalize.gene.hgnc:3236
extensions:
- name: symbol_status
value: approved
- name: approved_name
value: epidermal growth factor receptor
conceptType: Gene
name: EGFR
primaryCode: hgnc:3236
mappings:
- coding:
system: https://www.genenames.org
code: hgnc:3236
relation: exactMatch
- coding:
system: https://www.ensembl.org
code: ensembl:ENSG00000146648
relation: relatedMatch
- coding:
system: https://www.ncbi.nlm.nih.gov/gene/
code: ncbigene:1956
relation: relatedMatch
members:
- vrs.json#/ga4gh:VA.7jX7fHgVEqx4C4jMRyZOH0ZBHnLn7_gJ
- vrs.json#/ga4gh:VA.3_FsKSUHEdurPIw5gqpw6g0_Ga0TEXQh
Expand Down
19 changes: 19 additions & 0 deletions schema/cat-vrs/cat-vrs-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ $defs:
- $ref: "#/$defs/DefiningLocationConstraint"
- $ref: "#/$defs/CopyCountConstraint"
- $ref: "#/$defs/CopyChangeConstraint"
- $ref: "#/$defs/FeatureContextConstraint"
heritableProperties:
type:
type: string
Expand Down Expand Up @@ -185,3 +186,21 @@ $defs:
- EFO:0030072
required:
- copyChange

FeatureContextConstraint:
maturity: draft
type: object
inherits: Constraint
description: >-
The feature that members of this categorical variant are associated with.
properties:
type:
extends: type
const: FeatureContextConstraint
default: FeatureContextConstraint
description: 'MUST be "FeatureContextConstraint"'
featureContext:
description: A feature identifier.
$refCurie: gks.core:MappableConcept
required:
- featureContext
33 changes: 33 additions & 0 deletions schema/cat-vrs/def/FeatureContextConstraint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.. 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 feature that members of this categorical variant are associated with.

**Information Model**

Some FeatureContextConstraint attributes are inherited from :ref:`Constraint`.

.. list-table::
:class: clean-wrap
:header-rows: 1
:align: left
:widths: auto

* - Field
- Flags
- Type
- Limits
- Description
* - type
-
- string
- 1..1
- MUST be "FeatureContextConstraint"
* - featureContext
-
- :ref:`MappableConcept`
- 1..1
- A feature identifier.
3 changes: 3 additions & 0 deletions schema/cat-vrs/json/CategoricalVariant
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
},
{
"$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationConstraint"
},
{
"$ref": "/ga4gh/schema/cat-vrs/1.x/json/FeatureContextConstraint"
}
]
}
Expand Down
3 changes: 3 additions & 0 deletions schema/cat-vrs/json/Constraint
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
},
{
"$ref": "/ga4gh/schema/cat-vrs/1.x/json/DefiningLocationConstraint"
},
{
"$ref": "/ga4gh/schema/cat-vrs/1.x/json/FeatureContextConstraint"
}
]
}
25 changes: 25 additions & 0 deletions schema/cat-vrs/json/FeatureContextConstraint
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://w3id.org/ga4gh/schema/cat-vrs/1.x/json/FeatureContextConstraint",
"title": "FeatureContextConstraint",
"type": "object",
"maturity": "draft",
"description": "The feature that members of this categorical variant are associated with.",
"properties": {
"type": {
"type": "string",
"const": "FeatureContextConstraint",
"default": "FeatureContextConstraint",
"description": "MUST be \"FeatureContextConstraint\""
},
"featureContext": {
"description": "A feature identifier.",
"$ref": "/ga4gh/schema/gks-core/1.0.0-snapshot.2025-02.2/json/MappableConcept"
}
},
"required": [
"featureContext",
"type"
],
"additionalProperties": false
}

0 comments on commit f766d7d

Please sign in to comment.