Skip to content

Commit 495a726

Browse files
committed
Add modification scoring and adjust stiffening of ring bridges.
* Angles through transmuting physical neighbours are skipped when a better scoring neighbour exists. * The planar triple junction handler not picks the worst-scoring physical atom rather than the first. * Angles involving ring bridge atoms now are now stiffened with a reduced k_kard_ring=75 to avoid strain on the ring geometry.
1 parent ac740e9 commit 495a726

3 files changed

Lines changed: 205 additions & 33 deletions

File tree

src/ghostly/_cli.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ def run():
9999
required=False,
100100
)
101101

102+
parser.add_argument(
103+
"--k-hard-ring",
104+
type=str,
105+
help="""
106+
The force constant to use when setting angle terms involving ghost
107+
atoms to 90 degrees for bridge atoms that are in a ring. A lower
108+
value reduces strain where the 90 degree target fights the natural
109+
ring geometry.
110+
""",
111+
default="75 kcal/mol/rad**2",
112+
required=False,
113+
)
114+
102115
parser.add_argument(
103116
"--k-soft",
104117
type=str,
@@ -279,6 +292,12 @@ def run():
279292
logger.error(f"An error occurred while parsing the k-hard value: {e}")
280293
sys.exit(1)
281294

295+
try:
296+
k_hard_ring = sr.u(args.k_hard_ring)
297+
except Exception as e:
298+
logger.error(f"An error occurred while parsing the k-hard-ring value: {e}")
299+
sys.exit(1)
300+
282301
try:
283302
k_soft = sr.u(args.k_soft)
284303
except Exception as e:
@@ -289,6 +308,9 @@ def run():
289308
if not k_hard.has_same_units(u):
290309
logger.error("k-hard must have units of kcal/mol/rad**2")
291310
sys.exit(1)
311+
if not k_hard_ring.has_same_units(u):
312+
logger.error("k-hard-ring must have units of kcal/mol/rad**2")
313+
sys.exit(1)
292314
if not k_soft.has_same_units(u):
293315
logger.error("k-soft must have units of kcal/mol/rad**2")
294316
sys.exit(1)
@@ -330,9 +352,10 @@ def run():
330352
system, modifications = modify(
331353
system,
332354
k_hard.value(),
333-
k_soft.value(),
334-
args.optimise_angles,
335-
args.num_optimise,
355+
k_hard_ring=k_hard_ring.value(),
356+
k_soft=k_soft.value(),
357+
optimise_angles=args.optimise_angles,
358+
num_optimise=args.num_optimise,
336359
soften_anchors=args.soften_anchors,
337360
stiffen_rotamers=args.stiffen_rotamers,
338361
k_rotamer=k_rotamer.value(),

0 commit comments

Comments
 (0)