@@ -450,7 +450,9 @@ def format_bond(equilibrium_values, force_constants):
450450 )
451451
452452 # Format the parameters for the angles and dihedrals
453- def format_angle (equilibrium_values , force_constants , restraint_lambda , perturbed = True ):
453+ def format_angle (
454+ equilibrium_values , force_constants , restraint_lambda , perturbed = True
455+ ):
454456 """
455457 Format the angle equilibrium values and force constant
456458 in into the Gromacs topology format.
@@ -469,17 +471,16 @@ def format_angle(equilibrium_values, force_constants, restraint_lambda, perturbe
469471 converted_equ_val = equilibrium_values / _degree
470472 else :
471473 converted_equ_val = (
472- self ._restraint_dict ["equilibrium_values" ][equilibrium_values ] / _degree
473- )
474+ self ._restraint_dict ["equilibrium_values" ][equilibrium_values ]
475+ / _degree
476+ )
474477
475478 if isinstance (force_constants , _GeneralUnit ):
476- converted_fc = force_constants / (
477- _kj_per_mol / (_radian * _radian )
478- )
479+ converted_fc = force_constants / (_kj_per_mol / (_radian * _radian ))
479480 else :
480- converted_fc = self ._restraint_dict ["force_constants" ][force_constants ] / (
481- _kj_per_mol / ( _radian * _radian )
482- )
481+ converted_fc = self ._restraint_dict ["force_constants" ][
482+ force_constants
483+ ] / ( _kj_per_mol / ( _radian * _radian ) )
483484
484485 par_string = (
485486 dihedral_restraints_parameters_string
@@ -503,12 +504,17 @@ def write_bond(key_list, equilibrium_values, force_constants):
503504 parameters = format_bond (equilibrium_values , force_constants ),
504505 )
505506
506- def write_angle (key_list , equilibrium_values , force_constants , func_type = 1 , perturbed = True ):
507+ def write_angle (
508+ key_list , equilibrium_values , force_constants , func_type = 1 , perturbed = True
509+ ):
507510 return master_string .format (
508511 index = format_index (key_list ),
509512 func_type = func_type ,
510513 parameters = format_angle (
511- equilibrium_values , force_constants , restraint_lambda = False , perturbed = perturbed
514+ equilibrium_values ,
515+ force_constants ,
516+ restraint_lambda = False ,
517+ perturbed = perturbed ,
512518 ),
513519 )
514520
@@ -552,19 +558,35 @@ def write_dihedral(
552558 # Bent angle: r2-r1-l1
553559 # Center is 90 degree
554560 # force constant is set by evaluating the free energy of adding a harmonic angle potential with fc at kcal/mol/rad2 at 135 degree
555- #| fc (kcal/mol/rad2) | FE (kcal/mol) |
556- #|--------------------|---------------|
557- #| control | 1.05 |
558- #| 0 | 1.05 |
559- #| 0.1 | 0.99 |
560- #| 1 | 1.17 |
561- #| 5 | 2.14 |
562- #| 10 | 3.46 |
563- #| 100 | 14.92 |
561+ # | fc (kcal/mol/rad2) | FE (kcal/mol) |
562+ # |--------------------|---------------|
563+ # | control | 1.05 |
564+ # | 0 | 1.05 |
565+ # | 0.1 | 0.99 |
566+ # | 1 | 1.17 |
567+ # | 5 | 2.14 |
568+ # | 10 | 3.46 |
569+ # | 100 | 14.92 |
564570 # Thus 1 kcal/mol/rad2 is choosen
565- output .append (write_angle (("r2" , "r1" , "l1" ), 90 * _degree , 1 * _kcal_per_mol / _radian ** 2 , func_type = 10 , perturbed = False ))
571+ output .append (
572+ write_angle (
573+ ("r2" , "r1" , "l1" ),
574+ 90 * _degree ,
575+ 1 * _kcal_per_mol / _radian ** 2 ,
576+ func_type = 10 ,
577+ perturbed = False ,
578+ )
579+ )
566580 # Bent angle: r2-r1-l1
567- output .append (write_angle (("r1" , "l1" , "l2" ), 90 * _degree , 1 * _kcal_per_mol / _radian ** 2 , func_type = 10 , perturbed = False ))
581+ output .append (
582+ write_angle (
583+ ("r1" , "l1" , "l2" ),
584+ 90 * _degree ,
585+ 1 * _kcal_per_mol / _radian ** 2 ,
586+ func_type = 10 ,
587+ perturbed = False ,
588+ )
589+ )
568590
569591 if restraint_lambda :
570592 output .append ("[ dihedral_restraints ]" )
0 commit comments