density-calculator

density_calculator: Calculate mFo-DFc density with Clipper through Gemmi!


License
BSD-3-Clause
Install
pip install density-calculator==0.0.1

Documentation

Density Calculator

Density Calculator is a library for calculating a $mFo-DFc$ maps from gemmi in-memory objects.

Installation

pip install density-calculator

Usage

Function Signature:

density_calculator.calculate(structure: gemmi.Structure, mtz: gemmi.Mtz, column_names: List[str]) -> gemmi.Mtz

Example Use:

import density_calculator
import gemmi

mtz: gemmi.Mtz = gemmi.read_mtz_file("reflections.mtz")
st: gemmi.Structure = gemmi.read_structure("model.pdb")

# Calculate the difference map using density_calculator
recalculated_mtz: gemmi.Mtz = density_calculator.calculate(st, mtz, ["FP", "SIGFP"])

# Transform the difference_mtz into a map for calculation use
best_map: gemmi.FloatGrid = recalculated_mtz.transform_f_phi_to_map("FWT", "PHWT")

# Transform the difference_mtz into a map for calculation use
difference_map: gemmi.FloatGrid = recalculated_mtz.transform_f_phi_to_map("DELFWT", "PHDELWT")

Development

pip install --no-build-isolation --config-settings=editable.rebuild=true -Cbuild-dir=build -ve .