From 590b262434274179dc34ef385a8ffda6337df8f1 Mon Sep 17 00:00:00 2001 From: jingjieyeo Date: Thu, 30 May 2019 16:17:49 +0800 Subject: [PATCH 1/2] Added ability to calculate non-neutral charges --- pysimm/amber.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pysimm/amber.py b/pysimm/amber.py index 7b5f77a..e4a206c 100644 --- a/pysimm/amber.py +++ b/pysimm/amber.py @@ -63,10 +63,10 @@ def cleanup_antechamber(): print('problem removing {} during cleanup'.format(fname)) -def calc_charges(s, charge_method='bcc', cleanup=True): +def calc_charges(s, charge_method='bcc', net_charge='0', cleanup=True): """pysimm.amber.calc_charges - Calculates charges using antechamber. Defaults to am1-bcc charges. + Calculates charges using antechamber. Defaults to am1-bcc charges and neutral charge. Args: s: System for which to calculate charges. System object is updated in place @@ -77,7 +77,7 @@ def calc_charges(s, charge_method='bcc', cleanup=True): None """ s.write_pdb('pysimm.tmp.pdb') - cl = '{} -fi pdb -i pysimm.tmp.pdb -fo ac -o pysimm.tmp.ac -c {}'.format(ANTECHAMBER_EXEC, charge_method) + cl = '{} -fi pdb -i pysimm.tmp.pdb -fo ac -o pysimm.tmp.ac -c {} -nc {}'.format(ANTECHAMBER_EXEC, charge_method, net_charge) p = Popen(cl.split(), stdin=PIPE, stdout=PIPE, stderr=PIPE) p.communicate() with file('pysimm.tmp.ac') as f: From 0b8d596cdc67e1b86d86b25acad75dbda75426be Mon Sep 17 00:00:00 2001 From: jingjieyeo Date: Tue, 16 Jul 2019 16:36:47 +0800 Subject: [PATCH 2/2] Update dreiding.py for polar hydrogen Updated hydrogen parameterization conditions to locate polar hydrogens that are bonded to either N or O. This allows for using the "hbond/dreiding/lj" option in LAMMPS to implement hydrogen bonding for the DREIDING forcefield. --- pysimm/forcefield/dreiding.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pysimm/forcefield/dreiding.py b/pysimm/forcefield/dreiding.py index 3c53de9..eb302f1 100644 --- a/pysimm/forcefield/dreiding.py +++ b/pysimm/forcefield/dreiding.py @@ -86,7 +86,11 @@ def assign_ptypes(self, s): p.nbonds += 1 for p in s.particles: if p.elem == 'H': - p.type_name = 'H_' + for pb in p.bonded_to: + if pb.elem == 'O' or pb.elem == 'N': + p.type_name = 'H___A' + if not p.type_name: + p.type_name = 'H_' elif p.elem == 'C': if p.bond_orders and (4 in p.bond_orders or 'A' in p.bond_orders): p.type_name = 'C_R' @@ -357,4 +361,4 @@ def assign_charges(self, s, charges='gasteiger'): """ if charges == 'gasteiger': print('adding gasteiger charges') - gasteiger.set_charges(s) \ No newline at end of file + gasteiger.set_charges(s)