[cctbxbb] Best way to compare two structures using cctbx?

Luc Bourhis luc_j_bourhis at mac.com
Mon Mar 4 07:18:03 PST 2013


Hi Jan,

the cctbx does not have a tool doing exactly what you describe. But there is cctbx.euclidean_model_matching, that we all call emma, which could be close enough. It tries to find the best isometry matching the biggest subset of the 1st structure onto the 2nd structure, and since an isometry preserves bond lengths, angles and even torsion angles, perhaps you may find that tool useful. Here is a very quick kickstarter:

Starting from two instances of xray.structure xs1 and xs2 for the two structures you wish to compare, the following is all you need to do


from cctbx import euclidean_model_matching as emma
....
m = emma.model_matches(
    xs1.as_emma_model(),
    xs2.as_emma_model(),
    tolerance=0.5,
    break_if_match_with_no_singles=False
    ).refined_matches[0]

Then m.rms gives the rms for the discrepancy between each set of coordinates, while m.rt gives you the symmetry that had to be applied to best match each structures.
Then m.singles1 is the list of scatterers in the 1st structure that could not be matched to any scatterer in the 2nd one. Obviously, m.singles2 is the other-way around. Finally, m.pairs is the mapping established between a subset of the 1st structure and a subset of the 2nd structure.

HtH,

Luc



More information about the cctbxbb mailing list