From edae7e22f3c1caec4569343dab4ce2d32567916c Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 20 Jan 2023 22:09:52 +0000 Subject: [PATCH 01/12] refactor: re-organizing the repo --- .travis.yml | 11 +- README.md | 0 opentargets_chemical_probe.json | 109 --------- opentargets_target_safety.json | 208 ------------------ opentargets_tep.json => schemas/TEP.json | 0 .../disease_target_evidence.json | 0 ...son => molecular_interactions-output.json} | 0 .../molecular_interactions.json | 0 8 files changed, 3 insertions(+), 325 deletions(-) create mode 100644 README.md delete mode 100644 opentargets_chemical_probe.json delete mode 100644 opentargets_target_safety.json rename opentargets_tep.json => schemas/TEP.json (100%) rename opentargets.json => schemas/disease_target_evidence.json (100%) rename schemas/{molecular_interaction_evidence.json => molecular_interactions-output.json} (100%) rename OT_network_schema.json => schemas/molecular_interactions.json (100%) diff --git a/.travis.yml b/.travis.yml index fc3e2a46..28a48799 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,8 @@ language: python python: - - "3.6" + - "3.8" install: - - pip install git+https://github.com/Julian/jsonschema.git@v3.0.2#egg=jsonschema + - pip install git+https://github.com/python-jsonschema/check-jsonschema.git@0.20.0#egg=check-jsonschema - wget -O draft7.json http://json-schema.org/draft-07/schema - - wget -O draft4.json http://json-schema.org/draft-04/schema script: - - jsonschema -i opentargets_chemical_probe.json draft7.json - - jsonschema -i opentargets_target_safety.json draft7.json - - jsonschema -i opentargets_tep.json draft7.json - - jsonschema -i opentargets.json draft7.json - - jsonschema -i OT_network_schema.json draft4.json + - for f in $(ls schemas/*json); do check-jsonschema --schemafile draft7.json $f ;done diff --git a/README.md b/README.md new file mode 100644 index 00000000..e69de29b diff --git a/opentargets_chemical_probe.json b/opentargets_chemical_probe.json deleted file mode 100644 index c34bfec0..00000000 --- a/opentargets_chemical_probe.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "title": "OpenTargets-chemical-probes", - "description": "OpenTargets Chemical Probes model.", - "type": "object", - "properties": { - "targetFromSourceId": { - "description": "Gene symbol in resource of origin.", - "examples": ["ESR1"], - "type": "string" - }, - "id": { - "description": "Probe ID as reported in Probes&Drugs.", - "examples": ["IOX1"], - "type": "string" - }, - "control": { - "description": "Inactive analogue of the probe.", - "examples": ["PF-04875474"], - "type": "string" - }, - "drugId": { - "description": "Drug molecule ID.", - "examples": ["CHEMBL1651534"], - "type": "string" - }, - "urls": { - "type": "array", - "items": { - "$ref": "#/definitions/url" - } - }, - "probesDrugsScore": { - "description": "P&D probe-likeness score.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "probeMinerScore": { - "description": "Probe Miner probe-likeness score.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "scoreInCells": { - "description": "ChemicalProbes.org score for probe-likeness to be used in model cells.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "scoreInOrganisms": { - "description": "ChemicalProbes.org score for probe-likeness to be used in model organisms.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "mechanismOfAction": { - "description": "Mechanism of action of the probe.", - "examples": [ - "blocker" - ], - "type": "array", - "items": { - "type": "string" - } - }, - "isHighQuality": { - "description": "True if selected as high quality by P&D.", - "type": "boolean" - }, - "origin": { - "description": "Origin of the probe.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "experimental", - "calculated" - ], - "minItems": 1, - "uniqueItems": true - } - } - }, - "required": [ - "targetFromSourceId", - "id", - "urls", - "isHighQuality", - "origin" - ], - "additionalProperties": false, - "definitions": { - "url": { - "type": "object", - "properties": { - "niceName": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "niceName" - ], - "additionalProperties": false - } - } - } diff --git a/opentargets_target_safety.json b/opentargets_target_safety.json deleted file mode 100644 index eea18e28..00000000 --- a/opentargets_target_safety.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "title": "OpenTargets-target-safety", - "description": "OpenTargets Target Safety Liabilities model.", - "type": "object", - "properties": { - "id": { - "title": "Id", - "description": "Target ID (accepted sources include Ensembl gene ID, Uniprot ID).", - "examples": [ - "ENSG00000133019" - ], - "type": "string" - }, - "targetFromSourceId": { - "title": "Targetfromsourceid", - "description": "Gene symbol in resource of origin.", - "examples": [ - "ESR1" - ], - "type": "string" - }, - "event": { - "title": "Event", - "description": "Identifier of the biological process in the EFO ontology.", - "examples": [ - "arrhythmia" - ], - "type": "string" - }, - "eventId": { - "title": "Eventid", - "description": "Identifier of the safety event in the EFO ontology.", - "examples": [ - "EFO_0004269" - ], - "type": "string" - }, - "biosamples": { - "$ref": "#/definitions/Biosamples" - }, - "effects": { - "$ref": "#/definitions/Effects" - }, - "isHumanApplicable": { - "title": "Ishumanapplicable", - "description": "Flag that reports whether a target is relevant in the reported adverse outcome pathway.", - "type": "boolean" - }, - "datasource": { - "title": "Datasource", - "description": "Source of safety event.", - "type": "string", - "enum": [ - "Force et al. (2011)", - "Lamore et al. (2017)", - "Lynch et al. (2017)", - "Bowes et al. (2012)", - "Urban et al. (2012)", - "ToxCast", - "AOP-Wiki" - ] - }, - "literature": { - "title": "Literature", - "description": "PubMed reference identifier.", - "pattern": "\\d+$", - "type": "string" - }, - "studies": { - "$ref": "#/definitions/Studies" - }, - "url": { - "title": "Url", - "type": "string" - } - }, - "required": [ - "event", - "datasource" - ], - "additionalProperties": false, - "definitions": { - "Biosample": { - "title": "Biosample", - "description": "Anatomical structures referenced in resource.", - "type": "object", - "properties": { - "cellFormat": { - "title": "Cellformat", - "description": "Cellular or subcellular format of the assay.", - "examples": [ - "cell line" - ], - "type": "string" - }, - "cellLabel": { - "title": "Celllabel", - "description": "Name of the cell line or primary cell in source.", - "examples": [ - "T47D" - ], - "type": "string" - }, - "tissueId": { - "title": "Tissueid", - "description": "Identifier of the tissue in the UBERON ontology.", - "examples": [ - "UBERON_0004535" - ], - "type": "string" - }, - "tissueLabel": { - "title": "Tissuelabel", - "description": "Anatomical entity at an organ-level of the protein or cell used in the assay.", - "examples": [ - "cardiovascular system" - ], - "type": "string" - } - }, - "additionalProperties": false - }, - "Biosamples": { - "title": "Biosamples", - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/definitions/Biosample" - } - }, - "Effect": { - "title": "Effect", - "description": "Effect on target modulation.", - "type": "object", - "properties": { - "direction": { - "title": "Direction", - "description": "Direction of the effect.", - "type": "string", - "enum": [ - "inhibition", - "activation" - ] - }, - "dosing": { - "title": "Dosing", - "description": "Required dose to achieve the response.", - "type": "string", - "enum": [ - "general", - "developmental toxicity", - "chronic", - "acute" - ] - } - }, - "required": [ - "direction" - ], - "additionalProperties": false - }, - "Effects": { - "title": "Effects", - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/definitions/Effect" - } - }, - "Study": { - "title": "Study", - "description": "Characteristics of the study.", - "type": "object", - "properties": { - "description": { - "title": "Description", - "description": "Description of the study.", - "type": "string" - }, - "name": { - "title": "Name", - "description": "Name of the study.", - "examples": [ - "ACEA_ER_80hr" - ], - "type": "string" - }, - "type": { - "title": "Type", - "description": "Conceptual biological and/or chemical features of the study.", - "examples": [ - "cell-based" - ], - "type": "string" - } - }, - "additionalProperties": false - }, - "Studies": { - "title": "Studies", - "uniqueItems": true, - "type": "array", - "items": { - "$ref": "#/definitions/Study" - } - } - } -} \ No newline at end of file diff --git a/opentargets_tep.json b/schemas/TEP.json similarity index 100% rename from opentargets_tep.json rename to schemas/TEP.json diff --git a/opentargets.json b/schemas/disease_target_evidence.json similarity index 100% rename from opentargets.json rename to schemas/disease_target_evidence.json diff --git a/schemas/molecular_interaction_evidence.json b/schemas/molecular_interactions-output.json similarity index 100% rename from schemas/molecular_interaction_evidence.json rename to schemas/molecular_interactions-output.json diff --git a/OT_network_schema.json b/schemas/molecular_interactions.json similarity index 100% rename from OT_network_schema.json rename to schemas/molecular_interactions.json From 8ae6731c23ef4def1eb7bf9ca67dc25101181463 Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 20 Jan 2023 22:27:51 +0000 Subject: [PATCH 02/12] docs: addig readme --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index e69de29b..e87d2b9e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,17 @@ +# Schemas of the OpenTargets Platform data models + +This repository contains schema definitions of some of the data models the OpenTargets Platform deals with. +Either as an input or generates as an output. + +**Folders**: +- `/schemas/` - List of schemas in JSON format. +- `/pydantic_models/` - Definitions of the data models using Python's [Pydantic](https://docs.pydantic.dev/) tool. + +## Available schemas + +- `TEP.json`: Description of [Target Enabling Packages](https://platform-docs.opentargets.org/target/chemical-probes-and-teps#target-enabling-packages). +- `chemical_probes.json`: Description of the [chemical probes](https://platform-docs.opentargets.org/target/chemical-probes-and-teps#chemical-probes) data model. +- `disease_target_evidence.json`: Description of disease-target evidence input. Separate schemas are defined for each data sources. +- `target_safety.json`: Description of [target safety](https://platform-docs.opentargets.org/target/safety). +- `molecular_interactions.json`: Definition of the [molecular interactions](https://platform-docs.opentargets.org/target/molecular-interactions) input. +- `molecular_interactions-output.json`: Definition for the molecular interactions dataset generated by the Platform ETL. From 4a440bc41db5029ab88e9a0444d8c70c23b1c1f9 Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 20 Jan 2023 22:34:36 +0000 Subject: [PATCH 03/12] fix: forgot about some files --- schemas/chemical_probes.json | 109 ++++++++++++++++++ schemas/target_safety.json | 208 +++++++++++++++++++++++++++++++++++ 2 files changed, 317 insertions(+) create mode 100644 schemas/chemical_probes.json create mode 100644 schemas/target_safety.json diff --git a/schemas/chemical_probes.json b/schemas/chemical_probes.json new file mode 100644 index 00000000..c34bfec0 --- /dev/null +++ b/schemas/chemical_probes.json @@ -0,0 +1,109 @@ +{ + "title": "OpenTargets-chemical-probes", + "description": "OpenTargets Chemical Probes model.", + "type": "object", + "properties": { + "targetFromSourceId": { + "description": "Gene symbol in resource of origin.", + "examples": ["ESR1"], + "type": "string" + }, + "id": { + "description": "Probe ID as reported in Probes&Drugs.", + "examples": ["IOX1"], + "type": "string" + }, + "control": { + "description": "Inactive analogue of the probe.", + "examples": ["PF-04875474"], + "type": "string" + }, + "drugId": { + "description": "Drug molecule ID.", + "examples": ["CHEMBL1651534"], + "type": "string" + }, + "urls": { + "type": "array", + "items": { + "$ref": "#/definitions/url" + } + }, + "probesDrugsScore": { + "description": "P&D probe-likeness score.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "probeMinerScore": { + "description": "Probe Miner probe-likeness score.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "scoreInCells": { + "description": "ChemicalProbes.org score for probe-likeness to be used in model cells.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "scoreInOrganisms": { + "description": "ChemicalProbes.org score for probe-likeness to be used in model organisms.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "mechanismOfAction": { + "description": "Mechanism of action of the probe.", + "examples": [ + "blocker" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "isHighQuality": { + "description": "True if selected as high quality by P&D.", + "type": "boolean" + }, + "origin": { + "description": "Origin of the probe.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "experimental", + "calculated" + ], + "minItems": 1, + "uniqueItems": true + } + } + }, + "required": [ + "targetFromSourceId", + "id", + "urls", + "isHighQuality", + "origin" + ], + "additionalProperties": false, + "definitions": { + "url": { + "type": "object", + "properties": { + "niceName": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "niceName" + ], + "additionalProperties": false + } + } + } diff --git a/schemas/target_safety.json b/schemas/target_safety.json new file mode 100644 index 00000000..eea18e28 --- /dev/null +++ b/schemas/target_safety.json @@ -0,0 +1,208 @@ +{ + "title": "OpenTargets-target-safety", + "description": "OpenTargets Target Safety Liabilities model.", + "type": "object", + "properties": { + "id": { + "title": "Id", + "description": "Target ID (accepted sources include Ensembl gene ID, Uniprot ID).", + "examples": [ + "ENSG00000133019" + ], + "type": "string" + }, + "targetFromSourceId": { + "title": "Targetfromsourceid", + "description": "Gene symbol in resource of origin.", + "examples": [ + "ESR1" + ], + "type": "string" + }, + "event": { + "title": "Event", + "description": "Identifier of the biological process in the EFO ontology.", + "examples": [ + "arrhythmia" + ], + "type": "string" + }, + "eventId": { + "title": "Eventid", + "description": "Identifier of the safety event in the EFO ontology.", + "examples": [ + "EFO_0004269" + ], + "type": "string" + }, + "biosamples": { + "$ref": "#/definitions/Biosamples" + }, + "effects": { + "$ref": "#/definitions/Effects" + }, + "isHumanApplicable": { + "title": "Ishumanapplicable", + "description": "Flag that reports whether a target is relevant in the reported adverse outcome pathway.", + "type": "boolean" + }, + "datasource": { + "title": "Datasource", + "description": "Source of safety event.", + "type": "string", + "enum": [ + "Force et al. (2011)", + "Lamore et al. (2017)", + "Lynch et al. (2017)", + "Bowes et al. (2012)", + "Urban et al. (2012)", + "ToxCast", + "AOP-Wiki" + ] + }, + "literature": { + "title": "Literature", + "description": "PubMed reference identifier.", + "pattern": "\\d+$", + "type": "string" + }, + "studies": { + "$ref": "#/definitions/Studies" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "required": [ + "event", + "datasource" + ], + "additionalProperties": false, + "definitions": { + "Biosample": { + "title": "Biosample", + "description": "Anatomical structures referenced in resource.", + "type": "object", + "properties": { + "cellFormat": { + "title": "Cellformat", + "description": "Cellular or subcellular format of the assay.", + "examples": [ + "cell line" + ], + "type": "string" + }, + "cellLabel": { + "title": "Celllabel", + "description": "Name of the cell line or primary cell in source.", + "examples": [ + "T47D" + ], + "type": "string" + }, + "tissueId": { + "title": "Tissueid", + "description": "Identifier of the tissue in the UBERON ontology.", + "examples": [ + "UBERON_0004535" + ], + "type": "string" + }, + "tissueLabel": { + "title": "Tissuelabel", + "description": "Anatomical entity at an organ-level of the protein or cell used in the assay.", + "examples": [ + "cardiovascular system" + ], + "type": "string" + } + }, + "additionalProperties": false + }, + "Biosamples": { + "title": "Biosamples", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/definitions/Biosample" + } + }, + "Effect": { + "title": "Effect", + "description": "Effect on target modulation.", + "type": "object", + "properties": { + "direction": { + "title": "Direction", + "description": "Direction of the effect.", + "type": "string", + "enum": [ + "inhibition", + "activation" + ] + }, + "dosing": { + "title": "Dosing", + "description": "Required dose to achieve the response.", + "type": "string", + "enum": [ + "general", + "developmental toxicity", + "chronic", + "acute" + ] + } + }, + "required": [ + "direction" + ], + "additionalProperties": false + }, + "Effects": { + "title": "Effects", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/definitions/Effect" + } + }, + "Study": { + "title": "Study", + "description": "Characteristics of the study.", + "type": "object", + "properties": { + "description": { + "title": "Description", + "description": "Description of the study.", + "type": "string" + }, + "name": { + "title": "Name", + "description": "Name of the study.", + "examples": [ + "ACEA_ER_80hr" + ], + "type": "string" + }, + "type": { + "title": "Type", + "description": "Conceptual biological and/or chemical features of the study.", + "examples": [ + "cell-based" + ], + "type": "string" + } + }, + "additionalProperties": false + }, + "Studies": { + "title": "Studies", + "uniqueItems": true, + "type": "array", + "items": { + "$ref": "#/definitions/Study" + } + } + } +} \ No newline at end of file From 87f81ee8a201214fa92b3147f797d8327c3c4c3d Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:09:42 +0200 Subject: [PATCH 04/12] adding pre-commit checks --- .pre-commit-config.yaml | 7 +++++++ schemas/disease_target_evidence.json | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..aab790e4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.22.0 + hooks: + - id: check-metaschema + name: "Validating schema definition against draft schemas" + files: ^schemas/.*json$ + types: [json] diff --git a/schemas/disease_target_evidence.json b/schemas/disease_target_evidence.json index 83c01ffb..24600fea 100644 --- a/schemas/disease_target_evidence.json +++ b/schemas/disease_target_evidence.json @@ -900,7 +900,6 @@ "projectId", "projectDescription", "resourceScore", - "studyOverview", "studyId" ], "additionalProperties": false From 9d0fd7281240d7c643c57982393c06649bfed452 Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:13:26 +0200 Subject: [PATCH 05/12] fix: typo in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e87d2b9e..4ceae55d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This repository contains schema definitions of some of the data models the OpenT Either as an input or generates as an output. **Folders**: + - `/schemas/` - List of schemas in JSON format. - `/pydantic_models/` - Definitions of the data models using Python's [Pydantic](https://docs.pydantic.dev/) tool. From a8ffb3679a1a976936c37ebb9997dd72de7dce3c Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:17:32 +0200 Subject: [PATCH 06/12] tesing improved pre-commit --- .pre-commit-config.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aab790e4..d6294353 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,18 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-merge-conflict + - id: check-json + - id: check-yaml + - id: pretty-format-json + args: + - --autofix + - --no-ensure-ascii + - --no-sort-keys + - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.22.0 hooks: From dc211b6a2dbe7cf7ef795937cd871253cc3bbcce Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:19:23 +0200 Subject: [PATCH 07/12] schemas fixed by pre-commit --- .pre-commit-config.yaml | 14 +- .travis.yml | 2 +- pydantic_models/chemical_probes.py | 4 +- pydantic_models/target_safety_liabilities.py | 6 +- schemas/TEP.json | 17 +- schemas/chemical_probes.json | 210 ++++++------ schemas/disease_target_evidence.json | 116 +++---- schemas/molecular_interactions-output.json | 239 +++++++------- schemas/molecular_interactions.json | 317 ++++++++++--------- schemas/target_safety.json | 16 +- 10 files changed, 489 insertions(+), 452 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6294353..3b155893 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,10 +13,10 @@ repos: - --no-ensure-ascii - --no-sort-keys -- repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.22.0 - hooks: - - id: check-metaschema - name: "Validating schema definition against draft schemas" - files: ^schemas/.*json$ - types: [json] + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.22.0 + hooks: + - id: check-metaschema + name: "Validating schema definition against draft schemas" + files: ^schemas/.*json$ + types: [json] diff --git a/.travis.yml b/.travis.yml index 28a48799..06757d71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: python python: - "3.8" install: - - pip install git+https://github.com/python-jsonschema/check-jsonschema.git@0.20.0#egg=check-jsonschema + - pip install git+https://github.com/python-jsonschema/check-jsonschema.git@0.20.0#egg=check-jsonschema - wget -O draft7.json http://json-schema.org/draft-07/schema script: - for f in $(ls schemas/*json); do check-jsonschema --schemafile draft7.json $f ;done diff --git a/pydantic_models/chemical_probes.py b/pydantic_models/chemical_probes.py index d63e8fa8..66afe314 100644 --- a/pydantic_models/chemical_probes.py +++ b/pydantic_models/chemical_probes.py @@ -49,6 +49,6 @@ def validator(item): return False return True - + print(validator(ex)) -print(ChemicalProbes.schema_json(indent=2)) \ No newline at end of file +print(ChemicalProbes.schema_json(indent=2)) diff --git a/pydantic_models/target_safety_liabilities.py b/pydantic_models/target_safety_liabilities.py index 7486119d..a3547472 100644 --- a/pydantic_models/target_safety_liabilities.py +++ b/pydantic_models/target_safety_liabilities.py @@ -43,7 +43,7 @@ class Study(BaseModel): description: Optional[str] = Field(description='Description of the study.') name: Optional[str] = Field(description='Name of the study.', examples='ACEA_ER_80hr') - type: Optional[str] = Field(description='Conceptual biological and/or chemical features of the study.', examples='cell-based') + type: Optional[str] = Field(description='Conceptual biological and/or chemical features of the study.', examples='cell-based') class Config: extra = Extra.forbid anystr_strip_whitespace = True @@ -86,6 +86,6 @@ def validator(item): return False return True - + print(validator(ex)) -print(TargetSafety.schema_json(indent=2)) \ No newline at end of file +print(TargetSafety.schema_json(indent=2)) diff --git a/schemas/TEP.json b/schemas/TEP.json index 43efc44f..a12fab44 100644 --- a/schemas/TEP.json +++ b/schemas/TEP.json @@ -4,7 +4,7 @@ "description": "OpenTargets TEP (Target Enabling Package) objects", "type": "object", "properties": { - "targetFromSourceId" : { + "targetFromSourceId": { "type": "string", "description": "Target ID in resource of origin (accepted sources include Ensembl gene ID, Uniprot ID, gene symbol)", "examples": [ @@ -13,7 +13,10 @@ ] }, "url": { - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "description": "Link pointing to the TEP page.", "examples": [ "https://www.thesgc.org/tep/moesin" @@ -21,7 +24,10 @@ "pattern": "^https://|http://" }, "therapeuticArea": { - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "description": "Broad description of the therapeutic area relevant to the target. Might be more terms separated by comma.", "examples": [ "Metabolic diseases", @@ -29,7 +35,10 @@ ] }, "description": { - "type": ["string", "null"], + "type": [ + "string", + "null" + ], "description": "Description of the target.", "examples": [ "Fibrinogen-like globe domain of human Tenascin-C (hFBG-C)" diff --git a/schemas/chemical_probes.json b/schemas/chemical_probes.json index c34bfec0..d5d5680d 100644 --- a/schemas/chemical_probes.json +++ b/schemas/chemical_probes.json @@ -1,109 +1,117 @@ { - "title": "OpenTargets-chemical-probes", - "description": "OpenTargets Chemical Probes model.", - "type": "object", - "properties": { - "targetFromSourceId": { - "description": "Gene symbol in resource of origin.", - "examples": ["ESR1"], - "type": "string" - }, - "id": { - "description": "Probe ID as reported in Probes&Drugs.", - "examples": ["IOX1"], - "type": "string" - }, - "control": { - "description": "Inactive analogue of the probe.", - "examples": ["PF-04875474"], - "type": "string" - }, - "drugId": { - "description": "Drug molecule ID.", - "examples": ["CHEMBL1651534"], + "title": "OpenTargets-chemical-probes", + "description": "OpenTargets Chemical Probes model.", + "type": "object", + "properties": { + "targetFromSourceId": { + "description": "Gene symbol in resource of origin.", + "examples": [ + "ESR1" + ], + "type": "string" + }, + "id": { + "description": "Probe ID as reported in Probes&Drugs.", + "examples": [ + "IOX1" + ], + "type": "string" + }, + "control": { + "description": "Inactive analogue of the probe.", + "examples": [ + "PF-04875474" + ], + "type": "string" + }, + "drugId": { + "description": "Drug molecule ID.", + "examples": [ + "CHEMBL1651534" + ], + "type": "string" + }, + "urls": { + "type": "array", + "items": { + "$ref": "#/definitions/url" + } + }, + "probesDrugsScore": { + "description": "P&D probe-likeness score.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "probeMinerScore": { + "description": "Probe Miner probe-likeness score.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "scoreInCells": { + "description": "ChemicalProbes.org score for probe-likeness to be used in model cells.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "scoreInOrganisms": { + "description": "ChemicalProbes.org score for probe-likeness to be used in model organisms.", + "exclusiveMinimum": 0, + "maximum": 100, + "type": "integer" + }, + "mechanismOfAction": { + "description": "Mechanism of action of the probe.", + "examples": [ + "blocker" + ], + "type": "array", + "items": { "type": "string" - }, - "urls": { - "type": "array", - "items": { - "$ref": "#/definitions/url" - } - }, - "probesDrugsScore": { - "description": "P&D probe-likeness score.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "probeMinerScore": { - "description": "Probe Miner probe-likeness score.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "scoreInCells": { - "description": "ChemicalProbes.org score for probe-likeness to be used in model cells.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "scoreInOrganisms": { - "description": "ChemicalProbes.org score for probe-likeness to be used in model organisms.", - "exclusiveMinimum": 0, - "maximum": 100, - "type": "integer" - }, - "mechanismOfAction": { - "description": "Mechanism of action of the probe.", - "examples": [ - "blocker" - ], - "type": "array", - "items": { - "type": "string" - } - }, - "isHighQuality": { - "description": "True if selected as high quality by P&D.", - "type": "boolean" - }, - "origin": { - "description": "Origin of the probe.", - "type": "array", - "items": { - "type": "string", - "enum": [ - "experimental", - "calculated" - ], - "minItems": 1, - "uniqueItems": true - } } }, - "required": [ - "targetFromSourceId", - "id", - "urls", - "isHighQuality", - "origin" - ], - "additionalProperties": false, - "definitions": { - "url": { - "type": "object", - "properties": { - "niceName": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": [ - "niceName" + "isHighQuality": { + "description": "True if selected as high quality by P&D.", + "type": "boolean" + }, + "origin": { + "description": "Origin of the probe.", + "type": "array", + "items": { + "type": "string", + "enum": [ + "experimental", + "calculated" ], - "additionalProperties": false + "minItems": 1, + "uniqueItems": true } } + }, + "required": [ + "targetFromSourceId", + "id", + "urls", + "isHighQuality", + "origin" + ], + "additionalProperties": false, + "definitions": { + "url": { + "type": "object", + "properties": { + "niceName": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": [ + "niceName" + ], + "additionalProperties": false + } } +} diff --git a/schemas/disease_target_evidence.json b/schemas/disease_target_evidence.json index 24600fea..41195070 100644 --- a/schemas/disease_target_evidence.json +++ b/schemas/disease_target_evidence.json @@ -56,42 +56,42 @@ "datasourceId": { "const": "cancer_biomarkers" }, - "datatypeId": { - "$ref": "#/definitions/datatypeId" - }, - "biomarkerName": { - "$ref": "#/definitions/biomarkerName" - }, - "biomarkers": { - "$ref": "#/definitions/biomarkers" - }, - "confidence": { - "$ref": "#/definitions/confidence" - }, - "diseaseFromSource": { - "$ref": "#/definitions/diseaseFromSource" - }, - "diseaseFromSourceMappedId": { - "$ref": "#/definitions/diseaseFromSourceMappedId" - }, - "drugFromSource": { - "$ref": "#/definitions/drugFromSource" - }, - "drugId": { - "$ref": "#/definitions/drugId" - }, - "drugResponse": { - "$ref": "#/definitions/drugResponse" - }, - "literature": { - "$ref": "#/definitions/literature" - }, - "targetFromSourceId": { - "$ref": "#/definitions/targetFromSourceId" - }, - "urls": { - "$ref": "#/definitions/urls" - } + "datatypeId": { + "$ref": "#/definitions/datatypeId" + }, + "biomarkerName": { + "$ref": "#/definitions/biomarkerName" + }, + "biomarkers": { + "$ref": "#/definitions/biomarkers" + }, + "confidence": { + "$ref": "#/definitions/confidence" + }, + "diseaseFromSource": { + "$ref": "#/definitions/diseaseFromSource" + }, + "diseaseFromSourceMappedId": { + "$ref": "#/definitions/diseaseFromSourceMappedId" + }, + "drugFromSource": { + "$ref": "#/definitions/drugFromSource" + }, + "drugId": { + "$ref": "#/definitions/drugId" + }, + "drugResponse": { + "$ref": "#/definitions/drugResponse" + }, + "literature": { + "$ref": "#/definitions/literature" + }, + "targetFromSourceId": { + "$ref": "#/definitions/targetFromSourceId" + }, + "urls": { + "$ref": "#/definitions/urls" + } }, "required": [ "biomarkerName", @@ -586,7 +586,7 @@ "diseaseFromSourceMappedId": { "$ref": "#/definitions/diseaseFromSourceMappedId" }, - "variantFunctionalConsequenceId": { + "variantFunctionalConsequenceId": { "$ref": "#/definitions/variantFunctionalConsequenceId" } }, @@ -838,7 +838,7 @@ "additionalProperties": false }, { - "properties":{ + "properties": { "datasourceId": { "const": "ot_crispr" }, @@ -975,7 +975,7 @@ "const": "ot_genetics_portal" }, "beta": { - "$ref": "#/definitions/beta" + "$ref": "#/definitions/beta" }, "oddsRatioConfidenceIntervalLower": { "$ref": "#/definitions/confidenceIntervalLower" @@ -1394,7 +1394,9 @@ "ancestryId": { "type": "string", "description": "Identifier of the ancestry in the HANCESTRO ontology", - "examples": ["HANCESTRO_006"], + "examples": [ + "HANCESTRO_006" + ], "pattern": "HANCESTRO_\\d+" }, "alleleOrigins": { @@ -1465,7 +1467,7 @@ "biomarkerList": { "type": "array", "description": "List of biomarkers associated with the biological model.", - "items":{ + "items": { "type": "object", "description": "One biomarker for the model", "properties": { @@ -1512,7 +1514,9 @@ "$ref": "#/definitions/variantFunctionalConsequenceId" } }, - "required": ["name"], + "required": [ + "name" + ], "additionalProperties": false }, "uniqueItems": true @@ -1538,7 +1542,9 @@ ] } }, - "required": ["name"], + "required": [ + "name" + ], "additionalProperties": false }, "uniqueItems": true @@ -1688,28 +1694,28 @@ "items": { "type": "object", "properties": { - "id" : { + "id": { "type": "string", "description": "Cell type identifier in cell ontology or in cell model database", "examples": [ "SIDM01076" ] }, - "name" : { + "name": { "type": "string", "description": "Name of the cell model", "examples": [ "BC-1" ] }, - "tissue" : { + "tissue": { "type": "string", "description": "Name of the tissue from which the cells were sampled", "examples": [ "pancreas" ] }, - "tissueId" : { + "tissueId": { "type": "string", "description": "UBERON identifier of the anatomical unit the cells were sampled.", "examples": [ @@ -1783,7 +1789,9 @@ } }, "additionalProperties": false, - "required": ["id"] + "required": [ + "id" + ] }, "minItems": 1, "uniqueItems": true @@ -1913,7 +1921,9 @@ ] } }, - "required": ["name"], + "required": [ + "name" + ], "additionalProperties": false }, "minItems": 1, @@ -1942,7 +1952,7 @@ "minItems": 1, "uniqueItems": true }, - "projectId":{ + "projectId": { "type": "string", "description": "The identifer of the project that generated the data.", "examples": [ @@ -2026,8 +2036,7 @@ "women" ] } - } - , + }, "significantDriverMethods": { "type": "array", "description": "Methods to detect cancer driver genes producing significant results", @@ -2267,7 +2276,6 @@ "examples": [ "https://clinicaltrials.gov/search?id=%22NCT01917656%22", "https://search.clinicalgenome.org/kb/gene-validity/d910a9d8-516e-443d-acba-8d61f7574792--2018-06-07T14:23:53" - ] }, "niceName": { @@ -2371,7 +2379,7 @@ }, "uniqueItems": true }, - "warningMessage":{ + "warningMessage": { "type": "string", "description": "Free text description of any concerns or warnings about the data." } diff --git a/schemas/molecular_interactions-output.json b/schemas/molecular_interactions-output.json index e225c4e1..2f6f1051 100644 --- a/schemas/molecular_interactions-output.json +++ b/schemas/molecular_interactions-output.json @@ -1,119 +1,128 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OpenTargets-interactions-output", - "version": "1.0.0", - "description": "OpenTargets molecular interaction objects outputted from the ETL", - "type": "object", - "additionalProperties": false, - "properties": { - "count": { - "$ref": "#/$defs/count" - }, - "intA": { - "$ref": "#/$defs/interactor" - }, - "intABiologicalRole": { - "$ref": "#/$defs/interactorBiologicalRole" - }, - "intB": { - "$ref": "#/$defs/interactor" - }, - "intBBiologicalRole": { - "$ref": "#/$defs/interactorBiologicalRole" - }, - "scoring": { - "$ref": "#/$defs/scoring" - }, - "sourceDatabase": { - "$ref": "#/$defs/sourceDatabase" - }, - "speciesA": { - "$ref": "#/$defs/species" - }, - "speciesB": { - "$ref": "#/$defs/species" - }, - "targetA": { - "$ref": "#/$defs/target" - }, - "targetB": { - "$ref": "#/$defs/target" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OpenTargets-interactions-output", + "version": "1.0.0", + "description": "OpenTargets molecular interaction objects outputted from the ETL", + "type": "object", + "additionalProperties": false, + "properties": { + "count": { + "$ref": "#/$defs/count" }, - "required": [ - "intA", - "intB", - "sourceDatabase" - ], - "$defs": { - "count": { - "type": "number", - "description": "Number of evidence supporting the interaction." - }, - "interactor": { - "type": "string", - "description": "Identifier of the interactor in the given database.", - "examples": [ - "ENSP00000005226", - "P26371", - "Q9BYR3", - "O00303" - ] - }, - "interactorBiologicalRole": { - "type": "string", - "description": "Biological role of the interactor in the given interaction.", - "examples": [ - "enzyme target" - ] - }, - "scoring": { - "type": ["number", "null"], - "description": "Source specific score/weight of the interaction, combined for all evidences." - }, - "sourceDatabase": { - "type": "string", - "description": "Name of the datasource.", - "enum": [ - "intact", - "signor", - "string", - "reactome" - ] - }, - "species": { - "type": "object", - "additionalProperties": false, - "properties": { - "mnemonic": { - "type": "string", - "description": "Common name of the organism.", - "examples": [ - "human", - "Sendai virus" - ] - }, - "scientific_name": { - "type": ["string", "null"], - "description": "Scientific name of the organism.", - "examples": [ - "Homo sapiens", - "Bovine herpesvirus 4" - ] - }, - "taxon_id": { - "type": "number", - "description": "NCBI taxon identifier of the organism." - } - }, - "required": [ - "scientific_name", - "taxon_id" - ] - }, - "target": { - "type": ["string", "null"], - "description": "Target ID in resource of origin." + "intA": { + "$ref": "#/$defs/interactor" + }, + "intABiologicalRole": { + "$ref": "#/$defs/interactorBiologicalRole" + }, + "intB": { + "$ref": "#/$defs/interactor" + }, + "intBBiologicalRole": { + "$ref": "#/$defs/interactorBiologicalRole" + }, + "scoring": { + "$ref": "#/$defs/scoring" + }, + "sourceDatabase": { + "$ref": "#/$defs/sourceDatabase" + }, + "speciesA": { + "$ref": "#/$defs/species" + }, + "speciesB": { + "$ref": "#/$defs/species" + }, + "targetA": { + "$ref": "#/$defs/target" + }, + "targetB": { + "$ref": "#/$defs/target" + } + }, + "required": [ + "intA", + "intB", + "sourceDatabase" + ], + "$defs": { + "count": { + "type": "number", + "description": "Number of evidence supporting the interaction." + }, + "interactor": { + "type": "string", + "description": "Identifier of the interactor in the given database.", + "examples": [ + "ENSP00000005226", + "P26371", + "Q9BYR3", + "O00303" + ] + }, + "interactorBiologicalRole": { + "type": "string", + "description": "Biological role of the interactor in the given interaction.", + "examples": [ + "enzyme target" + ] + }, + "scoring": { + "type": [ + "number", + "null" + ], + "description": "Source specific score/weight of the interaction, combined for all evidences." + }, + "sourceDatabase": { + "type": "string", + "description": "Name of the datasource.", + "enum": [ + "intact", + "signor", + "string", + "reactome" + ] + }, + "species": { + "type": "object", + "additionalProperties": false, + "properties": { + "mnemonic": { + "type": "string", + "description": "Common name of the organism.", + "examples": [ + "human", + "Sendai virus" + ] + }, + "scientific_name": { + "type": [ + "string", + "null" + ], + "description": "Scientific name of the organism.", + "examples": [ + "Homo sapiens", + "Bovine herpesvirus 4" + ] + }, + "taxon_id": { + "type": "number", + "description": "NCBI taxon identifier of the organism." } + }, + "required": [ + "scientific_name", + "taxon_id" + ] + }, + "target": { + "type": [ + "string", + "null" + ], + "description": "Target ID in resource of origin." } -} \ No newline at end of file + } +} diff --git a/schemas/molecular_interactions.json b/schemas/molecular_interactions.json index 10dc8286..0e5b255c 100644 --- a/schemas/molecular_interactions.json +++ b/schemas/molecular_interactions.json @@ -1,168 +1,171 @@ { - "schema": "http://json-schema.org/draft-04/schema#", - "title": "Open Targets Network", - "description": "Open Targets Network objects", - "type": "object", - "properties": { - "interactorA": { - "description": "Object describing the first interactor", - "type": "object", - "$ref": "#/definitions/interactor" + "schema": "http://json-schema.org/draft-04/schema#", + "title": "Open Targets Network", + "description": "Open Targets Network objects", + "type": "object", + "properties": { + "interactorA": { + "description": "Object describing the first interactor", + "type": "object", + "$ref": "#/definitions/interactor" + }, + "interactorB": { + "description": "Object describing the second interactor", + "type": "object", + "$ref": "#/definitions/interactor" + }, + "interaction": { + "description": "Object storing edge information", + "type": "object", + "properties": { + "interaction_score": { + "type": "number", + "description": "Source specific score/weight of the interaction, combined for all evidences" }, - "interactorB": { - "description": "Object describing the second interactor", - "type": "object", - "$ref": "#/definitions/interactor" + "causal_interaction": { + "type": "boolean", + "description": "Flag indicating wether the A->B interaction is directed or not" }, - "interaction": { - "description": "Object storing edge information", + "evidence": { + "type": "array", + "uniqueItems": false, + "description": "JSON objects describing the evidences supporting the given interaction.", + "items": { "type": "object", - "properties": { - "interaction_score": { - "type": "number", - "description": "Source specific score/weight of the interaction, combined for all evidences" - }, - "causal_interaction": { - "type": "boolean", - "description": "Flag indicating wether the A->B interaction is directed or not" - }, - "evidence": { - "type": "array", - "uniqueItems": false, - "description": "JSON objects describing the evidences supporting the given interaction.", - "items": { - "type": "object", - "$ref": "#/definitions/evidence" - } - } + "$ref": "#/definitions/evidence" + } + } + }, + "required": [ + "interaction_score", + "causal_interaction", + "evidence" + ] + }, + "source_info": { + "description": "Object describing source and data version", + "type": "object", + "properties": { + "source_database": { + "type": "string", + "description": "Name of the datasource." + }, + "database_version": { + "type": "string", + "description": "version of the data" + } + }, + "required": [ + "source_database", + "database_version" + ] + } + }, + "required": [ + "interactorA", + "interactorB", + "interaction", + "source_info" + ], + "definitions": { + "interactor": { + "type": "object", + "description": "Interactor description", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the interactor in the given database" + }, + "id_source": { + "type": "string", + "description": "source database from where the ID is looked up", + "enum": [ + "uniprot", + "ensembl_protein", + "ensembl_gene", + "rna_base" + ] + }, + "biological_role": { + "type": [ + "string", + "null" + ], + "description": "Describing the biological role of the interactor in the given interaction" + }, + "organism": { + "type": "object", + "description": "Organism information of the interactor", + "properties": { + "scientific_name": { + "type": "string", + "description": "Scientific name of the organism" }, - "required": [ - "interaction_score", - "causal_interaction", - "evidence" - ] - }, - "source_info": { - "description": "Object describing source and data version", - "type": "object", - "properties": { - "source_database": { - "type": "string", - "description": "Name of the datasource." - }, - "database_version": { - "type": "string", - "description": "version of the data" - } + "taxon_id": { + "type": "number", + "description": "NCBI taxon identifier of the organism" }, - "required": [ - "source_database", - "database_version" - ] + "mnemonic": { + "type": "string", + "description": "Common name of the organism." + } + }, + "required": [ + "scientific_name", + "taxon_id" + ] } + }, + "required": [ + "id", + "id_source", + "organism", + "biological_role" + ] }, - "required": [ - "interactorA", - "interactorB", - "interaction", - "source_info" - ], - "definitions": { - "interactor": { - "type": "object", - "description": "Interactor description", - "properties": { - "id": { - "type": "string", - "description": "Identifier of the interactor in the given database" - }, - "id_source": { - "type": "string", - "description": "source database from where the ID is looked up", - "enum": [ - "uniprot", - "ensembl_protein", - "ensembl_gene", - "rna_base" - ] - }, - "biological_role": { - "type": [ "string", "null" ], - "description": "Describing the biological role of the interactor in the given interaction" - }, - "organism": { - "type": "object", - "description": "Organism information of the interactor", - "properties": { - "scientific_name": { - "type": "string", - "description": "Scientific name of the organism" - }, - "taxon_id": { - "type": "number", - "description": "NCBI taxon identifier of the organism" - }, - "mnemonic": { - "type": "string", - "description": "Common name of the organism." - } - }, - "required": [ - "scientific_name", - "taxon_id" - ] - } - }, - "required": [ - "id", - "id_source", - "organism", - "biological_role" - ] + "evidence": { + "type": "object", + "properties": { + "interaction_identifier": { + "type": "string" }, - "evidence": { - "type": "object", - "properties": { - "interaction_identifier": { - "type": "string" - }, - "interaction_detection_method_short_name": { - "type": "string" - }, - "interaction_detection_method_mi_identifier": { - "type": "string" - }, - "pubmed_id": { - "type": "string" - }, - "evidence_score": { - "type": "number" - }, - "interaction_type_short_name": { - "type": "string" - }, - "interaction_type_mi_identifier": { - "type": "string" - }, - "host_organism_scientific_name": { - "type": "string" - }, - "host_organism_tax_id": { - "type": "number" - }, - "participant_detection_method_short_name": { - "type": "string" - }, - "participant_detection_method_mi_identifier": { - "type": "string" - }, - "expansion_method_short_name": { - "type": "string" - }, - "expansion_method_mi_identifier": { - "type": "string" - } - } + "interaction_detection_method_short_name": { + "type": "string" + }, + "interaction_detection_method_mi_identifier": { + "type": "string" + }, + "pubmed_id": { + "type": "string" + }, + "evidence_score": { + "type": "number" + }, + "interaction_type_short_name": { + "type": "string" + }, + "interaction_type_mi_identifier": { + "type": "string" + }, + "host_organism_scientific_name": { + "type": "string" + }, + "host_organism_tax_id": { + "type": "number" + }, + "participant_detection_method_short_name": { + "type": "string" + }, + "participant_detection_method_mi_identifier": { + "type": "string" + }, + "expansion_method_short_name": { + "type": "string" + }, + "expansion_method_mi_identifier": { + "type": "string" } + } } -} \ No newline at end of file + } +} diff --git a/schemas/target_safety.json b/schemas/target_safety.json index eea18e28..40fc008b 100644 --- a/schemas/target_safety.json +++ b/schemas/target_safety.json @@ -51,13 +51,13 @@ "description": "Source of safety event.", "type": "string", "enum": [ - "Force et al. (2011)", - "Lamore et al. (2017)", - "Lynch et al. (2017)", - "Bowes et al. (2012)", - "Urban et al. (2012)", - "ToxCast", - "AOP-Wiki" + "Force et al. (2011)", + "Lamore et al. (2017)", + "Lynch et al. (2017)", + "Bowes et al. (2012)", + "Urban et al. (2012)", + "ToxCast", + "AOP-Wiki" ] }, "literature": { @@ -205,4 +205,4 @@ } } } -} \ No newline at end of file +} From 0f50bcc9f80470fe00619fd54cffc7684aba4ddd Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:21:49 +0200 Subject: [PATCH 08/12] schemas fixed by pre-commit --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3b155893..262c5194 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,7 @@ repos: - --no-ensure-ascii - --no-sort-keys + - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.22.0 hooks: From 4b5da41c2edcf383656545d68253bdebb8736a87 Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:27:14 +0200 Subject: [PATCH 09/12] fine-tuning pre-commit --- .pre-commit-config.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 262c5194..3b155893 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,6 @@ repos: - --no-ensure-ascii - --no-sort-keys - - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.22.0 hooks: From a279f3c678deefc58a0370eab7b2fe0c4ace0aad Mon Sep 17 00:00:00 2001 From: Daniel Suveges Date: Fri, 7 Apr 2023 09:32:43 +0200 Subject: [PATCH 10/12] Adding pre-commit badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4ceae55d..a9fc90c6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/opentargets/json_schema/master.svg)](https://results.pre-commit.ci/latest/github/opentargets/json_schema/master) + # Schemas of the OpenTargets Platform data models This repository contains schema definitions of some of the data models the OpenTargets Platform deals with. From 117a6ac7ef559091afe7ed00184e2b390dcadee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irene=20L=C3=B3pez?= <45119610+ireneisdoomed@users.noreply.github.com> Date: Tue, 11 Apr 2023 13:03:52 +0200 Subject: [PATCH 11/12] docs: added note about jsontopydantic --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9fc90c6..192ae062 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Either as an input or generates as an output. **Folders**: - `/schemas/` - List of schemas in JSON format. -- `/pydantic_models/` - Definitions of the data models using Python's [Pydantic](https://docs.pydantic.dev/) tool. +- `/pydantic_models/` - Definitions of the data models using Python's [Pydantic](https://docs.pydantic.dev/) tool. [jsontopydantic](https://jsontopydantic.com/) is helpful for the purpose of defining a JSON schema as a Pydantic model. While it may require some customization, it streamlines the majority of the Pydantic boilerplate. ## Available schemas @@ -18,3 +18,5 @@ Either as an input or generates as an output. - `target_safety.json`: Description of [target safety](https://platform-docs.opentargets.org/target/safety). - `molecular_interactions.json`: Definition of the [molecular interactions](https://platform-docs.opentargets.org/target/molecular-interactions) input. - `molecular_interactions-output.json`: Definition for the molecular interactions dataset generated by the Platform ETL. + +## From ef5a0ede43c630f5618bd807d95fd68bc3cc97f6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:05:10 +0000 Subject: [PATCH 12/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 192ae062..473e3c06 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,4 @@ Either as an input or generates as an output. - `molecular_interactions.json`: Definition of the [molecular interactions](https://platform-docs.opentargets.org/target/molecular-interactions) input. - `molecular_interactions-output.json`: Definition for the molecular interactions dataset generated by the Platform ETL. -## +##