Forked from https://gitlab.ebi.ac.uk/pdbe-kb/funpdbe/funpdbe-validator.git as part of my collaboration to submit my variant annotations, extended work from my PhD. https://thesis.tunstall.in
Find a file
2022-11-11 18:27:03 +00:00
data Adding help text 2020-10-15 14:22:46 +01:00
tests fixed validate.load_schema() in README and tests to account for schema being loaded from a URL rather than a file. 2022-11-11 17:15:58 +00:00
validator Getting the latest FunPDBe schema dynamically 2020-10-20 14:28:56 +01:00
.gitignore Make into package for installation 2020-09-18 21:12:13 +01:00
.gitlab-ci.yml Add .gitlab-ci.yml 2021-03-17 05:12:45 +00:00
__init__.py Latest version 2019-10-07 14:49:35 +01:00
LICENSE Initial commit 2018-10-12 17:25:07 +01:00
README.md fixed validate.load_schema() in README and tests to account for schema being loaded from a URL rather than a file. 2022-11-11 17:15:58 +00:00
requirements.txt Adding residue index validator 2018-10-13 20:07:54 +01:00
setup.py Make into package for installation 2020-09-18 21:12:13 +01:00
test_tt_3pl1_example.py added my sample 3pl1 json file with 4 muts to test the json validator 2022-11-11 18:27:03 +00:00
tt_3pl1_example.json added my sample 3pl1 json file with 4 muts to test the json validator 2022-11-11 18:27:03 +00:00

FunPDBe JSON Validator

This Python3 client can be used for validating FunPDBe JSON files. It performs various sanity checks, and validates user JSONs against the FunPDBe schema.

For more information on FunPDBe is, visit https://funpdbe.org

Quick start

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Please note that the client is written in Python3, and the dependencies have to be installed accordingly (i.e. using pip3)!

Installing

Checking out this repository

$ git clone https://gitlab.ebi.ac.uk/pdbe-kb/funpdbe/funpdbe-validator.git
$ cd funpdbe-validator
$ pip3 install -r requirements.txt

Basic usage

This package contains two classes which handle the validation of FunPDBe JSON files.

  • Validator()
  • ResidueIndexes()

Example:

from validator.validator import Validator
from validator.residue_index import ResidueIndexes

validator = Validator("funpdbe_resource_name") # Same as in the JSON
validator.load_schema()
validator.load_json("data/funpdbe_data.json")


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)

Running the tests

Running tests for the client is performed simply by using

$ pytest tests

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Mihaly Varadi - Initial work - mvaradi

Special thanks to:

License

This project is licensed under the EMBL-EBI License - see the LICENSE file for details