From d71bf9f295a35340b14db64aa842b8f4284bf67d Mon Sep 17 00:00:00 2001 From: B13nch3n <b13nch3n_01@theb-si.de> Date: Wed, 19 Oct 2022 11:20:43 +0200 Subject: [PATCH] Always return cifcheck-errors. --- validation/Dockerfile | 4 ++-- validation/README.md | 12 ++++++------ validation/validate-mmcif-file.py | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/validation/Dockerfile b/validation/Dockerfile index 725afb4..7ec976f 100644 --- a/validation/Dockerfile +++ b/validation/Dockerfile @@ -7,7 +7,7 @@ ARG VERSION_PYTHON ARG VERSION_BASE_IMAGE ARG VERSION_CPP_DICT_PACK="v2.500" -ARG VERSION_PY_MMCIF="0.76" +ARG VERSION_PY_MMCIF="0.79" ## Set up environment ENV MMCIF_DICTS_DIR="/usr/local/share/mmcif-dict-suite" \ @@ -97,7 +97,7 @@ RUN set -e pipefail; \ gunzip *.gz; \ # ## Fetch the merged ModelCIF dictionary - if test x${USE_DICT_VERSION} == xlatest; then \ + if test x${USE_DICT_VERSION} = xlatest; then \ export _MA_DICT_URL="${_GIT_URL}/dist/mmcif_ma.dic"; \ fi; \ curl ${_MA_DICT_URL} -s -L -o mmcif_ma.dic; \ diff --git a/validation/README.md b/validation/README.md index 5f6407c..957d0c7 100644 --- a/validation/README.md +++ b/validation/README.md @@ -1,19 +1,19 @@ -[[_TOC_]] - # ModelCIF validation tool -This is a tool to check that the formatting of ModelCIF files complies with the ModelCIF format declaration (aka "dictionary"). Upon successful validation, a ModelCIF file can be extended with the dictionary version the file was compared to (option [`--extend-validated-file`](#add-validation-dictionary-to-ModelCIF-file)). For more basic mmCIF validation, the dictionary of the underlying PDBx/mmCIF format is also available. +This is a tool to check that the formatting of [ModelCIF](https://mmcif.wwpdb.org/dictionaries/mmcif_ma.dic/Index/) files complies with the ModelCIF format declaration (aka "dictionary"). Upon successful validation, a ModelCIF file can be extended with the dictionary version the file was compared to (option [`--extend-validated-file`](#add-dictionary-information-used-for-validation-to-modelcIF-file)). For more basic [mmCIF](https://mmcif.wwpdb.org) validation, the dictionary of the underlying [PDBx/mmCIF](https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Index/) format is also available. -The easiest way to run validation is from Docker container. +The easiest way to run validation is from [Docker](https://www.docker.com) container. The tool itself is a wrapper around the [`CifCheck`](https://github.com/rcsb/cpp-dict-pack) tool by [RCSB](https://www.rcsb.org/). +[[_TOC_]] + ## How to run the validation tool -This is just a description of the validation tool itself. When running it from inside a container, the command needs to be prefixed with the instructions to start the container. Find information for running the validation container in "[How to run the container](#how-to-run-the-container)". +This is just a description of the [validation tool](./validate-mmcif-file.py) itself. When running it from inside a container, the command needs to be prefixed with the instructions to start the container. Find information for running the validation Docker container in "[How to run the container](#how-to-run-the-container)". -Upon completion, if there hasn't been any error running the command, the validation tool returns a concise report in JSON format. That output is meant to be input to a website or any kind of nicely formatted report. Output can also be stored as a file. If the tested ModelCIF file is fully compliant with the ModelCIF format, the JSON output has +Upon completion, if there hasn't been any error running the command, the validation tool returns a concise report in [JSON](https://www.json.org/json-en.html) format. That output is meant to be input to a website or any kind of nicely formatted report. Output can also be stored as a JSON formatted file. If the tested ModelCIF file is fully compliant with the ModelCIF format, the JSON output has - `status` "completed" - no messages in the `diagnosis` list diff --git a/validation/validate-mmcif-file.py b/validation/validate-mmcif-file.py index c82178c..ad9fab4 100755 --- a/validation/validate-mmcif-file.py +++ b/validation/validate-mmcif-file.py @@ -476,6 +476,7 @@ class _CifCheck: """Run CifCheck for a given file and catch the output. Returns False if the CifCheck execution itself failed.""" + self.check_results["cifcheck-errors"] = [] try: format_errors = self._execute(cif_file) except _CifCheckFailedError as exc: -- GitLab