Skip to content

Commit

Permalink
Merge pull request #179 from shreesowndarya/shree_changes
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
jvalegre authored Oct 25, 2023
2 parents fc59088 + b158c24 commit 1c47f34
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 8 additions & 2 deletions aqme/qprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
)
from aqme.csearch.crest import xyzall_2_xyz
from pathlib import Path
from rdkit import Chem


class qprep:
Expand Down Expand Up @@ -186,6 +187,7 @@ def __init__(self, create_dat=True, **kwargs):
sdf_files.append(f"{file.split('.pdb')[0]}.sdf")

else:

sdf_files.append(file)

for sdf_file in sdf_files:
Expand Down Expand Up @@ -445,11 +447,15 @@ def qprep_coords(self, file, mol, file_format):
try:
charge = int(mol.GetProp("Real charge"))
except KeyError:
pass
charge = Chem.GetFormalCharge(mol)
try:
mult = int(mol.GetProp("Mult"))
except KeyError:
pass
NumRadicalElectrons = 0
for Atom in mol.GetAtoms():
NumRadicalElectrons += Atom.GetNumRadicalElectrons()
TotalElectronicSpin = NumRadicalElectrons / 2
mult = int((2 * TotalElectronicSpin) + 1)

elif file_format in ["log", "out"]:
# detect QM program and number of atoms
Expand Down
10 changes: 8 additions & 2 deletions tests/test_qprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,15 @@ def test_QPREP_analysis(test_type, init_folder, target_folder, restore_folder):

assert outlines[8].strip() == line_8
assert outlines[10].strip() == line_10

assert outlines[2].strip() == line_2
assert outlines[6].strip() == line_6
if init_folder == "pdb_files":
line_6 = "-2 1"
assert outlines[6].strip() == line_6
else:
assert outlines[6].strip() == line_6



elif test_type == "charge_mult":
if init_folder == "json_files":
Expand Down

0 comments on commit 1c47f34

Please sign in to comment.