Skip to content

Commit 49d9d90

Browse files
committed
11.3.0rc1
1 parent 952553a commit 49d9d90

File tree

5 files changed

+132
-72
lines changed

5 files changed

+132
-72
lines changed

nmdc_schema/nmdc-pydantic.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,14 +2226,17 @@ class StatusEnum(str, Enum):
22262226
fail = "fail"
22272227

22282228

2229-
class AnalyteCategoryEnum(str, Enum):
2230-
metagenome = "metagenome"
2231-
metatranscriptome = "metatranscriptome"
2232-
metaproteome = "metaproteome"
2233-
metabolome = "metabolome"
2234-
lipidome = "lipidome"
2235-
nom = "nom"
2236-
amplicon_sequencing_assay = "amplicon_sequencing_assay"
2229+
class NucleotideSequencingEnum(str, Enum):
2230+
Metagenome = "metagenome"
2231+
Metatranscriptome = "metatranscriptome"
2232+
Amplicon = "amplicon_sequencing_assay"
2233+
2234+
2235+
class MassSpectrometryEnum(str, Enum):
2236+
Metaproteome = "metaproteome"
2237+
Metabolome = "metabolome"
2238+
Lipidome = "lipidome"
2239+
Natural_Organic_Matter = "nom"
22372240

22382241

22392242
class ExtractionTargetEnum(str, Enum):
@@ -10532,7 +10535,7 @@ class Biosample(Sample):
1053210535
'comments': ['Time should be entered as HH:MM(:SS) in GMT. See here for a '
1053310536
'converter: https://www.worldtimebuddy.com/pst-to-gmt-converter'],
1053410537
'domain_of': ['Biosample'],
10535-
'examples': [{'value': '813'}, {'value': '48835'}],
10538+
'examples': [{'value': '13:33'}, {'value': '13:33:55'}],
1053610539
'notes': ['MIxS collection_date accepts (truncated) ISO8601. DH taking '
1053710540
'seconds optional time only'],
1053810541
'rank': 1,
@@ -10544,7 +10547,7 @@ class Biosample(Sample):
1054410547
'comments': ['Time should be entered as HH:MM(:SS) in GMT. See here for a '
1054510548
'converter: https://www.worldtimebuddy.com/pst-to-gmt-converter'],
1054610549
'domain_of': ['Biosample'],
10547-
'examples': [{'value': '813'}, {'value': '48835'}],
10550+
'examples': [{'value': '13:33'}, {'value': '13:33:55'}],
1054810551
'notes': ['MIxS collection_date accepts (truncated) ISO8601. DH taking '
1054910552
'seconds optional time only'],
1055010553
'rank': 3,
@@ -10674,7 +10677,7 @@ class Biosample(Sample):
1067410677
'comments': ['Time should be entered as HH:MM(:SS) in GMT. See here for a '
1067510678
'converter: https://www.worldtimebuddy.com/pst-to-gmt-converter'],
1067610679
'domain_of': ['Biosample'],
10677-
'examples': [{'value': '813'}, {'value': '48835'}],
10680+
'examples': [{'value': '13:33'}, {'value': '13:33:55'}],
1067810681
'notes': ['MIxS collection_date accepts (truncated) ISO8601. DH taking '
1067910682
'seconds optional time only'],
1068010683
'rank': 5,
@@ -15215,7 +15218,7 @@ class DataGeneration(PlannedProcess):
1521515218
'syntax': '{id_nmdc_prefix}:(dobj)-{id_shoulder}-{id_blade}$'}}}})
1521615219

