You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ga4gh/core/models.py
+17-15Lines changed: 17 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -94,22 +94,22 @@ class Entity(BaseModel, ABC):
94
94
"""
95
95
96
96
id: str|None=Field(
97
-
None,
97
+
default=None,
98
98
description="The 'logical' identifier of the Entity in the system of record, e.g. a UUID. This 'id' is unique within a given system, but may or may not be globally unique outside the system. It is used within a system to reference an object from another.",
99
99
)
100
100
type: str=Field(
101
101
...,
102
102
description="The name of the class that is instantiated by a data object representing the Entity.",
103
103
)
104
-
name: str|None=Field(None, description="A primary name for the entity.")
104
+
name: str|None=Field(default=None, description="A primary name for the entity.")
105
105
description: str|None=Field(
106
-
None, description="A free-text description of the Entity."
106
+
default=None, description="A free-text description of the Entity."
107
107
)
108
108
aliases: list[str] |None=Field(
109
-
None, description="Alternative name(s) for the Entity."
109
+
default=None, description="Alternative name(s) for the Entity."
110
110
)
111
111
extensions: list[Extension] |None=Field(
112
-
None,
112
+
default=None,
113
113
description="A list of extensions to the Entity, that allow for capture of information not directly supported by elements defined in the model.",
114
114
)
115
115
@@ -121,11 +121,11 @@ class Element(BaseModel, ABC):
121
121
"""
122
122
123
123
id: str|None=Field(
124
-
None,
124
+
default=None,
125
125
description="The 'logical' identifier of the data element in the system of record, e.g. a UUID. This 'id' is unique within a given system, but may or may not be globally unique outside the system. It is used within a system to reference an object from another.",
126
126
)
127
127
extensions: list[Extension] |None=Field(
128
-
None,
128
+
default=None,
129
129
description="A list of extensions to the Entity, that allow for capture of information not directly supported by elements defined in the model.",
130
130
)
131
131
@@ -141,20 +141,20 @@ class Coding(Element, BaseModelForbidExtra):
141
141
"""
142
142
143
143
name: str|None=Field(
144
-
None,
144
+
default=None,
145
145
description="The human-readable name for the coded concept, as defined by the code system.",
146
146
)
147
147
system: str=Field(
148
148
...,
149
149
description="The terminology/code system that defined the code. May be reported as a free-text name (e.g. 'Sequence Ontology'), but it is preferable to provide a uri/url for the system.",
150
150
)
151
151
systemVersion: str|None=Field( # noqa: N815
152
-
None,
152
+
default=None,
153
153
description="Version of the terminology or code system that provided the code.",
154
154
)
155
155
code: code# Cannot use Field due to PydanticUserError: field name and type annotation must not clash.
156
156
iris: list[iriReference] |None=Field(
157
-
None,
157
+
default=None,
158
158
description="A list of IRIs that are associated with the coding. This can be used to provide additional context or to link to additional information about the concept.",
159
159
)
160
160
@@ -191,7 +191,7 @@ class Extension(Element, BaseModelForbidExtra):
191
191
description="The value of the Extension - can be any primitive or structured object",
192
192
)
193
193
description: str|None=Field(
194
-
None,
194
+
default=None,
195
195
description="A description of the meaning or utility of the Extension, to explain the type of information it is meant to hold.",
196
196
)
197
197
@@ -200,16 +200,18 @@ class MappableConcept(Element, BaseModelForbidExtra):
200
200
"""A concept based on a primaryCoding and/or name that may be mapped to one or more other `Codings`."""
201
201
202
202
conceptType: str|None=Field( # noqa: N815
203
-
None,
203
+
default=None,
204
204
description="A term indicating the type of concept being represented by the MappableConcept.",
205
205
)
206
-
name: str|None=Field(None, description="A primary name for the concept.")
206
+
name: str|None=Field(
207
+
default=None, description="A primary name for the concept."
208
+
)
207
209
primaryCoding: Coding|None=Field( # noqa: N815
208
-
None,
210
+
default=None,
209
211
description="A primary coding for the concept.",
210
212
)
211
213
mappings: list[ConceptMapping] |None=Field(
212
-
None,
214
+
default=None,
213
215
description="A list of mappings to concepts in terminologies or code systems. Each mapping should include a coding and a relation.",
description="A sha512t24u digest created using the VRS Computed Identifier algorithm.",
281
281
)
282
282
@@ -397,7 +397,7 @@ class Expression(Element, BaseModelForbidExtra):
397
397
description="The expression of the variation in the specified syntax. The value should be a valid expression in the specified syntax.",
398
398
)
399
399
syntax_version: str|None=Field(
400
-
None,
400
+
default=None,
401
401
description="The version of the syntax used to describe the variation. This is particularly important for HGVS expressions, as the syntax has evolved over time.",
402
402
)
403
403
@@ -480,9 +480,12 @@ class LengthExpression(_ValueObject, BaseModelForbidExtra):
480
480
"""A sequence expressed only by its length."""
481
481
482
482
type: Literal["LengthExpression"] =Field(
483
-
VrsType.LEN_EXPR.value, description=f'MUST be "{VrsType.LEN_EXPR.value}"'
483
+
default=VrsType.LEN_EXPR.value,
484
+
description=f'MUST be "{VrsType.LEN_EXPR.value}"',
485
+
)
486
+
length: Range|int|None=Field(
487
+
default=None, description="The length of the sequence."
484
488
)
485
-
length: Range|int|None=Field(None, description="The length of the sequence.")
486
489
487
490
classga4gh(_ValueObject.ga4gh):
488
491
inherent= ["length", "type"]
@@ -492,14 +495,14 @@ class ReferenceLengthExpression(_ValueObject, BaseModelForbidExtra):
492
495
"""An expression of a length of a sequence from a repeating reference."""
@@ -543,19 +546,19 @@ class SequenceReference(_ValueObject, BaseModelForbidExtra):
543
546
description="A [GA4GH RefGet](http://samtools.github.io/hts-specs/refget.html) identifier for the referenced sequence, using the sha512t24u digest.",
544
547
)
545
548
residueAlphabet: ResidueAlphabet|None=Field(
546
-
None,
549
+
default=None,
547
550
description='The interpretation of the character codes referred to by the refget accession, where "aa" specifies an amino acid character set, and "na" specifies a nucleic acid character set.',
548
551
)
549
552
circular: bool|None=Field(
550
-
None,
553
+
default=None,
551
554
description="A boolean indicating whether the molecule represented by the sequence is circular (true) or linear (false).",
552
555
)
553
556
sequence: sequenceString|None=Field(
554
-
None,
557
+
default=None,
555
558
description="A sequenceString that is a literal representation of the referenced sequence.",
556
559
)
557
560
moleculeType: MoleculeType|None=Field(
558
-
None,
561
+
default=None,
559
562
description="Molecule types as [defined by RefSeq](https://www.ncbi.nlm.nih.gov/books/NBK21091/) (see Table 1). MUST be one of 'genomic', 'RNA', 'mRNA', or 'protein'.",
560
563
)
561
564
@@ -567,22 +570,22 @@ class SequenceLocation(Ga4ghIdentifiableObject, BaseModelForbidExtra):
567
570
"""A `Location` defined by an interval on a `Sequence`."""
568
571
569
572
type: Literal["SequenceLocation"] =Field(
570
-
VrsType.SEQ_LOC.value, description=f'MUST be "{VrsType.SEQ_LOC.value}"'
573
+
default=VrsType.SEQ_LOC.value, description=f'MUST be "{VrsType.SEQ_LOC.value}"'
description="A reference to a SequenceReference on which the location is defined.",
575
578
)
576
579
start: Range|int|None=Field(
577
-
None,
580
+
default=None,
578
581
description="The start coordinate or range of the SequenceLocation. The minimum value of this coordinate or range is 0. For locations on linear sequences, this MUST represent a coordinate or range less than or equal to the value of `end`. For circular sequences, `start` is greater than `end` when the location spans the sequence 0 coordinate.",
579
582
)
580
583
end: Range|int|None=Field(
581
-
None,
584
+
default=None,
582
585
description="The end coordinate or range of the SequenceLocation. The minimum value of this coordinate or range is 0. For locations on linear sequences, this MUST represent a coordinate or range greater than or equal to the value of `start`. For circular sequences, `end` is less than `start` when the location spans the sequence 0 coordinate.",
583
586
)
584
587
sequence: sequenceString|None=Field(
585
-
None,
588
+
default=None,
586
589
description="The literal sequence encoded by the `sequenceReference` at these coordinates.",
587
590
)
588
591
@@ -673,7 +676,7 @@ class Allele(_VariationBase, BaseModelForbidExtra):
673
676
"""The state of a molecule at a `Location`."""
674
677
675
678
type: Literal["Allele"] =Field(
676
-
VrsType.ALLELE.value, description=f'MUST be "{VrsType.ALLELE.value}"'
679
+
default=VrsType.ALLELE.value, description=f'MUST be "{VrsType.ALLELE.value}"'
677
680
)
678
681
location: iriReference|SequenceLocation=Field(
679
682
..., description="The location of the Allele"
@@ -717,7 +720,7 @@ class CisPhasedBlock(_VariationBase, BaseModelForbidExtra):
717
720
"""An ordered set of co-occurring `Variation` on the same molecule."""
718
721
719
722
type: Literal["CisPhasedBlock"] =Field(
720
-
VrsType.CIS_PHASED_BLOCK.value,
723
+
default=VrsType.CIS_PHASED_BLOCK.value,
721
724
description=f'MUST be "{VrsType.CIS_PHASED_BLOCK.value}"',
722
725
)
723
726
members: list[Allele|iriReference] =Field(
@@ -726,7 +729,7 @@ class CisPhasedBlock(_VariationBase, BaseModelForbidExtra):
726
729
min_length=2,
727
730
)
728
731
sequenceReference: SequenceReference|None=Field(
729
-
None,
732
+
default=None,
730
733
description="An optional Sequence Reference on which all of the in-cis Alleles are found. When defined, this may be used to implicitly define the `sequenceReference` attribute for each of the CisPhasedBlock member Alleles.",
731
734
)
732
735
@@ -751,7 +754,8 @@ class Adjacency(_VariationBase, BaseModelForbidExtra):
751
754
"""
752
755
753
756
type: Literal["Adjacency"] =Field(
754
-
VrsType.ADJACENCY.value, description=f'MUST be "{VrsType.ADJACENCY.value}".'
757
+
default=VrsType.ADJACENCY.value,
758
+
description=f'MUST be "{VrsType.ADJACENCY.value}".',
) =Field(None, description="The sequence found between adjoined sequences.")
768
+
) =Field(
769
+
default=None, description="The sequence found between adjoined sequences."
770
+
)
765
771
homology: bool|None=Field(
766
-
None,
772
+
default=None,
767
773
description="A flag indicating if coordinate ambiguity in the adjoined sequences is from sequence homology (true) or other uncertainty, such as instrument ambiguity (false).",
768
774
)
769
775
@@ -793,7 +799,8 @@ class Terminus(_VariationBase, BaseModelForbidExtra):
793
799
"""
794
800
795
801
type: Literal["Terminus"] =Field(
796
-
VrsType.TERMINUS.value, description=f'MUST be "{VrsType.TERMINUS.value}".'
802
+
default=VrsType.TERMINUS.value,
803
+
description=f'MUST be "{VrsType.TERMINUS.value}".',
797
804
)
798
805
location: iriReference|SequenceLocation=Field(
799
806
..., description="The location of the terminus."
@@ -812,15 +819,16 @@ class TraversalBlock(_ValueObject, BaseModelForbidExtra):
812
819
model_config=ConfigDict(use_enum_values=True)
813
820
814
821
type: Literal["TraversalBlock"] =Field(
815
-
VrsType.TRAVERSAL_BLOCK.value,
822
+
default=VrsType.TRAVERSAL_BLOCK.value,
816
823
description=f'MUST be "{VrsType.TRAVERSAL_BLOCK.value}".',
817
824
)
818
825
orientation: Orientation|None=Field(
819
-
None, description="The orientation of the molecular variation component."
826
+
default=None,
827
+
description="The orientation of the molecular variation component.",
0 commit comments