Skip to content

Commit

Permalink
update sub schemas and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybabb committed Jun 30, 2024
1 parent 2121489 commit 575d340
Show file tree
Hide file tree
Showing 15 changed files with 142 additions and 102 deletions.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
PYV:=3.12
VEDIR=venv/${PYV}

############################################################################
#= SETUP, INSTALLATION, PACKAGING

#=> venv: make a Python 3 virtual environment
.PHONY: venv/%
venv/%:
python$* -m venv $@; \
source $@/bin/activate; \
python -m ensurepip --upgrade; \
pip install --upgrade pip setuptools

#=> develop: install package in develop mode
.PHONY: develop setup
develop setup:
pip install -r .requirements.txt

#=> devready: create venv, install prerequisites, install pkg in develop mode
.PHONY: devready
devready:
make ${VEDIR} && source ${VEDIR}/bin/activate && make develop
@echo '#################################################################################'
@echo '### Do not forget to `source ${VEDIR}/bin/activate` to use this environment ###'
@echo '#################################################################################'

############################################################################
#= TESTING
# see test configuration in pyproject.toml

#=> test: execute tests
.PHONY: test
test:
pytest tests/

#=> doctest: execute documentation tests (requires extra data)
.PHONY: doctest
doctest:
pytest tests/ --doctest-modules
16 changes: 8 additions & 8 deletions examples/proteinSequenceConsequence-ex1.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
id: civic.mpid:33
type: ProteinSequenceConsequence
description: >-
EGFR L858R has long been recognized as a functionally significant mutation in cancer,
and is one of the most prevalent single mutations in lung cancer. Best described in
non-small cell lung cancer (NSCLC), the mutation seems to confer sensitivity to first
and second generation TKI's like gefitinib and neratinib. NSCLC patients with this
mutation treated with TKI's show increased overall and progression-free survival, as
compared to chemotherapy alone. Third generation TKI's are currently in clinical trials
that specifically focus on mutant forms of EGFR, a few of which have shown efficacy in
EGFR L858R has long been recognized as a functionally significant mutation in cancer,
and is one of the most prevalent single mutations in lung cancer. Best described in
non-small cell lung cancer (NSCLC), the mutation seems to confer sensitivity to first
and second generation TKI's like gefitinib and neratinib. NSCLC patients with this
mutation treated with TKI's show increased overall and progression-free survival, as
compared to chemotherapy alone. Third generation TKI's are currently in clinical trials
that specifically focus on mutant forms of EGFR, a few of which have shown efficacy in
treating patients that failed to respond to earlier generation TKI therapies.
label: EGFR L858R
definingContext: vrs.json#/ga4gh:VA.kgjrhgf84CEndyLjKdAO0RxN-e3pJjxA
Expand All @@ -16,7 +16,7 @@ members:
- vrs.json#/ga4gh:VA.3_FsKSUHEdurPIw5gqpw6g0_Ga0TEXQh
- vrs.json#/ga4gh:VA.zpv3dW34z8jioKL-NtbGc0fa9clsgAZT
- vrs.json#/ga4gh:VA.BJOtfUhZMooMJUO4FjxHXTEimrKXtF0i
aliases:
alternativeLabels:
- LEU858ARG
- rs121434568
mappings:
Expand Down
14 changes: 7 additions & 7 deletions schema/catvrs/catvrs-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ type: object
strict: true

imports:
gks.common: ../gks-common/common-source.yaml
gks.core: ../gks-core-im/core-im-source.yaml
vrs: ../vrs/vrs-source.yaml

namespaces:
vrs: ../vrs/vrs.yaml#/$defs/
gks.common: ../gks-common/common.yaml#/$defs/
gks.core: ../gks-core-im/core-im.yaml#/$defs/

$defs:
# Categorical Variation are presented top-down. Everything rolls up to
Expand All @@ -22,7 +22,7 @@ $defs:
# =============================================================================

CategoricalVariation:
inherits: gks.common:DomainEntity
inherits: gks.core:DomainEntity
description: >-
A representation of a categorically-defined domain for variation, in which individual
contextual variation instances may be members of the domain.
Expand All @@ -41,7 +41,7 @@ $defs:
items:
oneOf:
- $refCurie: vrs:Variation
- $refCurie: gks.common:IRI
- $refCurie: gks.core:IRI