1521715220
add_date: Optional[str] = Field(None, description="""The date on which the information was added to the database.""", json_schema_extra = { "linkml_meta": {'alias': 'add_date', 'domain_of': ['Biosample', 'DataGeneration']} })
15218-
analyte_category: AnalyteCategoryEnum = Field(..., description="""The type of analyte(s) that were measured in the data generation process and analyzed
15221+
analyte_category: str = Field(..., description="""The type of analyte(s) that were measured in the data generation process and analyzed
1521915222
in the Workflow Chain
1522015223
""", json_schema_extra = { "linkml_meta": {'alias': 'analyte_category', 'domain_of': ['DataGeneration']} })
1522115224
associated_studies: List[str] = Field(..., description="""The study associated with a resource.""", json_schema_extra = { "linkml_meta": {'alias': 'associated_studies',
@@ -15368,7 +15371,9 @@ class NucleotideSequencing(DataGeneration):
1536815371
'comments': ['For example data generated from an Illumina or Pacific '
1536915372
'Biosciences instrument.'],
1537015373
'from_schema': 'https://w3id.org/nmdc/nmdc',
15371-
'slot_usage': {'id': {'name': 'id',
15374+
'slot_usage': {'analyte_category': {'name': 'analyte_category',
15375+
'range': 'NucleotideSequencingEnum'},
15376+
'id': {'name': 'id',
1537215377
'pattern': '^(nmdc):(dgns|omprc)-([0-9][a-z]{0,6}[0-9])-([A-Za-z0-9]{1,})$',
1537315378
'structured_pattern': {'interpolated': True,
1537415379
'syntax': '{id_nmdc_prefix}:(dgns|omprc)-{id_shoulder}-{id_blade}$'}}}})
@@ -15414,7 +15419,7 @@ class NucleotideSequencing(DataGeneration):
1541415419
'slot_uri': 'MIXS:0000045',
1541515420
'string_serialization': '{text}'} })
1541615421
add_date: Optional[str] = Field(None, description="""The date on which the information was added to the database.""", json_schema_extra = { "linkml_meta": {'alias': 'add_date', 'domain_of': ['Biosample', 'DataGeneration']} })
15417-
analyte_category: AnalyteCategoryEnum = Field(..., description="""The type of analyte(s) that were measured in the data generation process and analyzed
15422+
analyte_category: NucleotideSequencingEnum = Field(..., description="""The type of analyte(s) that were measured in the data generation process and analyzed
1541815423
in the Workflow Chain
1541915424
""", json_schema_extra = { "linkml_meta": {'alias': 'analyte_category', 'domain_of': ['DataGeneration']} })
1542015425
associated_studies: List[str] = Field(..., description="""The study associated with a resource.""", json_schema_extra = { "linkml_meta": {'alias': 'associated_studies',
@@ -15621,7 +15626,9 @@ class MassSpectrometry(DataGeneration):
1562115626
{'equals_string': 'gas_chromatography'}],
1562215627
'name': 'eluent_introduction_category'}}},
1562315628
'title': 'has_chromatography_configuration_required_if_lc_or_gc'}],
15624-
'slot_usage': {'has_chromatography_configuration': {'name': 'has_chromatography_configuration',
15629+
'slot_usage': {'analyte_category': {'name': 'analyte_category',
15630+
'range': 'MassSpectrometryEnum'},
15631+
'has_chromatography_configuration': {'name': 'has_chromatography_configuration',
1562515632
'pattern': '^(nmdc):chrcon-([0-9][a-z]{0,6}[0-9])-([A-Za-z0-9]{1,})$',
1562615633
'structured_pattern': {'interpolated': True,
1562715634
'syntax': '{id_nmdc_prefix}:chrcon-{id_shoulder}-{id_blade}$'}},
@@ -15653,7 +15660,7 @@ class MassSpectrometry(DataGeneration):
1565315660
'structured_pattern': {'interpolated': True,
1565415661
'syntax': '{id_nmdc_prefix}:mscon-{id_shoulder}-{id_blade}$'}} })
1565515662
add_date: Optional[str] = Field(None, description="""The date on which the information was added to the database.""", json_schema_extra = { "linkml_meta": {'alias': 'add_date', 'domain_of': ['Biosample', 'DataGeneration']} })
15656-
analyte_category: AnalyteCategoryEnum = Field(..., description="""The type of analyte(s) that were measured in the data generation process and analyzed
15663+
analyte_category: MassSpectrometryEnum = Field(..., description="""The type of analyte(s) that were measured in the data generation process and analyzed
1565715664
in the Workflow Chain
1565815665
""", json_schema_extra = { "linkml_meta": {'alias': 'analyte_category', 'domain_of': ['DataGeneration']} })
1565915666
associated_studies: List[str] = Field(..., description="""The study associated with a resource.""", json_schema_extra = { "linkml_meta": {'alias': 'associated_studies',

nmdc_schema/nmdc.py

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Auto generated from nmdc.yaml by pythongen.py version: 0.0.1
2-
# Generation date: 2024-12-07T20:12:39
2+
# Generation date: 2025-01-08T12:52:37
33
# Schema: NMDC
44
#
55
# id: https://w3id.org/nmdc/nmdc
@@ -5626,7 +5626,7 @@ class DataGeneration(PlannedProcess):
56265626

56275627
id: Union[str, DataGenerationId] = None
56285628
type: Union[str, URIorCURIE] = None
5629-
analyte_category: Union[str, "AnalyteCategoryEnum"] = None
5629+
analyte_category: str = None
56305630
associated_studies: Union[Union[str, StudyId], List[Union[str, StudyId]]] = None
56315631
has_input: Union[Union[str, SampleId], List[Union[str, SampleId]]] = None
56325632
add_date: Optional[str] = None
@@ -5638,8 +5638,8 @@ class DataGeneration(PlannedProcess):
56385638
def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
56395639
if self._is_empty(self.analyte_category):
56405640
self.MissingRequiredField("analyte_category")
5641-
if not isinstance(self.analyte_category, AnalyteCategoryEnum):
5642-
self.analyte_category = AnalyteCategoryEnum(self.analyte_category)
5641+
if not isinstance(self.analyte_category, str):
5642+
self.analyte_category = str(self.analyte_category)
56435643

56445644
if self._is_empty(self.associated_studies):
56455645
self.MissingRequiredField("associated_studies")
@@ -5690,9 +5690,9 @@ class NucleotideSequencing(DataGeneration):
56905690

56915691
id: Union[str, NucleotideSequencingId] = None
56925692
type: Union[str, URIorCURIE] = None
5693-
analyte_category: Union[str, "AnalyteCategoryEnum"] = None
56945693
associated_studies: Union[Union[str, StudyId], List[Union[str, StudyId]]] = None
56955694
has_input: Union[Union[str, SampleId], List[Union[str, SampleId]]] = None
5695+
analyte_category: Union[str, "NucleotideSequencingEnum"] = None
56965696
gold_sequencing_project_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list()
56975697
insdc_bioproject_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list()
56985698
insdc_experiment_identifiers: Optional[Union[Union[str, ExternalIdentifier], List[Union[str, ExternalIdentifier]]]] = empty_list()
@@ -5706,6 +5706,11 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
57065706
if not isinstance(self.id, NucleotideSequencingId):
57075707
self.id = NucleotideSequencingId(self.id)
57085708

5709+
if self._is_empty(self.analyte_category):
5710+
self.MissingRequiredField("analyte_category")
5711+
if not isinstance(self.analyte_category, NucleotideSequencingEnum):
5712+
self.analyte_category = NucleotideSequencingEnum(self.analyte_category)
5713+
57095714
if not isinstance(self.gold_sequencing_project_identifiers, list):
57105715
self.gold_sequencing_project_identifiers = [self.gold_sequencing_project_identifiers] if self.gold_sequencing_project_identifiers is not None else []
57115716
self.gold_sequencing_project_identifiers = [v if isinstance(v, ExternalIdentifier) else ExternalIdentifier(v) for v in self.gold_sequencing_project_identifiers]
@@ -5748,9 +5753,9 @@ class MassSpectrometry(DataGeneration):
57485753

57495754
id: Union[str, MassSpectrometryId] = None
57505755
type: Union[str, URIorCURIE] = None
5751-
analyte_category: Union[str, "AnalyteCategoryEnum"] = None
57525756
associated_studies: Union[Union[str, StudyId], List[Union[str, StudyId]]] = None
57535757
has_input: Union[Union[str, SampleId], List[Union[str, SampleId]]] = None
5758+
analyte_category: Union[str, "MassSpectrometryEnum"] = None
57545759
eluent_introduction_category: Optional[Union[str, "EluentIntroductionCategoryEnum"]] = None
57555760
generates_calibration: Optional[Union[str, CalibrationInformationId]] = None
57565761
has_chromatography_configuration: Optional[Union[str, ChromatographyConfigurationId]] = None
@@ -5762,6 +5767,11 @@ def __post_init__(self, *_: List[str], **kwargs: Dict[str, Any]):
57625767
if not isinstance(self.id, MassSpectrometryId):
57635768
self.id = MassSpectrometryId(self.id)
57645769

5770+
if self._is_empty(self.analyte_category):
5771+
self.MissingRequiredField("analyte_category")
5772+
if not isinstance(self.analyte_category, MassSpectrometryEnum):
5773+
self.analyte_category = MassSpectrometryEnum(self.analyte_category)
5774+
57655775
if self.eluent_introduction_category is not None and not isinstance(self.eluent_introduction_category, EluentIntroductionCategoryEnum):
57665776
self.eluent_introduction_category = EluentIntroductionCategoryEnum(self.eluent_introduction_category)
57675777

@@ -7713,20 +7723,27 @@ def _addvals(cls):
77137723
setattr(cls, "pass",
77147724
PermissibleValue(text="pass"))
77157725

7716-
class AnalyteCategoryEnum(EnumDefinitionImpl):
7726+
class NucleotideSequencingEnum(EnumDefinitionImpl):
77177727

77187728
metagenome = PermissibleValue(text="metagenome")
77197729
metatranscriptome = PermissibleValue(text="metatranscriptome")
7730+
amplicon_sequencing_assay = PermissibleValue(
7731+
text="amplicon_sequencing_assay",
7732+
meaning=OBI["0002767"])
7733+
7734+
_defn = EnumDefinition(
7735+
name="NucleotideSequencingEnum",
7736+
)
7737+
7738+
class MassSpectrometryEnum(EnumDefinitionImpl):
7739+
77207740
metaproteome = PermissibleValue(text="metaproteome")
77217741
metabolome = PermissibleValue(text="metabolome")
77227742
lipidome = PermissibleValue(text="lipidome")
77237743
nom = PermissibleValue(text="nom")
7724-
amplicon_sequencing_assay = PermissibleValue(
7725-
text="amplicon_sequencing_assay",
7726-
meaning=OBI["0002767"])
77277744

77287745
_defn = EnumDefinition(
7729-
name="AnalyteCategoryEnum",
7746+
name="MassSpectrometryEnum",
77307747
)
77317748

77327749
class ExtractionTargetEnum(EnumDefinitionImpl):
@@ -10854,7 +10871,7 @@ class slots:
1085410871
model_uri=NMDC.file_size_bytes, domain=None, range=Optional[int])
1085510872

1085610873
slots.analyte_category = Slot(uri=NMDC.analyte_category, name="analyte_category", curie=NMDC.curie('analyte_category'),
10857-
model_uri=NMDC.analyte_category, domain=None, range=Union[str, "AnalyteCategoryEnum"])
10874+
model_uri=NMDC.analyte_category, domain=None, range=str)
1085810875

1085910876
slots.type = Slot(uri=RDF.type, name="type", curie=RDF.curie('type'),
1086010877
model_uri=NMDC.type, domain=None, range=Union[str, URIorCURIE])
@@ -12534,6 +12551,9 @@ class slots:
1253412551
model_uri=NMDC.NucleotideSequencing_id, domain=NucleotideSequencing, range=Union[str, NucleotideSequencingId],
1253512552
pattern=re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_\.]+:[a-zA-Z0-9_][a-zA-Z0-9_\-\/\.,]*$'))
1253612553

12554+
slots.NucleotideSequencing_analyte_category = Slot(uri=NMDC.analyte_category, name="NucleotideSequencing_analyte_category", curie=NMDC.curie('analyte_category'),
12555+
model_uri=NMDC.NucleotideSequencing_analyte_category, domain=NucleotideSequencing, range=Union[str, "NucleotideSequencingEnum"])
12556+
1253712557
slots.MassSpectrometry_id = Slot(uri=NMDC.id, name="MassSpectrometry_id", curie=NMDC.curie('id'),
1253812558
model_uri=NMDC.MassSpectrometry_id, domain=MassSpectrometry, range=Union[str, MassSpectrometryId],
1253912559
pattern=re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_\.]+:[a-zA-Z0-9_][a-zA-Z0-9_\-\/\.,]*$'))
@@ -12544,6 +12564,9 @@ class slots:
1254412564
slots.MassSpectrometry_has_mass_spectrometry_configuration = Slot(uri=NMDC.has_mass_spectrometry_configuration, name="MassSpectrometry_has_mass_spectrometry_configuration", curie=NMDC.curie('has_mass_spectrometry_configuration'),
1254512565
model_uri=NMDC.MassSpectrometry_has_mass_spectrometry_configuration, domain=MassSpectrometry, range=Optional[Union[str, MassSpectrometryConfigurationId]])
1254612566

12567+
slots.MassSpectrometry_analyte_category = Slot(uri=NMDC.analyte_category, name="MassSpectrometry_analyte_category", curie=NMDC.curie('analyte_category'),
12568+
model_uri=NMDC.MassSpectrometry_analyte_category, domain=MassSpectrometry, range=Union[str, "MassSpectrometryEnum"])
12569+
1254712570
slots.MassSpectrometryConfiguration_name = Slot(uri=NMDC.name, name="MassSpectrometryConfiguration_name", curie=NMDC.curie('name'),
1254812571
model_uri=NMDC.MassSpectrometryConfiguration_name, domain=MassSpectrometryConfiguration, range=str)
1254912572

nmdc_schema/nmdc.schema.json

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,6 @@
1515
"title": "AnalysisTypeEnum",
1616
"type": "string"
1717
},
18-
"AnalyteCategoryEnum": {
19-
"description": "",
20-
"enum": [
21-
"metagenome",
22-
"metatranscriptome",
23-
"metaproteome",
24-
"metabolome",
25-
"lipidome",
26-
"nom",
27-
"amplicon_sequencing_assay"
28-
],
29-
"title": "AnalyteCategoryEnum",
30-
"type": "string"
31-
},
3218
"ArchStrucEnum": {
3319
"description": "",
3420
"enum": [
@@ -9750,7 +9736,7 @@
97509736
]
97519737
},
97529738
"analyte_category": {
9753-
"$ref": "#/$defs/AnalyteCategoryEnum",
9739+
"$ref": "#/$defs/MassSpectrometryEnum",
97549740
"description": "The type of analyte(s) that were measured in the data generation process and analyzed\n in the Workflow Chain\n"
97559741
},
97569742
"associated_studies": {
@@ -10012,6 +9998,17 @@
100129998
"title": "MassSpectrometryConfiguration",
100139999
"type": "object"
1001410000
},
10001+
"MassSpectrometryEnum": {
10002+
"description": "",
10003+
"enum": [
10004+
"metaproteome",
10005+
"metabolome",
10006+
"lipidome",
10007+
"nom"
10008+
],
10009+
"title": "MassSpectrometryEnum",
10010+
"type": "string"
10011+
},
1001510012
"MassSpectrumCollectionModeEnum": {
1001610013
"description": "",
1001710014
"enum": [
@@ -12479,7 +12476,7 @@
1247912476
]
1248012477
},
1248112478
"analyte_category": {
12482-
"$ref": "#/$defs/AnalyteCategoryEnum",
12479+
"$ref": "#/$defs/NucleotideSequencingEnum",
1248312480
"description": "The type of analyte(s) that were measured in the data generation process and analyzed\n in the Workflow Chain\n"
1248412481
},
1248512482
"associated_studies": {
@@ -12672,6 +12669,16 @@
1267212669
"title": "NucleotideSequencing",
1267312670
"type": "object"
1267412671
},
12672+
"NucleotideSequencingEnum": {
12673+
"description": "",
12674+
"enum": [
12675+
"metagenome",
12676+
"metatranscriptome",
12677+
"amplicon_sequencing_assay"
12678+
],
12679+
"title": "NucleotideSequencingEnum",
12680+
"type": "string"
12681+
},
1267512682
"OccupDocumentEnum": {
1267612683
"description": "",
1267712684
"enum": [

0 commit comments

Comments
 (0)