Gemmi is a C++ library with comprehensive Python bindings designed for structural biology, particularly macromolecular crystallography. It provides tools for working with various file formats like mmCIF, PDB, MTZ, MRC/CCP4, and general CIF/STAR files, handling macromolecular models, refinement restraints, reflection data, and crystallographic symmetry. Currently at version 0.7.5, it is an actively developed open-source project maintained by CCP4 and Global Phasing Ltd.
pip install gemmiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a PDB file using `gemmi.read_file()` and access basic structural elements like models, chains, residues, and atoms. It creates a dummy PDB file for a self-contained, runnable example.
Review your code for any direct interactions with the binding layer or custom C++ extensions. Recompile any custom extensions using nanobind or the latest Gemmi build system. Primarily affects advanced users and developers of Gemmi extensions.
Carefully review any code dealing with crystallographic symmetry operations and `Op` parsing. Explicitly specify the notation kind if ambiguities arise or adapt code to the new consistent behavior.
Update your code to use the new method names. For `UnitCell` matrices, use `unit_cell.frac.mat` and `unit_cell.orth.mat`. For hydrogen site counting, use `residue.has_hydrogen()` or similar atom-level checks.
Refer to the main Gemmi documentation (typically the overview and installation sections) or the project's GitHub repository for the most up-to-date information and examples. Use the search box on the main documentation site.
Ensure you `pip install gemmi` for the Python library and its bindings. If you need the standalone command-line tools, install `gemmi-program`.
Install the package using pip: `pip install gemmi`
Check the mmCIF file for parsing errors or unconventional data. If the file is valid but causes issues, consider reporting it to the `gemmi` developers or trying to pre-process the file to fix problematic entries if feasible. This was often a bug in older gemmi versions fixed in newer ones.
After reading a structure (e.g., `st = gemmi.read_structure(path)`), call `st.setup_entities()` to populate entities and subchains, which are often required for further structural analysis.
No dependency data recorded yet.