API Reference

This page provides documentation for all public-facing objects, methods, and functions in reciprocalspaceship. Since this library was designed to provide a “crystallographically-aware” pandas.DataFrame, many methods are inherited directly from or are compatible with the Pandas API.

Warning

Functions available through the rs.utils namespace are considered private, and may change between releases. These functions underlie the symmetry/spacegroup-related operations that are supported in reciprocalspaceship, and user-facing methods that use the rs.utils functions are available as methods of rs.DataSet.

Reflection Data

Python objects for representing reflection data – tabular data with values (columns) that are indexed by Miller HKL indices. These two objects can be thought of as crystallographically-aware versions of pandas.DataFrame and pandas.Series, respectively.

DataSet

Representation of a crystallographic dataset.

DataSeries

One-dimensional ndarray with axis labels, representing a slice of a DataSet.

Input/Output

Supported crystallographic file formats for data I/O. Although they are not listed below, write functions for reflection file formats are available as methods of rs.DataSet objects.

read_mtz

Populate the dataset object with data from an MTZ reflection file.

read_cif

Populate the dataset object with reflection data from a CIF/ENT file.

read_csv

Read a comma-separated values (csv) file into a DataSet.

read_pickle

Load pickled reciprocalspaceship object from file.

read_precognition

Initialize attributes and populate the DataSet object with data from a precognition hkl or ii file of reflections.

read_crystfel

Initialize attributes and populate the DataSet object with data from a CrystFEL stream with indexed reflections.

write_ccp4_map

Write CCP4 map file from NumPy array of real-space density.

Algorithms

Algorithms for processing reflection data stored in rs.DataSet objects.

merge

Merge dataset using inverse-variance weights.

scale_merged_intensities

Scales merged intensities using Bayesian statistics in order to estimate structure factor amplitudes.

compute_intensity_from_structurefactor

Compute intensities (I) and uncertainty estimates (SigI) from structure factor amplitudes (F) and their uncertainties (SigF) using error propagation

Summary Statistics

Summary statistics that can be computed from rs.DataSet objects.

compute_completeness

Compute completeness of DataSet by resolution bin.

Helpful Functions

Functions intended to help users work with the library. These functions are available from the top-level rs namespace.

concat

Concatenate rs objects along a particular axis.

summarize_mtz_dtypes

Returns a table summarizing the MTZ Dtypes that can be used in a DataSet or DataSeries.

Commandline Tools

Commandline tools to support common use cases.

rs.mtzdump

Summarize the contents of an MTZ file