diff --git a/docs/grid.rst b/docs/grid.rst index fe1a2863..b3edb143 100644 --- a/docs/grid.rst +++ b/docs/grid.rst @@ -509,7 +509,7 @@ The parameters of SolventMasker can be inspected and changed: >>> masker.atomic_radii_set >>> masker.rprobe - 1.11 + 1.1 >>> masker.rshrink 0.9 >>> masker.island_min_volume # 0 = unused diff --git a/examples/maskcheck.py b/examples/maskcheck.py index f6a88668..93bbedf8 100644 --- a/examples/maskcheck.py +++ b/examples/maskcheck.py @@ -43,20 +43,24 @@ def maskcheck(mask_path, coor_path, output_diff_map=None, verbose=False): grid2.copy_metadata_from(grid) masker.put_mask_on_int8_grid(grid2, st[0]) - compare_mask_arrays(grid, grid2) + compare_mask_arrays(grid, grid2, verbose) if verbose: print_nearby_atoms(st, grid, grid2) if output_diff_map: write_diff_map(grid, grid2, output_diff_map) -def compare_mask_arrays(grid1, grid2): +def compare_mask_arrays(grid1, grid2, verbose): arr1 = numpy.array(grid1, copy=False) arr2 = numpy.array(grid2, copy=False) if arr1.shape != arr2.shape: sys.exit('Different grid sizes %s and %s. Exiting.' % (arr1.shape, arr2.shape)) print('Size: %d x %d x %d,' % arr1.shape, 'total', arr1.size, 'points') + if (arr1 == arr2).all(): + print("Identical.") + if not verbose: + return t = 2 * (arr1 != 0) + (arr2 != 0) print('File-Gemmi Count Fraction') for (a, b) in [(0, 0), (1, 1), (0, 1), (1, 0)]: diff --git a/include/gemmi/solmask.hpp b/include/gemmi/solmask.hpp index 21a8d761..14ac0ed6 100644 --- a/include/gemmi/solmask.hpp +++ b/include/gemmi/solmask.hpp @@ -231,7 +231,7 @@ struct SolventMasker { island_min_volume = 0.; break; case AtomicRadiiSet::Cctbx: - rprobe = 1.11; + rprobe = 1.1; rshrink = 0.9; island_min_volume = 0.; break; diff --git a/run-tests.sh b/run-tests.sh index a5c4d723..b5315429 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # I use this script for building, testing and updating docs. @@ -144,3 +144,15 @@ if [ $1 = w -o $1 = a ]; then (cd wasm/mtz && ./compile.sh) (cd ../wasm/convert && make clean && make) fi + +if [ $1 = M -o $1 = a ]; then + echo "check bulk solvent mask against cctbx" + for code in 1keb 1mru 5oo5 6dd6; do + echo Testing mask for $code ... + pdb="${PDB_DIR}/structures/divided/pdb/${code:1:2}/pdb${code}.ent.gz" + zcat $pdb > /tmp/file.pdb + mmtbx.python -m mmtbx.command_line.mask /tmp/file.pdb + $PYTHON examples/maskcheck.py mask.ccp4 /tmp/file.pdb + /bin/rm mask.ccp4 + done +fi diff --git a/tests/test_examples.py b/tests/test_examples.py index 53472155..ad68be69 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -79,10 +79,10 @@ def test_maskcheck(self): Generating CCTBX-compatible mask ... Size: 72 x 72 x 150, total 777600 points File-Gemmi Count Fraction -0-0 511128 65.73% -1-1 265740 34.17% -0-1 0 0.00% -1-0 732 0.09% +0-0 509676 65.54% +1-1 265788 34.18% +0-1 1452 0.19% +1-0 684 0.09% ''' self.assertEqual(output.splitlines(), expected_output.splitlines())