Skip to content

Commit

Permalink
WIP: update to new build structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ahwagner committed Mar 4, 2024
1 parent 62271fe commit 831778c
Show file tree
Hide file tree
Showing 57 changed files with 1,658 additions and 4,099 deletions.
6 changes: 3 additions & 3 deletions .requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pytest
python-jsonschema-objects>=0.4.0
jsonschema==3.2.0
jsonschema
referencing
ipython
pyyaml
ga4gh.gks.metaschema==0.3.0b1
ga4gh.gks.metaschema==0.3.0b4
sphinx ~= 7.2
sphinx-rtd-theme ~= 1.2
1 change: 1 addition & 0 deletions schema/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
47 changes: 30 additions & 17 deletions schema/Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,40 @@
.PHONY: defs FORCE
.SECONDARY:
.SUFFIXES:
.DELETE_ON_ERROR:

JSYAMLS:=vrs.yaml
JSONS:=${JSYAMLS:.yaml=.json}
BUILD_DIR := build
IMPORT_DIR := import

all: ${JSONS} merged.json defs
vpath %tag $(BUILD_DIR)
vpath %.classes $(BUILD_DIR)

%.json: %.yaml
jsy2js.py <$< >$@
SOURCES := $(wildcard *-source.yaml)
TAGS := $(SOURCES:-source.yaml=.tag)
IMPORTS := $(wildcard $(IMPORT_DIR)/*-source.yaml)

%.yaml: %-source.yaml
source2jsy.py $< >$@
all: build-ordered ${TAGS} prune.tag

merged.yaml: vrs-source.yaml
source2mergedjsy.py $< >$@
build-ordered: | $(BUILD_DIR)

defs:
rm -rf defs
y2t.py vrs-source.yaml
ln -s ../../submodules/gks-common/schema/defs/gks.common defs/gks.common
$(BUILD_DIR):
mkdir $(BUILD_DIR)

%.tag: %.classes %.json-tag %.defs-tag
touch $(BUILD_DIR)/$@

watch:
-while true; do ls -1 *.yaml | entr -dn make ${JSONS}; done
%.classes: %-source.yaml
source2classes.py $< >${BUILD_DIR}/$@

%.json-tag: %-source.yaml ${IMPORTS}
source2splitjs.py $<
touch $(BUILD_DIR)/$@

%.defs-tag: %-source.yaml ${IMPORTS}
y2t.py $<
touch $(BUILD_DIR)/$@

prune.tag: ${TAGS}
$(MAKE) -f prune.mk
touch $(BUILD_DIR)/$@

clean:
rm $(BUILD_DIR)/*
54 changes: 54 additions & 0 deletions schema/def/Adjacency.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
**Computational Definition**

The `Adjacency` class can represent either the termination of a sequence or the adjoining of the end of a sequence with the beginning of an adjacent sequence, potentially with an intervening linker sequence.

**Information Model**

Some Adjacency attributes are inherited from :ref:`Variation`.

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

* - Field
- Type
- Limits
- Description
* - id
- 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).
* - label
- string
- 0..1
- A primary label for the entity.
* - description
- string
- 0..1
- A free-text description of the entity.
* - extensions
- `Extension <import/gks-common/core.json#/$defs/Extension>`_
- 0..m
-
* - type
- string
- 0..1
- MUST be "Adjacency".
* - digest
- string
- 0..1
- A sha512t24u digest created using the VRS Computed Identifier algorithm.
* - expressions
- :ref:`Expression`
- 0..m
-
* - adjoinedSequences
- `IRI.json <import/gks-common/json/IRI.json>`_ | :ref:`Location`
- 1..2
- The terminal sequence or pair of adjoined sequences that defines in the adjacency.
* - linker
- :ref:`SequenceExpression`
- 0..1
- The sequence found between adjoined sequences.
54 changes: 54 additions & 0 deletions schema/def/Allele.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
**Computational Definition**

The state of a molecule at a :ref:`Location`.

**Information Model**

Some Allele attributes are inherited from :ref:`Variation`.

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

* - Field
- Type
- Limits
- Description
* - id
- 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).
* - label
- string
- 0..1
- A primary label for the entity.
* - description
- string
- 0..1
- A free-text description of the entity.
* - extensions
- `Extension <import/gks-common/core.json#/$defs/Extension>`_
- 0..m
-
* - type
- string
- 0..1
- MUST be "Allele"
* - digest
- string
- 0..1
- A sha512t24u digest created using the VRS Computed Identifier algorithm.
* - expressions
- :ref:`Expression`
- 0..m
-
* - location
- `IRI.json <import/gks-common/json/IRI.json>`_ | :ref:`Location`
- 1..1
- The location of the Allele
* - state
- :ref:`SequenceExpression`
- 1..1
- An expression of the sequence state
50 changes: 50 additions & 0 deletions schema/def/CopyNumber.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
**Computational Definition**

A measure of the copies of a :ref:`Location` within a system (e.g. genome, cell, etc.)

**Information Model**

Some CopyNumber attributes are inherited from :ref:`Variation`.

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

* - Field
- Type
- Limits
- Description
* - id
- 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).
* - label
- string
- 0..1
- A primary label for the entity.
* - description
- string
- 0..1
- A free-text description of the entity.
* - extensions
- `Extension <import/gks-common/core.json#/$defs/Extension>`_
- 0..m
-
* - type
- string
- 0..1
-
* - digest
- string
- 0..1
- A sha512t24u digest created using the VRS Computed Identifier algorithm.
* - expressions
- :ref:`Expression`
- 0..m
-
* - location
- `IRI.json <import/gks-common/json/IRI.json>`_ | :ref:`Location`
- 1..1
- A location for which the number of systemic copies is described.
54 changes: 54 additions & 0 deletions schema/def/CopyNumberChange.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
**Computational Definition**

An assessment of the copy number of a :ref:`Location` or a :ref:`Gene` within a system (e.g. genome, cell, etc.) relative to a baseline ploidy.

**Information Model**

Some CopyNumberChange attributes are inherited from :ref:`CopyNumber`.

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

* - Field
- Type
- Limits
- Description
* - id
- 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).
* - label
- string
- 0..1
- A primary label for the entity.
* - description
- string
- 0..1
- A free-text description of the entity.
* - extensions
- `Extension <import/gks-common/core.json#/$defs/Extension>`_
- 0..m
-
* - type
- string
- 0..1
- MUST be "CopyNumberChange"
* - digest
- string
- 0..1
- A sha512t24u digest created using the VRS Computed Identifier algorithm.
* - expressions
- :ref:`Expression`
- 0..m
-
* - location
- `IRI.json <import/gks-common/json/IRI.json>`_ | :ref:`Location`
- 1..1
- A location for which the number of systemic copies is described.
* - copyChange
- string
- 1..1
- MUST be one of "efo:0030069" (complete genomic loss), "efo:0020073" (high-level loss), "efo:0030068" (low-level loss), "efo:0030067" (loss), "efo:0030064" (regional base ploidy), "efo:0030070" (gain), "efo:0030071" (low-level gain), "efo:0030072" (high-level gain).
54 changes: 54 additions & 0 deletions schema/def/CopyNumberCount.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
**Computational Definition**

The absolute count of discrete copies of a :ref:`Location` or :ref:`Gene`, within a system (e.g. genome, cell, etc.).

**Information Model**

Some CopyNumberCount attributes are inherited from :ref:`CopyNumber`.

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

* - Field
- Type
- Limits
- Description
* - id
- 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).
* - label
- string
- 0..1
- A primary label for the entity.
* - description
- string
- 0..1
- A free-text description of the entity.
* - extensions
- `Extension <import/gks-common/core.json#/$defs/Extension>`_
- 0..m
-
* - type
- string
- 0..1
- MUST be "CopyNumberCount"
* - digest
- string
- 0..1
- A sha512t24u digest created using the VRS Computed Identifier algorithm.
* - expressions
- :ref:`Expression`
- 0..m
-
* - location
- `IRI.json <import/gks-common/json/IRI.json>`_ | :ref:`Location`
- 1..1
- A location for which the number of systemic copies is described.
* - copies
- integer | :ref:`Range`
- 1..1
- The integral number of copies of the subject in a system
28 changes: 28 additions & 0 deletions schema/def/Expression.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
**Computational Definition**

Representation of a variation by a specified nomenclature or syntax for a Variation object. Common examples of expressions for the description of molecular variation include the HGVS and ISCN nomenclatures.

**Information Model**

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

* - Field
- Type
- Limits
- Description
* - syntax
- string
- 1..1
-
* - value
- string
- 1..1
-
* - syntax_version
- string
- 0..1
-
Loading

0 comments on commit 831778c

Please sign in to comment.