ProteinSequenceConsequence:
maturity: draft
Expand All @@ -62,7 +62,7 @@ $defs:
definingContext:
oneOf:
- $refCurie: vrs:Allele
- $refCurie: gks.common:IRI
- $refCurie: gks.core:IRI
description: >-
The `VRS Allele <https://vrs.ga4gh.org/en/2.0/terms_and_model.html#allele>`_
object that is congruent with (projects to the same codons) as alleles on other protein reference
Expand All @@ -88,7 +88,7 @@ $defs:
definingContext:
oneOf:
- $refCurie: vrs:Allele
- $refCurie: gks.common:IRI
- $refCurie: gks.core:IRI
description: >-
The `VRS Allele <https://vrs.ga4gh.org/en/2.0/terms_and_model.html#allele>`_
object that is congruent with variants on alternate reference sequences.
Expand Down Expand Up @@ -342,7 +342,7 @@ $defs:
# =============================================================================

CategoricalVariant:
inherits: gks.common:DomainEntity
inherits: gks.core:DomainEntity
description: >-
A top-level representation of a categorically-defined domain for variation across one or multiple biological levels in which individual contextual variants may be members of the domain.
# type: object
Expand Down
18 changes: 9 additions & 9 deletions schema/catvrs/def/CanonicalAllele.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ Some CanonicalAllele attributes are inherited from :ref:`CategoricalVariation`.
- string
- 0..1
- A free-text description of the entity.
* - mappings
- `ConceptMapping <../gks-common/common.json#/$defs/ConceptMapping>`_
* - alternativeLabels
- string
- 0..m
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
- Alternative name(s) for the Entity.
* - extensions
- `Extension <../gks-common/common.json#/$defs/Extension>`_
- `Extension <../gks-core-im/core.json#/$defs/Extension>`_
- 0..m
- A list of extensions to the entity. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems.
* - type
- string
- 1..1
- MUST be "CanonicalAllele"
* - aliases
- string
* - mappings
- `ConceptMapping <../gks-core-im/core.json#/$defs/ConceptMapping>`_
- 0..m
- Aliases are alternate names for a Domain Entity.
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
* - members
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 0..m
- A non-exhaustive list of VRS variation contexts that satisfy the constraints of this categorical variant.
* - definingContext
- `Allele <../vrs/vrs.yaml#/$defs/Allele>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Allele <../vrs/vrs.yaml#/$defs/Allele>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 1..1
- The `VRS Allele <https://vrs.ga4gh.org/en/2.0/terms_and_model.html#allele>`_ object that is congruent with variants on alternate reference sequences.
16 changes: 8 additions & 8 deletions schema/catvrs/def/CategoricalCnv.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ Some CategoricalCnv attributes are inherited from :ref:`CategoricalVariation`.
- string
- 0..1
- A free-text description of the entity.
* - mappings
- `ConceptMapping <../gks-common/common.json#/$defs/ConceptMapping>`_
* - alternativeLabels
- string
- 0..m
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
- Alternative name(s) for the Entity.
* - extensions
- `Extension <../gks-common/common.json#/$defs/Extension>`_
- `Extension <../gks-core-im/core.json#/$defs/Extension>`_
- 0..m
- A list of extensions to the entity. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems.
* - type
- string
- 1..1
- MUST be "CategoricalCnv"
* - aliases
- string
* - mappings
- `ConceptMapping <../gks-core-im/core.json#/$defs/ConceptMapping>`_
- 0..m
- Aliases are alternate names for a Domain Entity.
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
* - members
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 0..m
- A non-exhaustive list of VRS variation contexts that satisfy the constraints of this categorical variant.
* - location
Expand Down
18 changes: 9 additions & 9 deletions schema/catvrs/def/CategoricalVariation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A representation of a categorically-defined domain for variation, in which indiv

**Information Model**

Some CategoricalVariation attributes are inherited from :ref:`gks.common:DomainEntity`.
Some CategoricalVariation attributes are inherited from :ref:`gks.core:DomainEntity`.

