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

Added enzymatic tissue dissociation fields #1599

Open
wants to merge 12 commits into
base: staging
Choose a base branch
from
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"
}
}
}
5 changes: 5 additions & 0 deletions json_schema/update_log.csv
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Schema,Change type,Change message,Version,Date
type/protocol/biomaterial_collection/dissociation_protocol,minor,Changed user_friendly name of reagent field,,
type/protocol/biomaterial_collection/dissociation_protocol,minor,Added optional digestion_time field,,
type/protocol/biomaterial_collection/dissociation_protocol,minor,Added optional digestion_time_unit field,,
type/protocol/biomaterial_collection/dissociation_protocol,minor,Added optional digestion_temperature field,,
type/protocol/biomaterial_collection/dissociation_protocol,minor,Added optional digestion_solution field,,
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