Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release from staging to master 2025-01-21 #1603

Merged
merged 17 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion docs/jsonBrowser/type.md
Original file line number Diff line number Diff line change
Expand Up @@ -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._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
4 changes: 2 additions & 2 deletions json_schema/versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"last_update_date": "2025-01-20T10:24:12Z",
"last_update_date": "2025-01-21T10:14:27Z",
"version_numbers": {
"core": {
"biomaterial": {
Expand Down Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions src/human_readable_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
12 changes: 8 additions & 4 deletions src/schema_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -138,20 +138,24 @@ 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']]

for property_type in properties[property]['type']:
# 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.")
Expand Down
Loading