Skip to content

Dialpuri/DensityCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation

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 .