Skip to main content

center-map

center_map recenters crystallographic density maps on the model, the way the old EDS/RCSB DSN6 maps were. It is a command for PyMOL.

Maps from fetch 3tj3, type=2fofc (PDBe) cover one unit cell starting at the origin, so much of the model sits outside them. center_map cuts a new box around the selection out of the periodic crystal.

Install

Into the Python environment the viewer runs in:

pip install center-map

then add one line to ~/.pymolrc:

import center_map

Without pip (e.g. bundled installers): Plugin > Plugin Manager > Install New Plugin and choose center_map.py. The only dependency is numpy, which is already bundled.

Use

fetch 3tj3
fetch 3tj3, type=2fofc
center_map                          # all maps, all atoms, 5 A margin
isomesh mesh, 3tj3_2fofc, 1.0

center_map 3tj3_2fofc, chain A      # again, on one chain of one map

center_map replaces the map object in place; make meshes after it. A centered map can be centered again on atoms inside its box; for a bigger box, fetch the map again. help center_map lists the arguments.

Why the density is exact

  • Crystal density is periodic, so a map covering one full unit cell already holds every value: grid point i is grid point i mod N. The box is filled by copying grid values; nothing is interpolated or resampled, also for non-orthogonal cells.
  • The original contour scale is kept. Maps are normally rescaled on load to the sigma of the loaded grid, which for a box around the protein differs from the sigma of the cell; that is switched off while the box is loaded.
  • It refuses maps it cannot handle exactly: maps that do not cover a full unit cell (e.g. asymmetric-unit maps from CCP4 fft), and maps whose cell differs from the selection's (cryo-EM maps, maps made with map_new, other crystal forms).

Limitations

One map state; object matrices (moved objects) are ignored.

Tests

pip install pytest gemmi
python -m pytest tests      # downloads a few PDBe maps on the first run

gemmi is used only by the tests, as an independent reference: the boxes must match gemmi's periodic lookup bit for bit (P 21 21 21, P 1, P 21 and I 2 2 2 entries), land on the original map when the viewer places them, and cover every atom plus the margin.

License

MIT. PyMOL is a trademark of Schrödinger, LLC. This project is not affiliated with or endorsed by Schrödinger.

Metadata

Release files for center-map 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for center-map 0.1.0
File Size Uploaded Provenance Actions
center_map-0.1.0.tar.gz 7.0 kB With provenance Details for center_map-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for center-map 0.1.0
File Interpreter ABI Platform Actions
center_map-0.1.0-py3-none-any.whl Python 3 none any Details for center_map-0.1.0-py3-none-any.whl

Total release size: 12.3 kB

Release files / center_map-0.1.0.tar.gz

Download URL center_map-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d769bd0e69cc13367360002931e6246f9985e12a95b04657bda60e97a9c7e969
BLAKE2b-256 checksum
How to use checksums
b1b5f4c46ad3c77918a88e96920fe25fab4506198bf856490f15f8cf8188b99b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / center_map-0.1.0-py3-none-any.whl

Download URL center_map-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be75630e96500141eb88d5bded5dc49f69e7e6a9dd7d11a3612a04a8f0f29ba4
BLAKE2b-256 checksum
How to use checksums
2d4765727f2fac1c27a74e7df83577a221a0094c1135d56aafe42a84a0a16bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for center-map 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for center_map-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page