From 7af1f9676df8d6198895002c14a3bfcc2af54208 Mon Sep 17 00:00:00 2001 From: dennisbrookner Date: Thu, 19 Oct 2023 14:43:00 -0400 Subject: [PATCH] add --no-bss to matchmaps.ncs + other minor edits --- src/matchmaps/_compute_mr_diff.py | 2 +- src/matchmaps/_compute_ncs_diff.py | 57 +++++++++++++++++++++++- src/matchmaps/_compute_realspace_diff.py | 2 +- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/matchmaps/_compute_mr_diff.py b/src/matchmaps/_compute_mr_diff.py index 9e70b8f..0274f32 100644 --- a/src/matchmaps/_compute_mr_diff.py +++ b/src/matchmaps/_compute_mr_diff.py @@ -46,7 +46,7 @@ def compute_mr_difference_map( rbr_selections : list[str] = None, eff : str = None, keep_temp_files: str = None, - radius = 5, + radius : float = 5, no_bss = False, ): """ diff --git a/src/matchmaps/_compute_ncs_diff.py b/src/matchmaps/_compute_ncs_diff.py index dfb1e78..43dbb84 100644 --- a/src/matchmaps/_compute_ncs_diff.py +++ b/src/matchmaps/_compute_ncs_diff.py @@ -44,8 +44,51 @@ def compute_ncs_difference_map( ncs_chains : list[str] = None, refine_ncs_separately = False, eff : str = None, - keep_temp_files : str = None + keep_temp_files : str = None, + no_bss = False, ): + """ + Compute an internal difference map across non-crystallographic symmetry + + Parameters + ---------- + pdb : Path + Name of input .pdb file to use for phasing + mtz : Path + Name of input .mtz file + F : str + Column in mtz containing structure factor amplitudes + SigF : str, optional + Column in mtz containing structure factor uncertainties (optional) + Phi : str, optional + Column in mtz containing structure factor phases (optional) + ligands : list, optional + Any necessary .cif restrain files for refinement, by default None + name : str, optional + Name prefix for the output maps, by default None + dmin : int, optional + Resolution cutoff for input mtz, by default None + spacing : float, optional + Approximate size of real-space voxels in Angstroms, by default 0.5 A + input_dir : pathlib.Path, optional + Path to directory containing input files, by default Path(".") (current directory), + output_dir : pathlib.Path, optional + Path to directory containing input files, by default Path(".") (current directory), + verbose : bool, optional + If True, print outputs of scaleit and phenix.refine, by default False + ncs_chains : list[str], optional + Chains in input pdb comparable by ncs + refine_ncs_separately : bool, optional + If True, refine each ncs selection as a separate rigid body, by default False + eff : str, optional + Name of a file containing a template .eff parameter file for phenix.refine. + If omitted, the sensible built-in .eff template is used. If you need to change something, + I recommend copying the template from the source code and editing that. + keep_temp_files : str, optional + If not None, the name of a subdirectory of the output_dir into which intermediate matchmaps files are moved upon program completion. + no_bss : bool, optional + If True, skip bulk solvent scaling feature of phenix.refine + """ _validate_environment(ccp4=False) output_dir_contents = list(output_dir.glob("*")) @@ -76,6 +119,7 @@ def compute_ncs_difference_map( verbose=verbose, rbr_selections=rbr_phenix, off_labels=f"{F},{SigF}", + no_bss=no_bss ) # use phenix names for columns when computing FloatGrid @@ -210,6 +254,16 @@ def parse_arguments(): default="./", help="Path to which output files should be written. Optional, defaults to './' (current directory)", ) + + parser.add_argument( + "--no-bss", + required=False, + action="store_true", + default=False, + help=( + "Include this flag to skip bulk solvent scaling in phenix.refine. By default, BSS is included." + ), + ) parser.add_argument( "--spacing", @@ -298,6 +352,7 @@ def main(): dmin=args.dmin, spacing=args.spacing, keep_temp_files=args.keep_temp_files, + no_bss=args.no_bss, ) return diff --git a/src/matchmaps/_compute_realspace_diff.py b/src/matchmaps/_compute_realspace_diff.py index 06c61a0..2193a97 100755 --- a/src/matchmaps/_compute_realspace_diff.py +++ b/src/matchmaps/_compute_realspace_diff.py @@ -45,7 +45,7 @@ def compute_realspace_difference_map( rbr_selections : list[str] = None, eff : str = None, keep_temp_files : str = None, - radius : int = 5, + radius : float = 5, no_bss = False ): """