hikari.scripts.compare_adps
Attributes
Functions
|
Compare Anisotropic Displacement Parameters of all atoms in two cif blocks |
|
Make a gif presenting the change of similarity index against some arbitrary |
Module Contents
- hikari.scripts.compare_adps.calculate_similarity_indices(cif1_path, cif2_path=None, cif1_block=None, cif2_block=None, output_path=None, normalize=False, uncertainties=True)[source]
Compare Anisotropic Displacement Parameters of all atoms in two cif blocks and return a Similarity Index (SI) for these pairs of atoms that exist and are defined anisotropic (via “_atom_site_aniso_U_**”) in both files.
This script requires two independent cif blocks to run, but the location of both blocks can be specified in multiple ways:
If only cif1_path is given, the first and second data block from cif1 file will be used in SI evaluation;
If cif1_path and cif2_path are given, the first data block from each cif file will be used instead;
If cif1_path, cif2_path, and cif1_block are given, cif1_block from each cif1_path and cif2_path cif files will be used.
If cif1_path, cif2_path, cif1_block, and cif2_block are given, cif1_block in cif1_path and cif2_block in cif2_path will be used.
For a single cif file ‘glycine.cif’ with two data blocks named ‘100K’ and ‘RT’, the three following commands will have the same effect:
- Example:
- Parameters:
cif1_path (str)
cif2_path (str)
cif1_block (str)
cif2_block (str)
output_path (str)
normalize (bool)
uncertainties (bool)
- Return type:
None
>>> calculate_similarity_indices('glycine.cif') >>> calculate_similarity_indices('glycine.cif', 'glycine.cif') >>> calculate_similarity_indices('glycine.cif', 'glycine.cif', '100K', 'RT')
For two cif files ‘X-rays.cif’ and ‘neutrons.cif’ with data block named ‘RT’ and ‘100K’ (one each), the two following commands will have the same effect:
- Example:
- Parameters:
cif1_path (str)
cif2_path (str)
cif1_block (str)
cif2_block (str)
output_path (str)
normalize (bool)
uncertainties (bool)
- Return type:
None
>>> calculate_similarity_indices('X-rays.cif', 'neutrons.cif') >>> calculate_similarity_indices('X-rays.cif', 'neutrons.cif', 'RT', '100K')
The behaviour of script can be further altered via other parameters. If output_file is set True, the results will be written there instead of console. If uncertainties is set True, standard deviations of all ADPs as well as the unit cell parameters from 1st cif file will be assumed uncorrelated and used to estimate the uncertainty of every SI determination.
For more information about Similarity Index (SI) itself, please consult Whitten and Spackman, Acta Cryst B 62, 875 (2006) https://doi.org/10.1107/S0108768106020787.
- Parameters:
cif1_path (str) – Absolute or relative path to the first cif file.
cif2_path (str) – Absolute or relative path to the second cif file. If not specified, it is assumed equal to cif1_path.
cif1_block (str) – Name of the first data block used in SI determination. It points to the data block inside the file specified by cif1_path. If not specified, the first block found in said file will be used.
cif2_block (str) – Name of the second data block used in SI determination. It points to the data block inside the file specified by cif2_path. If not specified, the first unused block in said file will be used.
output_path (str) – Path where the output of the program should be written.
uncertainties (bool) – If True, propagate the standard deviations of individual ADPs’ and cif1’s unit cell to estimate SI’s uncertainties.
normalize (bool) – If True, equalize the volume of displacement ellipsoids by normalizing the determinants of ADP matrices expressed in cartesian coordinates. As a result, SI is a function of displacement “shape” only.
- Return type:
None
- hikari.scripts.compare_adps.animate_similarity_index(u_diag, transformations, output_path)[source]
Make a gif presenting the change of similarity index against some arbitrary series of transformations. Initial displacement matrix must be diagonal, values given in u_diag, evaluated against a regular unit cell with a = 1.
- Parameters:
u_diag (Iterable) – triplet of u matrix diagonal elements
transformations (list[numpy.ndarray]) – list of transformations to be plotted every 0.1 sec
output_path (str) – path where resulting gif file will be saved
- Return type:
None
- hikari.scripts.compare_adps.t1