.. list-table::
:class: clean-wrap
Expand All @@ -28,23 +28,23 @@ Some CategoricalVariation attributes are inherited from :ref:`gks.common:DomainE
- string
- 0..1
- A free-text description of the entity.
* - mappings
- `ConceptMapping <../gks-common/common.json#/$defs/ConceptMapping>`_
* - alternativeLabels
- string
- 0..m
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
- Alternative name(s) for the Entity.
* - extensions
- `Extension <../gks-common/common.json#/$defs/Extension>`_
- `Extension <../gks-core-im/core.json#/$defs/Extension>`_
- 0..m
- A list of extensions to the entity. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems.
* - type
- string
- 1..1
-
* - aliases
- string
* - mappings
- `ConceptMapping <../gks-core-im/core.json#/$defs/ConceptMapping>`_
- 0..m
- Aliases are alternate names for a Domain Entity.
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
* - members
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 0..m
- A non-exhaustive list of VRS variation contexts that satisfy the constraints of this categorical variant.
16 changes: 8 additions & 8 deletions schema/catvrs/def/DescribedVariation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ Some DescribedVariation attributes are inherited from :ref:`CategoricalVariation
- string
- 0..1
- The 'logical' identifier of the entity in the system of record, e.g. a UUID. This 'id' is unique within a given system. The identified entity may have a different 'id' in a different system, or may refer to an 'id' for the shared concept in another system (e.g. a CURIE).
* - mappings
- `ConceptMapping <../gks-common/common.json#/$defs/ConceptMapping>`_
* - alternativeLabels
- string
- 0..m
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
- Alternative name(s) for the Entity.
* - extensions
- `Extension <../gks-common/common.json#/$defs/Extension>`_
- `Extension <../gks-core-im/core.json#/$defs/Extension>`_
- 0..m
- A list of extensions to the entity. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems.
* - type
- string
- 1..1
- MUST be "DescribedVariation"
* - aliases
- string
* - mappings
- `ConceptMapping <../gks-core-im/core.json#/$defs/ConceptMapping>`_
- 0..m
- Aliases are alternate names for a Domain Entity.
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
* - members
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 0..m
- A non-exhaustive list of VRS variation contexts that satisfy the constraints of this categorical variant.
* - label
Expand Down
18 changes: 9 additions & 9 deletions schema/catvrs/def/ProteinSequenceConsequence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,27 @@ Some ProteinSequenceConsequence attributes are inherited from :ref:`CategoricalV
- string
- 0..1
- A free-text description of the entity.
* - mappings
- `ConceptMapping <../gks-common/common.json#/$defs/ConceptMapping>`_
* - alternativeLabels
- string
- 0..m
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
- Alternative name(s) for the Entity.
* - extensions
- `Extension <../gks-common/common.json#/$defs/Extension>`_
- `Extension <../gks-core-im/core.json#/$defs/Extension>`_
- 0..m
- A list of extensions to the entity. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems.
* - type
- string
- 1..1
- MUST be "ProteinSequenceConsequence"
* - aliases
- string
* - mappings
- `ConceptMapping <../gks-core-im/core.json#/$defs/ConceptMapping>`_
- 0..m
- Aliases are alternate names for a Domain Entity.
- A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.
* - members
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Variation <../vrs/vrs.yaml#/$defs/Variation>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 0..m
- A non-exhaustive list of VRS variation contexts that satisfy the constraints of this categorical variant.
* - definingContext
- `Allele <../vrs/vrs.yaml#/$defs/Allele>`_ | `IRI <../gks-common/common.yaml#/$defs/IRI>`_
- `Allele <../vrs/vrs.yaml#/$defs/Allele>`_ | `IRI <../gks-core-im/core-im.yaml#/$defs/IRI>`_
- 1..1
- The `VRS Allele <https://vrs.ga4gh.org/en/2.0/terms_and_model.html#allele>`_ object that is congruent with (projects to the same codons) as alleles on other protein reference sequences.
22 changes: 11 additions & 11 deletions schema/catvrs/json/CanonicalAllele
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"type": "string",
"description": "A free-text description of the entity."
},
"mappings": {
"alternativeLabels": {
"type": "array",
"ordered": false,
"items": {
"$ref": "/ga4gh/schema/gks-common/1.x/json/ConceptMapping"
"type": "string"
},
"description": "A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation."
"description": "Alternative name(s) for the Entity."
},
"extensions": {
"type": "array",
"ordered": true,
"items": {
"$ref": "/ga4gh/schema/gks-common/1.x/json/Extension"
"$ref": "/ga4gh/schema/gks-core-im/1.x/json/Extension"
},
"description": "A list of extensions to the entity. Extensions are not expected to be natively understood, but may be used for pre-negotiated exchange of message attributes between systems."
},
Expand All @@ -40,13 +40,13 @@
"default": "CanonicalAllele",
"description": "MUST be \"CanonicalAllele\""
},
"aliases": {
"description": "Aliases are alternate names for a Domain Entity.",
"ordered": false,
"mappings": {
"type": "array",
"ordered": false,
"items": {
"type": "string"
}
"$ref": "/ga4gh/schema/gks-core-im/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."
},
"members": {
"type": "array",
Expand All @@ -55,7 +55,7 @@
"items": {
"oneOf": [
{
"$ref": "/ga4gh/schema/gks-common/1.x/json/IRI"
"$ref": "/ga4gh/schema/gks-core-im/1.x/json/IRI"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Variation"
Expand All @@ -66,7 +66,7 @@
"definingContext": {
"oneOf": [
{
"$ref": "/ga4gh/schema/gks-common/1.x/json/IRI"
"$ref": "/ga4gh/schema/gks-core-im/1.x/json/IRI"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Allele"
Expand Down
Loading

0 comments on commit 575d340

Please sign in to comment.