ihm_validation package
Submodules
ihm_validation.cx module
Crosslinking-MS validation for PDB-IHM
- class ihm_validation.cx.CxValidation(mmcif_file, cache)[source]
Bases:
GetInputInformation- ID = None
- check_conditional_flag(data: DataFrame) None[source]
Check consistency of conditional flags in a restraint group
- driver = None
- get_cx_data() -> (<class 'pandas.core.frame.DataFrame'>, <class 'pandas.core.frame.DataFrame'>)[source]
Extract crosslinking-MS data from mmcif file
- static pyhmmer_alignment_to_map(hit) -> (<class 'dict'>, <class 'list'>)[source]
Convert HMMER alignment into residue map
ihm_validation.em module
3DEM validation for PDB-IHM
- class ihm_validation.em.EMValidation(mmcif_file, cache)[source]
Bases:
GetInputInformation- ID = None
- VA_TIMEOUT = 900
- driver = None
- static get_em_reconstruction_method(map_metadata)[source]
Get EM reconsruction method from the conrolled vocabulary
ihm_validation.excludedvolume module
Excluded volume assessment for PDB-IHM
ihm_validation.format_checker module
Check residue and atom names in IHMCIF file
- 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_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)[source]
Parse a file, do all checks, throw an exception if a check fails.
- ihm_validation.format_checker.check_file_log(fname: str) int[source]
Parse a file, do all checks, throw a log message if a check fails and return a non-zero exit code
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
ihm_validation.generate_static_html_pages module
A script for generation of validation_help.html and about_validation.html
ihm_validation.get_plots module
Generate overview plots
- class ihm_validation.get_plots.Plots(mmcif, imageDirName, driver)[source]
Bases:
GetInputInformation- plot_quality_at_glance(molprobity_data: dict | None = None, exv_data: dict | None = None, sas_data_quality: dict | None = None, sas_fit: dict | None = None, cx_data_quality: dict | None = None, cx_fit: dict | None = None, em_data_quality: dict | None = None, em_fit: dict | None = None) dict[source]
ihm_validation.ihm_validator module
Main running script
- ihm_validation.ihm_validator.write_html(prefix: str, template_dict: dict, template_list: list, dirName: str)[source]
- ihm_validation.ihm_validator.write_json(mmcif_file: str, template_dict: dict, dirName: str, dirName_Outputs: str)[source]
ihm_validation.images module
BASE64 encoded images for the report
ihm_validation.mmcif_io module
Read/write IHMCIF file
- class ihm_validation.mmcif_io.GetInputInformation(mmcif_file, cache='.', nocache=False)[source]
Bases:
object- property atomic
- property cg
- check_sphere() int[source]
check resolution of structure, returns 0 if its atomic and 1 if the model is multires
- delete_extra_loops(some_text=[]) list[source]
function to help re-write mmcif file for molprobity this cleans up extra loops in the cif file
- property deposition_date
Return initial deposition date
- get_RB_flex_dict() -> (<class 'dict'>, <class 'dict'>, <class 'int'>, <class 'int'>)[source]
get RB and flexible segments from model information
- get_model_rep_dict() dict[source]
Map models to representations useful especially for multi-state systems
- get_representation()[source]
get details on number of model composition based on types of representation listed
- get_representation_details() dict[source]
Extract details about representation (atomic/coarse-grained)
- get_representation_scale(rep, chid=None) dict[source]
Extract details about representation (atomic/coarse-grained)
- property has_crosslinking_ms_dataset
- property has_em_dataset
- property has_sas_dataset
- mmcif_get_lists(filetemp=None) -> (<class 'list'>, <class 'dict'>, <class 'dict'>, <class 'list'>)[source]
function to help re-write mmcif file for molprobity this function reads the atom_site dictionary terms and returns a list
- nocache = False
- property num_models
- remove_flr(some_text=[]) list[source]
function to help re-write mmcif file for molprobity this deletes all flr related text/key-value pairs
- property sequences: dict
Return dictionary with sequences of polymeric entities from mmcif entry
- class ihm_validation.mmcif_io.IHMVAvailableModes(value)[source]
Bases:
EnumAn enumeration.
- DEVELOPMENT = 1
- PRODUCTION = 0
- ihm_validation.mmcif_io.get_operational_mode() IHMVAvailableModes[source]
Check environment variables and set the operational mode
ihm_validation.molprobity module
Perform MolProbit assessment
- class ihm_validation.molprobity.AtomSiteVariant(model_id: int | None = None)[source]
Bases:
VariantUsed to select typical PDBx/IHM file output. See
write().
- class ihm_validation.molprobity.GetMolprobityInformation(mmcif_file, cache='.', nocache=False)[source]
Bases:
GetInputInformation- convert = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/ihmvalidation/checkouts/v3.0/ihm_validation/molprobity_convert.py')
- data = {}
- get_internal_version(tool: str = 'molprobity.clashscore') str[source]
Get internal molprobity version. We assume that all tools belong to the same release.
- property models: list
- property molprobity_version: str
Get MolProbity version. We assume that all tools belong to the same release.
- class ihm_validation.molprobity.MyModelDumper(model_id: int | None = None)[source]
Bases:
_ModelDumper- dump(system, writer)[source]
Use writer to write information about system to mmCIF or BinaryCIF.
- Parameters:
system (
ihm.System) – Theihm.Systemobject containing all information about the system.writer (
ihm.format.CifWriterorihm.format_bcif.BinaryCifWriter.) – Utility class to write data to the output file.
- model_id = None
ihm_validation.molprobity_convert module
Convert MolProbity output from json to a pickled object
ihm_validation.precision module
Run local precision assessment (PrISM)
ihm_validation.report module
Generation of PDF and HTML reports
- class ihm_validation.report.WriteReport(mmcif_file, db, cache, nocache=False, enable_sas=False, enable_cx=False, enable_em=False, enable_prism=False)[source]
Bases:
object- run_cx_validation(Template_Dict: dict) dict[source]
get cx validation information from mmcif files NOTE: this function is incomplete it currently evaluates satisfaction from mmcif files and not the enetire ensemble
- run_cx_validation_plots(Template_Dict: dict, imageDirName: str) None[source]
create validation plots for cx datasets NOTE: this function is incomplete, the plots are also ugly and need to be refined
- run_entry_composition(Template_Dict: dict) dict[source]
get entry composition, relies on IHM library
- run_model_quality(Template_Dict: dict, csvDirName: str, htmlDirName: str) -> (<class 'dict'>, <class 'dict'>, <class 'dict'>, <class 'dict'>, <class 'dict'>)[source]
get excluded volume for multiscale models get MolProbity info for atomic models exception: models with DNA–we need a way to assess models with DNA
- run_quality_glance(molprobity_dict: dict, exv_data: dict, sas_data_quality: dict, sas_fit: dict, cx_data_quality: dict, cx_fit: dict, em_data_quality: dict, em_fit: dict, imageDirName: str) dict[source]
get quality at glance image; will be updated as validation report is updated
- run_sas_validation(Template_Dict: dict) -> (<class 'dict'>, <class 'dict'>, <class 'dict'>)[source]
get sas validation information from SASCIF or JSON files
- run_sas_validation_plots(Template_Dict: dict, imageDirName: str)[source]
get sas validation information from SASCIF or JSON files
- run_supplementary_table(Template_Dict, location='N/A', physics=['Information about physical principles was not provided'], method_details='N/A', sampling_validation=None, validation_input=['-'], cross_validation='N/A', Data_quality=['-'], clustering=None, resolution='N/A')[source]
get supplementary table, will be updated as validation report is updated
ihm_validation.sas module
SAS assessment for PDB-IHM
- class ihm_validation.sas.SasValidation(mmcif_file, db='.')[source]
Bases:
GetInputInformation- get_Guinier_data() -> (<class 'dict'>, <class 'dict'>)[source]
get Guinier plot data from JSON files
- get_sas_ids() list[source]
function to get all SASBDB codes used in the model, returns a list of SASBDB codes
ihm_validation.sas_plots module
Generate plots for SAS assessment
- class ihm_validation.sas_plots.SasValidationPlots(mmcif_file, imageDirName, driver, db='.')[source]
Bases:
SasValidation- plot_intensities_log(sasbdb: str, df: DataFrame)[source]
plot intensities on a log scale with errors
ihm_validation.utility module
Various helper functions
- ihm_validation.utility.calc_optimal_range(counts: list) tuple[source]
heuristics to find optimal range for plots
>>> calc_optimal_range((10, 1567)) (9.0, 1568.5669999999998)
- ihm_validation.utility.check_for_dataset_type(dataset_list: list | None = None, dataset_type=None) bool[source]
check if the specific dataset type is present in the dataset list
- ihm_validation.utility.compress_cx_stats(cx_stats: dict) list[source]
Extract per-model satisfactions stats as a flat list
- ihm_validation.utility.dict_to_JSlist_rows(dict1: dict, dict2: dict) list[source]
format rigid and flexible segments
- ihm_validation.utility.format_RB_text(tex: list) str[source]
convert RB information to text for supp table
- ihm_validation.utility.format_flex_text(tex: list) str[source]
convert flex information to text for supp table
- ihm_validation.utility.format_wwpdb_id(pdbid: str) str[source]
Format all pdb ids to extended format
- ihm_validation.utility.format_wwpdb_url(pdbid: str) str[source]
Generate a url to the wwPDB entry page
- ihm_validation.utility.get_RB(data_list: list) list[source]
format RB for supplementary/summary table
- ihm_validation.utility.get_alphafolddb_link(acc: str) str | None[source]
Format link for AlphaFold DB
- ihm_validation.utility.get_cx_data_fits(cx_dict: dict) list[source]
format crosslinking-MS data for supplementary/summary table
- ihm_validation.utility.get_datasets(data_dict: dict) list[source]
format datasets for supplementary/summary table
- ihm_validation.utility.get_datasets_summary(system: System) list[source]
Get counts for all data types used for modeling
- ihm_validation.utility.get_flex(data_list: list) list[source]
format flexible regions for supplementary/summary table
- ihm_validation.utility.get_hierarchy_from_atoms(atoms) dict[source]
Construct polymer hierarchy from a list of atoms
- ihm_validation.utility.get_hierarchy_from_model(model) dict[source]
Construct polymer hierarchy from atoms and beads in the model
- ihm_validation.utility.get_larget_assembly_model(system: System) tuple[source]
Find model ID corresponding to the largest assembly
- ihm_validation.utility.get_method_name(sample_dict: dict) str[source]
format method name for supplementary/summary table
- ihm_validation.utility.get_method_type(sample_dict: dict) str[source]
format method type for supplementary/summary table
- ihm_validation.utility.get_restraints_info(restraints: dict) list[source]
format restraints info for supplementary/summary table
- ihm_validation.utility.get_rg_data(rg_dict: dict) list[source]
format rg data for supplementary/summary table
- ihm_validation.utility.get_rg_data_fits(rg_dict: dict) list[source]
format sas model fits for supplementary/summary table
- ihm_validation.utility.get_software(data_dict: dict) list[source]
format software for supplementary/summary table
- ihm_validation.utility.get_subunits(sub_dict: dict) list[source]
format chains for supplementary/summary table
- ihm_validation.utility.get_unique_datasets(name: dict) list[source]
get all datatypes that are yet to be validated the ones that can’t or the ones that have already been validated are in the sub_data set
- ihm_validation.utility.mp_readable_format(mp: dict) list[source]
Format MolProbity results for supplementary/summary table
- ihm_validation.utility.order_of_magnitude(value: float) float[source]
calculate the order of magnitude for a given number
>>> order_of_magnitude(135) 2.0
Module contents
__init__.py - Init file for the package