Treat the problem shape as non-centered, that is, the structure does not include an explicit central atom (only ligand/vertex coordinates are given).
-c, --center
<POSITION>
1-based position of the atom in the .xyz table that is the centre of the structure. Defaults to the first atom (position 1) when omitted. Cannot be combined with --nc.
-s, --sh
<SHAPES>...
Restrict the comparison to specific built-in reference shapes by index, for the detected vertex count. If omitted, all applicable built-in shapes are used. Separate the indices with whitespace.
-r, --ref
<USER_SHAPES>...
Paths to the YAML files that contain user-defined shapes to include in the CShM calculation. Separate the files with whitespace.
-t, --table
Write a name_cshm_table.csv file containing the output of the calculation.
-i, --ideal
Write a name_ideal.xyz file containing the reconstructed idealised structures for all the selected reference shapes.
Oh…, I lost my crab here. 🦀 Thanks for finding it!
Optimal transformation finding
For any given shapes, it can be shown that the optimal translation and scaling are obtained by centring both shapes on
their geometric centres and normalizing their size. The optimal rotation R is then the one that minimizes
∑iN∣Rqi−pi∣2, which is solved via singular-value decomposition of the covariance matrix H=PTQ.
Vertex pairing
Naively finding the best point-pair matches between Q and P, grows with N!. The combinatorial problem is tackled by:
Fixed centre: for centred structures, the central atom is paired with the reference shape’s centre, reducing the dimensionality of the problem to (N−1)!
Branch and bound: after each partial assignment of point pairs, a best-scenario S value is calculated. Permutations that cannot beat the best S found so far are discarded early.
Computational cost
Even by taking these measures, the calculation becomes impractical at N>13 and completely unaccessible for N>24. There is a plan to include heuristic matching for large shapes in cshm in the future.
Examples
Distorted octahedral iron(II) complex, with a user-defined shape
The FeHS_ideal.xyz file was produced by passing the -i/--ideal flag. The coordinates of the ideal octahedron placed in the correct position of the structure can be extracted from it.
Note that ebcT-6 is a non-standard reference shape included by passing the --ref flag. Its YAML definition is on the user-defined shapes page.
Non-centred structure: a pyridine ring
A pyridine ring has no central atom, so the -n/--nc flag is needed. All six atoms are then treated as vertices.
The ring is an almost perfect hexagon (HP-6, 0.014). CShM only compares positions, so the nitrogen atom is treated like any other vertex.
Restricting the comparison to selected shapes
For a five-coordinate cadmium centre, only the trigonal bipyramid and the square pyramid are of interest. Their indices for five vertices are 2 (TBPY-5) and 3 (SPY-5):