{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Basics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`reciprocalspaceship` provides methods for reading and writing MTZ files, and can be easily used to join reflection data by Miller indices. We will demonstrate these uses by loading diffraction data of tetragonal hen egg-white lysozyme (HEWL)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0.9.9\n" ] } ], "source": [ "import reciprocalspaceship as rs\n", "print(rs.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This diffraction data was collected at the Sector 24-ID-C beamline at [NE-CAT](https://lilith.nec.aps.anl.gov/) at APS. Diffraction images were collected at ambient room temperature (295K), and low energy (6550 eV) in order to collect native sulfur anomalous diffraction for experimental phasing. The diffraction images were processed in [DIALS](https://dials.github.io/) for indexing, geometry refinement, and spot integration, and scaling and merging was done in [AIMLESS](http://www.ccp4.ac.uk/html/aimless.html). This data reduction yielded an MTZ file that is included in the `data/` subdirectory. Here, we will load the MTZ file and inspect its contents." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---\n", "### Loading reflection data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Reflection tables can be loaded using the top-level function, `rs.read_mtz()`. This returns a `DataSet` object, that is analogous to a `pandas.DataFrame`. " ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'DataSet'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "refltable = rs.read_mtz(\"data/HEWL_SSAD_24IDC.mtz\")\n", "type(refltable).__name__" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This reflection table was produced directly from `AIMLESS`, and contains several different data columns:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | \n", " | \n", " | FreeR_flag | \n", "IMEAN | \n", "SIGIMEAN | \n", "I(+) | \n", "SIGI(+) | \n", "I(-) | \n", "SIGI(-) | \n", "N(+) | \n", "N(-) | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
H | \n", "K | \n", "L | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
0 | \n", "0 | \n", "4 | \n", "14 | \n", "661.29987 | \n", "21.953098 | \n", "661.29987 | \n", "21.953098 | \n", "661.29987 | \n", "21.953098 | \n", "16 | \n", "16 | \n", "
8 | \n", "4 | \n", "3229.649 | \n", "105.980934 | \n", "3229.649 | \n", "105.980934 | \n", "3229.649 | \n", "105.980934 | \n", "16 | \n", "16 | \n", "||
12 | \n", "6 | \n", "1361.8672 | \n", "43.06085 | \n", "1361.8672 | \n", "43.06085 | \n", "1361.8672 | \n", "43.06085 | \n", "16 | \n", "16 | \n", "||
16 | \n", "19 | \n", "4124.393 | \n", "196.89108 | \n", "4124.393 | \n", "196.89108 | \n", "4124.393 | \n", "196.89108 | \n", "8 | \n", "8 | \n", "||
1 | \n", "0 | \n", "1 | \n", "16 | \n", "559.33685 | \n", "8.6263 | \n", "559.33685 | \n", "8.6263 | \n", "559.33685 | \n", "8.6263 | \n", "64 | \n", "64 | \n", "