Skip to content

Commit

Permalink
refine_xtal: decide weight automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
keitaroyam committed Jul 19, 2023
1 parent 9e28748 commit a190615
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions servalcat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
Mozilla Public License, version 2.0; see LICENSE.
"""

__version__ = '0.4.28'
__date__ = '2023-06-23'
__version__ = '0.4.29'
__date__ = '2023-07-19'
13 changes: 10 additions & 3 deletions servalcat/refine/refine_xtal.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def add_arguments(parser):
help='Shake coordinates with specified rmsd')
parser.add_argument('--ncycle', type=int, default=10,
help="number of CG cycles (default: %(default)d)")
parser.add_argument('--weight', type=float, default=1,
help="refinement weight")
parser.add_argument('--weight', type=float,
help="refinement weight (default: auto)")
parser.add_argument('--sigma_b', type=float, default=10,
help="refinement ADP sigma in B (default: %(default)f)")
parser.add_argument('--bfactor', type=float,
Expand Down Expand Up @@ -152,7 +152,14 @@ def main(args):
# initialize ADP
if args.adp != "fix":
utils.model.reset_adp(st[0], args.bfactor, args.adp == "aniso")


# auto weight
if args.weight is None:
logger.writeln("Estimating weight using resolution")
reso = hkldata.d_min_max()[0]
args.weight = numpy.exp(reso * 0.9104 + 0.2162)
logger.writeln(" Will use weight= {:.2f}".format(args.weight))

geom = Geom(st, topo, monlib, shake_rms=args.randomize, sigma_b=args.sigma_b, refmac_keywords=keywords,
unrestrained=args.unrestrained or args.jellyonly, use_nucleus=(args.source=="neutron"))
geom.geom.adpr_max_dist = args.max_dist_for_adp_restraint
Expand Down

0 comments on commit a190615

Please sign in to comment.