diff --git a/changelog.md b/changelog.md index c2a4d4557..cc0403f82 100644 --- a/changelog.md +++ b/changelog.md @@ -9,6 +9,26 @@ and (starting with v4.0.0) this project adheres to [Semantic Versioning](http:// ## [Released](https://github.com/HumanCellAtlas/metadata-schema/) +### [type/protocol/biomaterial_collection/dissociation_protocol.json - v6.3.0] - 2025-01-21 +### Changed +Changed user_friendly name of reagent field + +### [type/protocol/biomaterial_collection/dissociation_protocol.json - v6.4.0] - 2025-01-21 +### Added +Added optional digestion_time field + +### [type/protocol/biomaterial_collection/dissociation_protocol.json - v6.5.0] - 2025-01-21 +### Added +Added optional digestion_time_unit field + +### [type/protocol/biomaterial_collection/dissociation_protocol.json - v6.6.0] - 2025-01-21 +### Added +Added optional digestion_temperature field + +### [type/protocol/biomaterial_collection/dissociation_protocol.json - v6.7.0] - 2025-01-21 +### Added +Added optional digestion_solution field + ### [module/project/hca_bionetwork.json - v2.0.0] - 2025-01-20 ### Changed Changed enum value in hca_bionetwork.name. Fix #1600 diff --git a/docs/jsonBrowser/type.md b/docs/jsonBrowser/type.md index b933f9baa..77630e94b 100644 --- a/docs/jsonBrowser/type.md +++ b/docs/jsonBrowser/type.md @@ -190,7 +190,11 @@ schema_type | The type of the metadata schema entity. | string | yes | | | pro provenance | Provenance information provided by the system. | object | no | [See provenance](.md#provenance) | | | protocol_core | Core protocol-level information. | object | yes | [See core protocol_core](core.md#protocol-core) | Protocol core | | method | How cells or organelles were dissociated. | object | yes | [See module process_type_ontology](module.md#process-type-ontology) | Dissociation method | | -reagents | A list of purchased reagents used in this protocol. | array | no | [See module purchased_reagents](module.md#purchased-reagents) | Protocol reagents | | +reagents | A list of purchased reagents used in this protocol. | array | no | [See module purchased_reagents](module.md#purchased-reagents) | Purchased reagents | | +digestion_time | Time of digestion of the specimen. | integer | no | | Digestion time | | 2; 5; 10 +digestion_time_unit | The unit in which the digestion time is expressed. | object | no | [See module time_unit_ontology](module.md#time-unit-ontology) | Digestion time unit | | +digestion_temperature | Temperature of digestion in Celsius or in general terms (i.e. cold, warm, room temperature). | number or string | no | | Digestion temperature | frozen, cold, room temperature, warm | 4; 37; cold +digestion_solution | Enzyme(s) or reagent(s) of the solution that was used for the digestion of the specimen. | array | no | | Digestion solution | Citric-acid based, Detergent-based, Lysis buffer, Accutase, Collagenase, Collagenase A, Collagenase D, Collagenase I, Collagenase II, Collagenase IV, Dispase, Dispase II, DNAse I, Elastase, Hyaluronidase, Liberase, Papain, Protease, TrypLE, Trypsin | ## iPSC induction protocol _Information about how a biomaterial is treated to become an induced pluripotent stem cell._ diff --git a/json_schema/type/protocol/biomaterial_collection/dissociation_protocol.json b/json_schema/type/protocol/biomaterial_collection/dissociation_protocol.json index 3a87aad3a..76159dd55 100644 --- a/json_schema/type/protocol/biomaterial_collection/dissociation_protocol.json +++ b/json_schema/type/protocol/biomaterial_collection/dissociation_protocol.json @@ -54,7 +54,63 @@ "type": "object", "$ref": "module/process/purchased_reagents.json" }, - "user_friendly": "Protocol reagents" + "user_friendly": "Purchased reagents" + }, + "digestion_time": { + "description": "Time of digestion of the specimen.", + "type": "integer", + "example": "2; 5; 10", + "user_friendly": "Digestion time" + }, + "digestion_time_unit": { + "description": "The unit in which the digestion time is expressed.", + "type": "object", + "$ref": "module/ontology/time_unit_ontology.json", + "user_friendly": "Digestion time unit" + }, + "digestion_temperature": { + "description": "Temperature of digestion in Celsius or in general terms (i.e. cold, warm, room temperature).", + "oneOf": [ + { + "type": "number" + }, + { + "type": "string", + "enum": ["frozen", "cold", "room temperature", "warm"] + } + ], + "example": "4; 37; cold", + "user_friendly": "Digestion temperature" + }, + "digestion_solution": { + "description": "Enzyme(s) or reagent(s) of the solution that was used for the digestion of the specimen.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "Citric-acid based", + "Detergent-based", + "Lysis buffer", + "Accutase", + "Collagenase", + "Collagenase A", + "Collagenase D", + "Collagenase I", + "Collagenase II", + "Collagenase IV", + "Dispase", + "Dispase II", + "DNAse I", + "Elastase", + "Hyaluronidase", + "Liberase", + "Papain", + "Protease", + "TrypLE", + "Trypsin" + ] + }, + "user_friendly": "Digestion solution" } } } diff --git a/json_schema/versions.json b/json_schema/versions.json index cddbef5e2..62299a6e2 100644 --- a/json_schema/versions.json +++ b/json_schema/versions.json @@ -1,5 +1,5 @@ { - "last_update_date": "2025-01-20T10:24:12Z", + "last_update_date": "2025-01-21T10:14:27Z", "version_numbers": { "core": { "biomaterial": { @@ -124,7 +124,7 @@ "aggregate_generation_protocol": "2.1.0", "collection_protocol": "9.2.0", "differentiation_protocol": "2.2.0", - "dissociation_protocol": "6.2.0", + "dissociation_protocol": "6.7.0", "enrichment_protocol": "3.1.0", "ipsc_induction_protocol": "3.2.0", "treatment_protocol": "1.0.0" diff --git a/src/human_readable_json.py b/src/human_readable_json.py index d16c12eae..16cf2754f 100644 --- a/src/human_readable_json.py +++ b/src/human_readable_json.py @@ -116,6 +116,17 @@ def generateMarkdown(self, schemas, entity_type): # if link is not "": # print(schema["title"] + "\t "+ property + "\t"+ link) + + # add type values if oneOf values are there + oneOf_types = [t['type'] for t in schema['properties'][property]['oneOf'] if 'type' in t.keys()] if 'oneOf' in schema['properties'][property].keys() else [] + schema['properties'][property]['type'] = ' or '.join(oneOf_types) if 'type' not in schema['properties'][property].keys() else schema['properties'][property]['type'] + oneOf_enum = [] + if 'oneOf' in schema['properties'][property].keys(): + for t in schema['properties'][property]['oneOf']: + if 'enum' in t.keys(): + oneOf_enum.extend(t['enum']) + if oneOf_enum: + schema['properties'][property]['enum'] = oneOf_enum if 'enum' not in schema['properties'][property].keys() else schema['properties'][property]['enum'] if "enum" in schema["properties"][property]: enum_values = ", ".join(str(enum) for enum in schema["properties"][property]["enum"]) diff --git a/src/schema_linter.py b/src/schema_linter.py index 762dae047..70c484286 100644 --- a/src/schema_linter.py +++ b/src/schema_linter.py @@ -31,7 +31,7 @@ # Property attributes -property_attributes = ['description', 'type', 'pattern', 'example', 'enum', '$ref', 'user_friendly', 'items', 'guidelines', 'format', 'comment', 'maximum', 'minimum', 'oneOf', 'bionetworks'] +property_attributes = ['description', 'type', 'pattern', 'example', 'enum', '$ref', 'user_friendly', 'items', 'guidelines', 'format', 'comment', 'maximum', 'minimum', 'oneOf', 'oneOf', 'bionetworks'] ontology_attributes = ['graph_restriction', 'ontologies', 'classes', 'relations', 'direct', 'include_self'] @@ -138,12 +138,16 @@ def lintSchema(self, path, ols_api): if 'user_friendly' not in properties[property].keys() and property not in ['schema_version', 'schema_type', 'describedBy', 'provenance']: if schema_filename not in ['links']: errors.append(schema_filename + ".json: Keyword `user_friendly` missing from property `" + property + "`.") - + # Property must contain type attribute - if 'type' not in properties[property].keys(): + oneOf_types = [t['type'] for t in properties[property]['oneOf'] if 'type' in t.keys()] if \ + 'oneOf' in properties[property].keys() else [] + if 'type' not in properties[property].keys() and not oneOf_types: errors.append(schema_filename + ".json: Keyword `type` missing from property `" + property + "`.") else: + # assign type value to the property key + properties[property]['type'] = oneOf_types if 'type' not in properties[property].keys() else properties[property]['type'] # change property to list to test all values of array properties[property]['type'] = properties[property]['type'] if isinstance(properties[property]['type'], list) else [properties[property]['type']] @@ -151,7 +155,7 @@ def lintSchema(self, path, ols_api): # type attribute must be set to one of the valid JSON types if property_type not in ["string", "number", "boolean", "array", "object", "integer", "null"]: errors.append(schema_filename + ".json: Type `" + property_type + "` is not a valid JSON type.") - + # Property of type array must contain the attribute items if property_type == "array" and 'items' not in properties[property].keys(): errors.append(schema_filename + ".json: Property `" + property + "` is type array but doesn't contain items.")