Skip to content

Commit

Permalink
Refine components in TraversalBlock (#554)
Browse files Browse the repository at this point in the history
* `Adjacency` is the only component in a `TraversalBlock`

`Allele`, `CisPhasedBlock`, and `Terminus` can be specified directly on the `DerivativeMolecule`

* Add adjacency orientation example

---------

Co-authored-by: Alex H. Wagner, PhD <[email protected]>
  • Loading branch information
Mrinal-Thomas-Epic and ahwagner authored Oct 23, 2024
1 parent f2ec1ba commit 52fd157
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 58 deletions.
10 changes: 10 additions & 0 deletions docs/source/conventions/normalization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,13 @@ will be selected by meeting the following ordered criteria.
1. The first of the adjoined sequences MUST have a forward orientation (location defined by `end`).
2. The adjoined sequence accessions are equal or in ascending lexicographical order.
3. The defined adjoined sequence coordinates are in ascending numerical order.

When adjacencies are used in the context of a :ref:`DerivativeMolecule`, the orientation
is definitional and must be specified using a :ref:`TraversalBlock`.

.. figure:: ../images/ex_adjacency_orientation.png

**The same pair of adjacencies can produce significantly different derivative molecules
depending on orientation.** In the top example, a 100-base sequence is deleted and
replaced by a 1000-base inverted sequence. In the bottom example, a 100-base inverted
sequence is inserted, and a 1000-base sequence is duplicated.
Binary file added docs/source/images/ex_adjacency_orientation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 33 additions & 42 deletions examples/sv_derivative_molecule.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
id: sv_derivative_molecule
type: DerivativeMolecule
components:
- type: TraversalBlock
orientation: forward
component:
id: 5-prime-terminus
type: Terminus
location:
type: SequenceLocation
sequenceReference:
type: SequenceReference
refgetAccession: SQ.S_KjnFVz-FE7M0W6yoaUDgYxLPc1jyWU
residueAlphabet: na
id: NC_000001.10
end: 123
- id: 5-prime-terminus
type: Terminus
location:
type: SequenceLocation
sequenceReference:
type: SequenceReference
refgetAccession: SQ.S_KjnFVz-FE7M0W6yoaUDgYxLPc1jyWU
residueAlphabet: na
id: NC_000001.10
end: 123
- type: TraversalBlock
orientation: forward
component:
Expand All @@ -37,22 +34,19 @@ components:
linker:
type: LiteralSequenceExpression
sequence: GTC
- type: TraversalBlock
orientation: forward
component:
type: Allele
location:
type: SequenceLocation
start: 601
end: 602
sequenceReference:
type: SequenceReference
refgetAccession: SQ.9KdcA9ZpY1Cpvxvg8bMSLYDUpsX6GDLO
residueAlphabet: na
id: NC_000002.11
state:
type: LiteralSequenceExpression
sequence: C
- type: Allele
location:
type: SequenceLocation
start: 601
end: 602
sequenceReference:
type: SequenceReference
refgetAccession: SQ.9KdcA9ZpY1Cpvxvg8bMSLYDUpsX6GDLO
residueAlphabet: na
id: NC_000002.11
state:
type: LiteralSequenceExpression
sequence: C
- type: TraversalBlock
orientation: forward
component:
Expand All @@ -73,19 +67,16 @@ components:
residueAlphabet: na
id: NC_000001.10
end: 1000
- type: TraversalBlock
orientation: forward
component:
id: 3-prime-terminus
type: Terminus
location:
type: SequenceLocation
sequenceReference:
type: SequenceReference
refgetAccession: SQ.S_KjnFVz-FE7M0W6yoaUDgYxLPc1jyWU
residueAlphabet: na
id: NC_000001.10
start: 1000
- id: 3-prime-terminus
type: Terminus
location:
type: SequenceLocation
sequenceReference:
type: SequenceReference
refgetAccession: SQ.S_KjnFVz-FE7M0W6yoaUDgYxLPc1jyWU
residueAlphabet: na
id: NC_000001.10
start: 1000



Expand Down
2 changes: 1 addition & 1 deletion schema/vrs/def/DerivativeMolecule.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Some DerivativeMolecule attributes are inherited from :ref:`Variation`.
- 1..1
- MUST be "DerivativeMolecule".
* - components
- :ref:`IRI` | :ref:`TraversalBlock`
- :ref:`IRI` | :ref:`Allele` | :ref:`CisPhasedBlock` | :ref:`Terminus` | :ref:`TraversalBlock`
- 2..m
- The molecular components that constitute the derivative molecule.
* - circular
Expand Down
2 changes: 1 addition & 1 deletion schema/vrs/def/TraversalBlock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Some TraversalBlock attributes are inherited from :ref:`gks.core-im:Entity`.
- 1..1
- MUST be "TraversalBlock".
* - component
- :ref:`Allele` | :ref:`CisPhasedBlock` | :ref:`Adjacency` | :ref:`Terminus`
- :ref:`Adjacency`
- 0..1
- The unoriented molecular variation component.
* - orientation
Expand Down
9 changes: 9 additions & 0 deletions schema/vrs/json/DerivativeMolecule
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@
"ordered": true,
"items": {
"oneOf": [
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Allele"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/CisPhasedBlock"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Terminus"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/TraversalBlock"
},
Expand Down
9 changes: 0 additions & 9 deletions schema/vrs/json/TraversalBlock
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,6 @@
"oneOf": [
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Adjacency"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Allele"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/CisPhasedBlock"
},
{
"$ref": "/ga4gh/schema/vrs/2.x/json/Terminus"
}
]
},
Expand Down
10 changes: 5 additions & 5 deletions schema/vrs/vrs-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ $defs:
items:
oneOf:
- $ref: "/ga4gh/schema/gks-common/1.x/core-im/json/IRI"
- $ref: "#/$defs/Allele"
- $ref: "#/$defs/CisPhasedBlock"
- $ref: "#/$defs/Terminus"
- $ref: "#/$defs/TraversalBlock"
description: >-
The molecular components that constitute the derivative molecule.
Expand All @@ -603,8 +606,8 @@ $defs:
- component
- orientation
description: >-
A component used to describe the orientation of a molecular variation within a
DerivativeMolecule.
A component used to describe the orientation of applicable molecular variation
within a DerivativeMolecule.
properties:
type:
extends: type
Expand All @@ -615,10 +618,7 @@ $defs:
description: >-
The unoriented molecular variation component.
oneOf:
- $ref: "#/$defs/Allele"
- $ref: "#/$defs/CisPhasedBlock"
- $ref: "#/$defs/Adjacency"
- $ref: "#/$defs/Terminus"
orientation:
type: string
description: >-
Expand Down

0 comments on commit 52fd157

Please sign in to comment.