diff --git a/test_tt_3pl1_example.py b/test_tt_3pl1_example.py new file mode 100755 index 0000000..3ae50c8 --- /dev/null +++ b/test_tt_3pl1_example.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Created on Fri Nov 11 11:18:52 2022 + +@author: tanu +""" +from validator.validator import Validator +from validator.residue_index import ResidueIndexes + +#validator = Validator("ProKinO") # Same as in the JSON +validator = Validator("FoldX") # Same as in the JSON +validator.load_schema() +print("Schema loaded successfully") + +validator.load_json("tt_3pl1_example.json") +#print("Loaded json file successfully") + +if validator.basic_checks() and validator.validate_against_schema(): + # Passed data validations + print('Passed schema validation') + residue_indexes = ResidueIndexes(validator.json_data) + if residue_indexes.check_every_residue(): + # Passed the index validation + print('Passed index validation') +else: + print('Failed schema validation') + print(validator.error_log) diff --git a/tt_3pl1_example.json b/tt_3pl1_example.json new file mode 100644 index 0000000..566dc95 --- /dev/null +++ b/tt_3pl1_example.json @@ -0,0 +1,87 @@ +{ + "data_resource": "FoldX", + "resource_version": "5.0", + "software_version": "5.0", + "resource_entry_url": "http://foldxsuite.crg.eu/", + "pdb_id": "3PL1", + "chains": [ + { + "residues": [ + { + "pdb_res_label": "10", + "aa_type": "GLN", + "site_data": [ + { + "site_id_ref": 1, + "confidence_score": 1, + "confidence_classification": "curated", + "raw_score": 3.9475, + "raw_score_unit": "kcal/mol", + "aa_variant": "GLY" + }, + { + "site_id_ref": 2, + "confidence_score": 1, + "confidence_classification": "high", + "raw_score": 2.88633, + "raw_score_unit": "kcal/mol", + "aa_variant": "ALA" + } + ] + }, + { + "pdb_res_label": "11", + "aa_type": "ASN", + "site_data": [ + { + "site_id_ref": 3, + "confidence_score": 1, + "confidence_classification": "curated", + "raw_score": 1.15843, + "raw_score_unit": "kcal/mol", + "aa_variant": "GLY" + } + ] + }, + { + "pdb_res_label": "12", + "aa_type": "ASP", + "site_data": [ + { + "site_id_ref": 4, + "confidence_score": 1, + "confidence_classification": "high", + "raw_score": 1.71712, + "aa_variant": "GLY" + } + ] + } + ], + "chain_label": "A" + } + ], + "sites": [ + { + "site_id": 1, + "label": "ddG" + }, + { + "site_id": 2, + "label": "ddG" + }, + { + "site_id": 3, + "label": "ddG" + }, + { + "site_id": 4, + "label": "ddG" + } + ], + "evidence_code_ontology": [ + { + "eco_term": "computational experiment", + "eco_code": "ECO_0000006" + } + ] +}