Quickstart

Load reflection data and preview the rs.DataSet object.

[1]:
import reciprocalspaceship as rs
[2]:
dataset = rs.read_mtz("data/HEWL_SSAD_24IDC.mtz")
dataset.head()
[2]:
FreeR_flag IMEAN SIGIMEAN I(+) SIGI(+) I(-) SIGI(-) N(+) N(-)
H K L
0 0 4 14 671.0396 22.205784 671.0396 22.205784 671.0396 22.205784 16 16
8 4 3273.7385 107.59589 3273.7385 107.59589 3273.7385 107.59589 16 16
12 6 1367.5679 43.352566 1367.5679 43.352566 1367.5679 43.352566 16 16
16 19 4158.55 198.88382 4158.55 198.88382 4158.55 198.88382 8 8
20 8 2.4992087 5.7103205 2.4992087 5.7103205 2.4992087 5.7103205 1 1

The above table should look familiar to Python users that have experience with pandas. Thers.DataSet objects also store unit cell and spacegroup information as attributes. These attributes are stored as gemmi objects. For more information on the gemmi Python library, please see their documentation.

[3]:
print(dataset.cell)
<gemmi.UnitCell(79.3435, 79.3435, 37.8098, 90, 90, 90)>
[4]:
print(dataset.spacegroup)
<gemmi.SpaceGroup("P 43 21 2")>

To illustrate using the unit cell parameter information, let’s compute the highest resolution reflection in the dataset:

[5]:
dataset.compute_dHKL(inplace=True)
dataset.head()
[5]:
FreeR_flag IMEAN SIGIMEAN I(+) SIGI(+) I(-) SIGI(-) N(+) N(-) dHKL
H K L
0 0 4 14 671.0396 22.205784 671.0396 22.205784 671.0396 22.205784 16 16 9.45245
8 4 3273.7385 107.59589 3273.7385 107.59589 3273.7385 107.59589 16 16 4.726225
12 6 1367.5679 43.352566 1367.5679 43.352566 1367.5679 43.352566 16 16 3.1508167
16 19 4158.55 198.88382 4158.55 198.88382 4158.55 198.88382 8 8 2.3631124
20 8 2.4992087 5.7103205 2.4992087 5.7103205 2.4992087 5.7103205 1 1 1.8904899
[6]:
print(f"{dataset.dHKL.min():.2f} angstroms")
1.71 angstroms