{
    "$schema": "https://json-schema.org/draft/2020-12/schema#",
    "$ref": "#/definitions/Ligand_validation",
    "definitions": {
        "Ligand_validation": {
            "type": "object",
            "properties": {
                "Data": {
                    "description": "Meta data of the ligand validation process", 
                    "$ref": "#/definitions/Data"
                },
                "Ligand_validation_data": {
                    "description": "Validation data for ligands that are present in the structure model",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/LigandValidationData"
                    }
                }
            },
            "required": [
                "Data",
                "Ligand_validation_data"
            ],
            "title": "Ligand_validation"
        },
        "Data": {
            "type": "object",
            "properties": {
                "pdb_id": {
                    "description": "PDB ID as reported in Protein Data Bank",
                    "type": "string"
                },
                "coordinates_revision_date_pdb": {
                    "description": "Date of PDB-REDO run",
                    "type": ["string", "null"],
                    "format": "date"
                },
                "coordinates_revision_major_mmCIF": {
                    "description": "Major version number of mmCIF coordinates",
                    "type": [ "string", "null"]
                },
                "coordinates_revision_minor_mmCIF": {
                    "description": "Minor version number of mmCIF coordinates",
                    "type": [ "string", "null"]
                },
                "coordinates_edited": {
                    "description": "PDB-REDO did (True) or did not (False) edit the coordinates of the structure",
                    "type": "boolean"
                },
                "reflections_revision": {
                    "description": "Version number of reflection data",
                    "type": "string"
                },
                "reflections_edited": {
                    "description": "PDB-REDO did (true) or did not (false) edit the reflection file of the PDB",
                    "type": "boolean"
                },
                "pdb_redo_version": {
                    "description": "Version of PDB-REDO version that was used",
                    "type": "string"
                },
                "pdb_redo_used": {
                    "description": "PDB-REDO was (true) or was not (false) used",
                    "type": "boolean"
                }
            },
            "required": [
                "coordinates_edited",
                "coordinates_revision_date_pdb",
                "coordinates_revision_major_mmCIF",
                "coordinates_revision_minor_mmCIF",
                "pdb_id",
                "pdb_redo_used",
                "pdb_redo_version",
                "reflections_edited",
                "reflections_revision"
            ],
            "title": "Data"
        },
        "LigandValidationData": {
            "type": "object",
            "properties": {
                "asymID": {
                    "description": "asymID of ligand as found in mmCIF file",
                    "type": "string"
                },
                "compID": {
                    "description": "compID of ligand as found in mmCIF file",
                    "type": "string"
                },
                "seqID": {
                    "description": "seqID of ligand as found in mmCIF file",
                    "type": "integer"
                },
                "pdb": {
                    "description": "Ligand identifiers as reported in pdb file",
                    "$ref": "#/definitions/Pdb"
                },
                "added": {
                    "description": "Ligand was added by PDB-REDO (True) or was not added (False) as ligand was present in pdb file of the structure",
                    "type": "boolean"
                },
                "all_atom_rmsd_in_A": {
                    "description": "All atom RMSD as described by YASARA, only when added = False",
                    "type": ["number", "null"]
                },
                "atoms_shifted_more_than_0.5A": {
                    "description": "Number of atoms that have show an rmsd above 0.5 Å, only when added = False",
                    "type": "integer"
                },
                "original model": {
                    "description": "Details of the ligand in the PDB model",
                    "$ref": "#/definitions/Model"
                },
                "pdb_redo_model": {
                    "description": "Details of the ligand in the PDB-REDO model, only when added = False",
                    "$ref": "#/definitions/Model"
                }
            },
            "required": [
                "asymID",
                "compID",
                "seqID",
                "pdb",
                "added"                
            ],
            "title": "Ligand_validation_data"
        },
        "Pdb": {
            "type": "object",
            "properties": {
                "compID": {
                    "description": "compID of ligand as reported in pdb file",
                    "type": "string"
                },
                "insCode": {
                    "description": "insCode of ligand as reported in pdb file",
                    "type": "string"
                },
                "seqNum": {
                    "description": "seqNum of ligand as reported in pdb file",
                    "type": "integer"
                },
                "strandID": {
                    "description": "strandID of ligand as reported in pdb file",
                    "type": "string"
                }
            },
            "required": [
                "compID",
                "insCode",
                "seqNum",
                "strandID"
            ],
            "title": "Pdb"
        },
        "Model": {
            "type": "object",
            "properties": {
                "density_fit": {
                    "description": "Fit of the ligand to the electron density",
                    "$ref": "#/definitions/DensityFit"
                },
                "heat_of_formation": {
                    "description": "Standard enthalpy of formation",
                    "$ref": "#/definitions/HeatOfFormation"
                },
                "interactions": {
                    "description": "Interactions of the ligand with its surroundings",
                    "$ref": "#/definitions/Interactions"
                }
            },
            "required": [
                "density_fit",
                "heat_of_formation",
                "interactions"
            ],
            "title": "Model"
        },
        "DensityFit": {
            "type": "object",
            "properties": {
                "real_space_Rfactor": {
                    "description": "R-factor of the ligand",
                    "type": "number"
                },
                "real_space_correlation": {
                    "description": "Real space correlation of the ligand",
                    "type": "number"
                },
                "EDIAm_density_fit": {
                    "description": "Fit to the electron density EDIAm score for all ligand atoms",
                    "type": ["number","null"]
                },
                "OPIA_density_coverage": {
                    "description": "Measure that indicaties the OPIA fit to the electron density, this is the fraction of atoms having an EDIA score greater than 0.8",
                    "type": ["number","null"]
                },
                "refined_occupancy": {
                    "description": "Occupancy after refinement, only for ligand that was added by PDB-REDO",
                    "type": "number"
                }                
            },
            "required": [
                "EDIAm_density_fit",
                "OPIA_density_coverage",
                "real_space_Rfactor",
                "real_space_correlation"
            ],
            "title": "DensityFit"
        },
        "HeatOfFormation": {
            "type": "object",
            "properties": {
                "energy": {
                    "description": "Measure of the change in enthalpy required to form the ligand in its reported conformation at constant pressure and standard atom states in solution",
                    "type": ["number", "null"]
                },
                "energy_unit": {
                    "description": "Unit of energy",
                    "type": "string"
                }
            },
            "required": [
                "energy",
                "energy_unit"
            ],
            "title": "HeatOfFormation"
        },
        "Interactions": {
            "type": "object",
            "properties": {
                "bumps_count": {
                    "description": "Number of bumps of the ligand with its surrounding as reported by YASARA",
                    "type": "integer"
                },
                "H_bonds_count": {
                    "description": "Number of hydrogen-bonds between the ligand and its surrounding as reported by YASARA",
                    "type": "integer"
                },
                "H_bonds_strength": {
                    "description": "Cumulative strength of the hydrogen bonds",
                    "type": ["number", "null"]
                },
                "H_bonds_unit": {
                    "description": "Unit of the hydrogen bond strength",
                    "type": "string"
                },
                "hydrophobic_count": {
                    "description": "Number of hydrophobic interactions between the ligand and its surrounding as reported by YASRA",
                    "type": "integer"
                },
                "hydrophobic_strength": {
                    "description": "Cumulative strength of the hydrophobic interactions",
                    "type": ["number", "null"]
                },
                "hydrophobic_unit": {
                    "description": "Unit of the strength of the hydrophobic interactions",
                    "type": "string"
                },
                "pi_pi_count": {
                    "description": "Number of pi-pi interactions between the ligand and its surrounding as reported by YASARA",
                    "type": "integer"
                },
                "pi_pi_strength": {
                    "description": "Cumulative strength of the pi-pi interactions",
                    "type": ["number", "null"]
                },
                "pi_pi_unit": {
                    "description": "Unit of the strength of the pi-pi interactions",
                    "type": "string"
                },
                "cation_pi_count": {
                    "description": "Number of pi-cation interactions between the ligand and its surrounding as reported by YASARA",
                    "type": "integer"
                },
                "cation_pi_strength": {
                    "description": "Cumulative strength of the pi-cation interactions",
                    "type": ["number", "null"]
                },
                "cation_pi_unit": {
                    "description": "Unit of the strength of the pi-cation interactions",
                    "type": "string"
                },
                "halogen_bond_count": {
                    "description": "Number of halogen bonds between the ligand and its surroundings as reported by gethalogenbonds",
                    "type": "integer"
                },
                "halogen_bond_normality": {
                    "description": "Mean HalBS halogen bond normality score for all interactions",
                    "type": ["number", "null"]
                },
                "halogen_bond_unit": {
                    "description": "Unit of the halogen bond normality",
                    "type": "string"
                }
            },
            "required": [
                "H_bonds_count",
                "H_bonds_strength",
                "H_bonds_unit",
                "bumps_count",
                "cation_pi_count",
                "cation_pi_strength",
                "cation_pi_unit",
                "hydrophobic_count",
                "hydrophobic_strength",
                "hydrophobic_unit",
                "pi_pi_count",
                "pi_pi_strength",
                "pi_pi_unit"
            ],
            "title": "Interactions"
        }
    }
}
