Skip to content

Commit

Permalink
ga4ghDigest key checks added
Browse files Browse the repository at this point in the history
  • Loading branch information
ahwagner committed Sep 10, 2023
1 parent 706939d commit c4d9d36
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ python-jsonschema-objects>=0.4.0
jsonschema==3.2.0
ipython
pyyaml
ga4gh.gks.metaschema==0.2.0rc6
ga4gh.gks.metaschema==0.2.1
sphinx ~= 4.5
sphinx-rtd-theme ~= 1.2
2 changes: 1 addition & 1 deletion schema/defs/vrs/SequenceReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Some SequenceReference attributes are inherited from :ref:`ValueObject`.
* - refgetAccession
- string
- 1..1
- A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>` identifier for the referenced sequence, using the sha512t24u digest.
- A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>` identifier for the referenced sequence, using the sha512t24u digest.
* - residueAlphabet
- string
- 0..1
Expand Down
27 changes: 23 additions & 4 deletions schema/merged.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
"ga4ghDigest": {
"keys": [
"copies",
"subject",
"location",
"type"
],
"prefix": "CN"
Expand Down Expand Up @@ -328,7 +328,7 @@
"ga4ghDigest": {
"keys": [
"copyChange",
"subject",
"location",
"type"
],
"prefix": "CX"
Expand Down Expand Up @@ -490,7 +490,7 @@
"ga4ghDigest": {
"keys": [
"end",
"sequence",
"sequenceReference",
"start",
"type"
],
Expand Down Expand Up @@ -607,7 +607,7 @@
"const": "SequenceReference"
},
"refgetAccession": {
"description": "A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>` identifier for the referenced sequence, using the sha512t24u digest.",
"description": "A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>` identifier for the referenced sequence, using the sha512t24u digest.",
"type": "string",
"pattern": "SQ.[0-9A-Za-z_\\-]{32}"
},
Expand Down Expand Up @@ -642,6 +642,13 @@
},
"ReferenceLengthExpression": {
"maturity": "Alpha",
"ga4ghDigest": {
"keys": [
"length",
"repeatSubunitLength",
"type"
]
},
"description": "An expression of a length of a sequence from a repeating reference.",
"type": "object",
"properties": {
Expand Down Expand Up @@ -704,6 +711,12 @@
},
"LiteralSequenceExpression": {
"maturity": "Alpha",
"ga4ghDigest": {
"keys": [
"sequence",
"type"
]
},
"description": "An explicit expression of a Sequence.",
"type": "object",
"properties": {
Expand Down Expand Up @@ -750,6 +763,12 @@
},
"GenotypeMember": {
"privateTo": "Genotype",
"ga4ghDigest": {
"keys": [
"count",
"variation"
]
},
"description": "A class for expressing the count of a specific MolecularVariation present _in-trans_ at a genomic locus represented by a Genotype.",
"type": "object",
"properties": {
Expand Down
21 changes: 17 additions & 4 deletions schema/merged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ $defs:
ga4ghDigest:
keys:
- copies
- subject
- location
- type
prefix: CN
type: object
Expand Down Expand Up @@ -240,7 +240,7 @@ $defs:
ga4ghDigest:
keys:
- copyChange
- subject
- location
- type
prefix: CX
type: object
Expand Down Expand Up @@ -374,7 +374,7 @@ $defs:
ga4ghDigest:
keys:
- end
- sequence
- sequenceReference
- start
- type
prefix: SL
Expand Down Expand Up @@ -466,7 +466,7 @@ $defs:
const: SequenceReference
refgetAccession:
description: A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>`
identifier for the referenced sequence, using the sha512t24u digest.
identifier for the referenced sequence, using the sha512t24u digest.
type: string
pattern: SQ.[0-9A-Za-z_\-]{32}
residueAlphabet:
Expand All @@ -490,6 +490,11 @@ $defs:
propertyName: type
ReferenceLengthExpression:
maturity: Alpha
ga4ghDigest:
keys:
- length
- repeatSubunitLength
- type
description: An expression of a length of a sequence from a repeating reference.
type: object
properties:
Expand Down Expand Up @@ -538,6 +543,10 @@ $defs:
additionalProperties: false
LiteralSequenceExpression:
maturity: Alpha
ga4ghDigest:
keys:
- sequence
- type
description: An explicit expression of a Sequence.
type: object
properties:
Expand Down Expand Up @@ -577,6 +586,10 @@ $defs:
additionalProperties: false
GenotypeMember:
privateTo: Genotype
ga4ghDigest:
keys:
- count
- variation
description: A class for expressing the count of a specific MolecularVariation
present _in-trans_ at a genomic locus represented by a Genotype.
type: object
Expand Down
80 changes: 23 additions & 57 deletions schema/vrs-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ $defs:
heritableRequired:
- type

# TODO: Draft recomposition of Allele as "AlleleMember" plus seq requirement
# TODO: Explore "typed entity"

Variation:
inherits: Ga4ghIdentifiableObject
description: >-
Expand Down Expand Up @@ -186,61 +183,13 @@ $defs:
into an `Allele` when computing GA4GH identifiers.
required: [ "members" ]

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# UtilityVariation

# Text:
# ga4ghPrefix: VT
# inherits: UtilityVariation
# description: >-
# A free-text definition of variation.
# type: object
# properties:
# type:
# type: string
# const: "Text"
# default: "Text"
# description: MUST be "Text"
# definition:
# type: string
# description: >-
# A textual representation of variation not representable by
# other subclasses of Variation.
# required: [ "definition" ]
#
# VariationSet:
# ga4ghPrefix: VS
# inherits: UtilityVariation
# description: >-
# An unconstrained set of Variation members.
# type: object
# properties:
# type:
# type: string
# const: "VariationSet"
# default: "VariationSet"
# description: MUST be "VariationSet"
# members:
# type: array
# ordered: false
# uniqueItems: true
# items:
# oneOf:
# - $refCurie: gks.core:IRI
# - $ref: "#/$defs/Variation"
# description: >-
# List of Variation objects or identifiers. Attribute is
# required, but MAY be empty.
# required: [ "members" ]


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# SystemicVariation

CopyNumber:
ga4ghDigest:
keys:
- subject
- location
inherits: SystemicVariation
description: >-
A measure of the copies of a :ref:`Location` within a system (e.g. genome, cell, etc.)
Expand Down Expand Up @@ -299,7 +248,8 @@ $defs:
MUST be "CopyNumberChange"
copyChange:
type: string
enum: [ "efo:0030069", "efo:0020073", "efo:0030068", "efo:0030067", "efo:0030064", "efo:0030070", "efo:0030071", "efo:0030072" ]
enum: [ "efo:0030069", "efo:0020073", "efo:0030068", "efo:0030067", "efo:0030064", "efo:0030070",
"efo:0030071", "efo:0030072" ]
description: >-
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),
Expand Down Expand Up @@ -402,7 +352,7 @@ $defs:
keys:
- start
- end
- sequence
- sequenceReference
prefix: SL
inherits: Location
description: >-
Expand Down Expand Up @@ -445,15 +395,18 @@ $defs:
inherits: ValueObject
ga4ghDigest:
assigned: true # This special property indicates that the `digest` field follows an alternate convention
# and is expected to have the value assigned following that convention.
# and is expected to have the value assigned following that convention. For SequenceReference,
# it is expected the digest will be the refget accession value without the `SQ.` prefix.
type: object
description: A sequence of nucleic or amino acid character codes.
properties:
type:
type: string
const: SequenceReference
refgetAccession:
description: A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>` identifier for the referenced sequence, using the sha512t24u digest.
description: >-
A `GA4GH RefGet <http://samtools.github.io/hts-specs/refget.html>` identifier for the referenced sequence,
using the sha512t24u digest.
type: string
pattern: 'SQ.[0-9A-Za-z_\-]{32}'
residueAlphabet:
Expand All @@ -468,7 +421,6 @@ $defs:
- refgetAccession
- type

#TODO: add VRSATILE
#TODO: implementation guidance: digest property is RefGet TRUNC512

# =============================================================================
Expand All @@ -481,6 +433,9 @@ $defs:

SequenceExpression:
inherits: ValueObject
ga4ghDigest:
keys:
- type
description: >-
An expression describing a :ref:`Sequence`.
oneOf:
Expand All @@ -502,6 +457,10 @@ $defs:
ReferenceLengthExpression:
maturity: Alpha
inherits: SequenceExpression
ga4ghDigest:
keys:
- length
- repeatSubunitLength
description: >-
An expression of a length of a sequence from a repeating reference.
type: object
Expand Down Expand Up @@ -531,6 +490,9 @@ $defs:
LiteralSequenceExpression:
maturity: Alpha
inherits: SequenceExpression
ga4ghDigest:
keys:
- sequence
description: >-
An explicit expression of a Sequence.
type: object
Expand Down Expand Up @@ -669,6 +631,10 @@ $defs:
GenotypeMember:
privateTo: Genotype
inherits: ValueObject
ga4ghDigest:
keys:
- count
- variation
description: >-
A class for expressing the count of a specific :ref:`MolecularVariation` present
_in-trans_ at a genomic locus represented by a :ref:`Genotype`.
Expand Down
Loading

0 comments on commit c4d9d36

Please sign in to comment.