project-gemmi / gemmi

macromolecular crystallography library and utilities
https://project-gemmi.github.io/
Mozilla Public License 2.0
205 stars 42 forks source link

Inconsistency in mtz labels in sf2mtz and then sf2map (DELPHWT vs PHDELWT) #272

Closed epeisach closed 1 year ago

epeisach commented 1 year ago

I would like to combine the public phases from the wwPDB validation report - and then produce maps.

Yes - I can go straight from cif -> map -- but I have reason for mtz.

The labels of sf2mtz are inconsistent with sf2map option

%gemmi cif2mtz 1o08_validation_fo-fc_map_coef.cif foo2.mtz

% gemmi mtz foo2.mtz Title: Converted from mmCIF block 1o08fo Total Number of Datasets = 2

Dataset 0 HKL_base > HKL_base > HKL_base: cell 36.939 54.297 104.68 90 90 90 wavelength 0 Dataset 1 unknown > unknown > unknown: cell 36.939 54.297 104.68 90 90 90 wavelength 0

Number of Columns = 6 Number of Reflections = 66368 Number of Batches = 0 Missing values marked as: nan Global Cell (obsolete): 36.939 54.297 104.68 90 90 90 Resolution: 1.20 - 48.20 A Sort Order: 0 0 0 0 0 Space Group: P 21 21 21 Space Group Number: 19

Header info (run with option -s for recalculated statistics): Column Type Dataset Min Max H H 0 0 30 K H 0 0 45 L H 0 0 87 FOM W 1 0 1 DELFWT F 1 0 758.72 DELPHWT P 1 0 360

History (1 lines): From gemmi-cif2mtz 0.6.2

gemmi sf2map -d foo2.mtz fo.map zsh: segmentation fault gemmi sf2map -d foo2.mtz fo.map

sf2map requires PHDELWT.

PHDELWT is recommended by CCP4 from refmac/sigmaa documentation.

I think the default spec for cif2mtz should be changed to:

pdbx_DELPHWT PHDELWT P 1

wojdyr commented 1 year ago

Yes. That segmentation fault also needs to be fixed. I'll address it when I'm back home – on Thursday.

wojdyr commented 1 year ago

I ran the same commands on https://files.wwpdb.org/pub/pdb/validation_reports/o0/1o08/1o08_validation_fo-fc_map_coef.cif.gz but instead of segmentation fault I got: ERROR: Default map coefficient labels not found.

So I couldn't reproduce the segfault, but I changed the default spec as suggested. And also changed sf2map so it doesn't check the label of phase column. It now takes the next column after the amplitude, and if the type of this column is P it's assumed that it contains the corresponding phases. I think it should work fine, but we'll see.