ihm_validation package

Submodules

ihm_validation.cx module

ihm_validation.em module

ihm_validation.excludedvolume module

ihm_validation.format_checker module

Detect file format and check residue and atom names in IHMCIF file.

This module provides functionality to: - Detect file format (PDB, mmCIF, or IHMCIF) - Validate CIF files against PDBx dictionary - Validate IHMCIF files against combined PDBx+IHM dictionary (following the approach

  • Check residue and atom names in IHMCIF files

class ihm_validation.format_checker.FileFormat(value)[source]

Bases: Enum

Enumeration of supported file formats

IHMCIF = 'IHMCIF'
MMCIF = 'PDBx/mmCIF'
PDB = 'PDB'
UNKNOWN = 'UNKNOWN'
ihm_validation.format_checker.check_all_exception(system: System)[source]

Perform all checks. Throw an exception if a check fails.

ihm_validation.format_checker.check_all_log(system: System) int[source]

Perform all checks. Throw a message in the log if a check fails and return a non-zero exit code

ihm_validation.format_checker.check_atom_names_chimerax(cif_file, timeout=180)[source]

Run ChimeraX on a CIF file and extract warnings about atoms not in residue templates.

Parameters:
  • cif_file – Path to the CIF file

  • timeout – Timeout in seconds (default: 180)

Returns:

List of warning messages (empty list if no warnings)

ihm_validation.format_checker.check_entities_histidines(system: System, histidines=frozenset({'HID', 'HIE', 'HIP'}))[source]

Find any non-standard histidine chemical components

ihm_validation.format_checker.check_file_exception(fname: str, check_format: bool = True, validate_dictionary: bool = True)[source]

Parse a file, do all checks, throw an exception if a check fails.

Parameters:
  • fname – Path to the file to check

  • check_format – If True, verify the file format before checking

  • validate_dictionary – If True, validate CIF/IHMCIF files against dictionaries

ihm_validation.format_checker.check_file_format(fname: str, validate_dictionary: bool = True, raise_on_error: bool = True)[source]

Check file format and validate that it is IHMCIF.

Parameters:
  • fname – Path to the file to check

  • validate_dictionary – If True, validate IHMCIF files against dictionaries

  • raise_on_error – If True, raise ValueError on format errors; if False, return error message

Returns:

(success: bool, error_msg: str or None) If raise_on_error is True: None (raises ValueError on error)

Return type:

If raise_on_error is False

Raises:

ValueError – If file format is not IHMCIF (when raise_on_error is True)

ihm_validation.format_checker.check_file_log(fname: str, check_format: bool = True, validate_dictionary: bool = True) int[source]

Parse a file, do all checks, throw a log message if a check fails and return a non-zero exit code

Parameters:
  • fname – Path to the file to check

  • check_format – If True, verify the file format before checking

  • validate_dictionary – If True, validate PDBx/mmCIF or IHMCIF files against dictionaries

Returns:

0 for success, non-zero for failure

Return type:

Exit code

ihm_validation.format_checker.check_models(system: System)[source]

Find any non-standard histidine chemical components

ihm_validation.format_checker.detect_format(file_path: str, max_lines: int = 3000) Tuple[FileFormat, str][source]

Detect the format of a structural biology file.

Parameters:
  • file_path – Path to the file to analyze

  • max_lines – Maximum number of lines to read for detection (default: 1000)

Returns:

Tuple of (FileFormat enum, reason string)

Raises:
  • FileNotFoundError – If the file does not exist

  • IOError – If the file cannot be read

ihm_validation.format_checker.parse_ihm_cif(fname, encoding='utf8') tuple[source]

Parse an IHMCIF file using the ihm library

ihm_validation.format_checker.validate_cif_against_dictionary(file_path: str, dictionary) None[source]

Validate a CIF file against a dictionary.

Parameters:
  • file_path – Path to the CIF file to validate

  • dictionary – Dictionary object to validate against

Raises:
  • ihm.dictionary.ValidatorError – If validation fails

  • IOError – If file cannot be read

ihm_validation.format_checker.validate_ihmcif(file_path: str) None[source]

Validate an IHMCIF file against the combined PDBx/mmCIF+IHMCIF dictionary.

Deposited integrative models should conform to both the PDBx dictionary (used to define basic structural information such as residues and chains) and the IHM dictionary (used for information specific to integrative modeling). Some entries also use the FLRCIF dictionary for FRET/fluorescence data.

Parameters:

file_path – Path to the IHMCIF file to validate

Raises:

ihm.dictionary.ValidatorError – If validation fails

ihm_validation.format_checker.validate_mmcif(file_path: str) None[source]

Validate a PDBx/mmCIF file against the PDBx dictionary.

Parameters:

file_path – Path to the PDBx/mmCIF file to validate

Raises:

ihm.dictionary.ValidatorError – If validation fails

ihm_validation.futures module

This is a beta-version of a new validation framework

class ihm_validation.futures.CXMSValidator[source]

Bases: Validator

property ertypes

Get all extendend restraint types

property ertypes_df
load_restraint(restraint: CrossLinkRestraint) None[source]

Extract crosslinking-MS data from mmcif file

property number_of_restraint_groups: int
property number_of_restraints: int
property rtdtypes

Get all crosslink types

validate_ensemble(models: list) dict[source]

Validate the ensemble against the data

validate_model(model: Model) dict[source]

Validate the model against the data

class ihm_validation.futures.StereoChemistryValidator[source]

Bases: Validator

validate_model(model: Model) dict[source]

Validate the model against the data

class ihm_validation.futures.Validator[source]

Bases: object

Base validator class

dataset = None
load_restraint(restraint: Restraint)[source]

Parse the restraint data

restraint = None
validate_ensemble(ensemble) dict[source]

Validate the ensemble against the data

validate_model(model: Model) dict[source]

Validate the model against the data

ihm_validation.futures.get_hierarchy_from_atoms(atoms)[source]
ihm_validation.futures.get_hierarchy_from_model(model)[source]
ihm_validation.futures.is_model_atomic(model: Model) bool[source]

Check if model is atomic

ihm_validation.futures.is_model_cg(model: Model) bool[source]

Check if model is atomic

ihm_validation.futures.is_model_mixed(model: Model) bool[source]

Check if model is atomic

ihm_validation.generate_static_html_pages module

ihm_validation.get_plots module

ihm_validation.ihm_validator module

ihm_validation.images module

BASE64 encoded images for the report

ihm_validation.mmcif_io module

ihm_validation.molprobity module

ihm_validation.molprobity_convert module

Convert MolProbity output from json to a pickled object

ihm_validation.molprobity_convert.get_atom_tuple(atom)[source]
ihm_validation.molprobity_convert.rota_rama_result_to_tuple(r)[source]

ihm_validation.precision module

ihm_validation.report module

ihm_validation.sas module

ihm_validation.sas_plots module

ihm_validation.utility module

Module contents

__init__.py - Init file for the package