Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues #240 and #246 #247

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def getCorrection(
volume = _Volume(_math.pi * result, "nanometers cubed")

# Estimate the average area of the restraint (in Angstrom squared).
area = (volume / proj_max).angstroms2()
area = (volume / (proj_max - proj_min)).angstroms2()

# Compute the correction. (1/1660 A-3 is the standard concentration.)
correction = _Energy(_math.log((area / 1660).value()), "kt")
Expand Down
8 changes: 4 additions & 4 deletions python/BioSimSpace/Parameters/_Protocol/_openforcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def run(self, molecule, work_dir=None, queue=None):

# Export AMBER format files.
try:
interchange.to_prmtop(prefix + "interchange.prmtop")
interchange.to_inpcrd(prefix + "interchange.inpcrd")
interchange.to_prmtop(prefix + "interchange.prm7")
interchange.to_inpcrd(prefix + "interchange.rst7")
except Exception as e:
msg = "Unable to write Interchange object to AMBER format!"
if _isVerbose():
Expand All @@ -342,13 +342,13 @@ def run(self, molecule, work_dir=None, queue=None):
# Load the parameterised molecule. (This could be a system of molecules.)
try:
par_mol = _IO.readMolecules(
[prefix + "interchange.prmtop", prefix + "interchange.inpcrd"]
[prefix + "interchange.prm7", prefix + "interchange.rst7"]
)
# Extract single molecules.
if par_mol.nMolecules() == 1:
par_mol = par_mol.getMolecules()[0]
except Exception as e:
msg = "Failed to read molecule from: 'interchange.prmtop', 'interchange.inpcrd'"
msg = "Failed to read molecule from: 'interchange.prm7', 'interchange.rst7'"
if _isVerbose():
msg += ": " + getattr(e, "message", repr(e))
raise IOError(msg) from e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def getCorrection(
volume = _Volume(_math.pi * result, "nanometers cubed")

# Estimate the average area of the restraint (in Angstrom squared).
area = (volume / proj_max).angstroms2()
area = (volume / (proj_max - proj_min)).angstroms2()

# Compute the correction. (1/1660 A-3 is the standard concentration.)
correction = _Energy(_math.log((area / 1660).value()), "kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ def run(self, molecule, work_dir=None, queue=None):

# Export AMBER format files.
try:
interchange.to_prmtop(prefix + "interchange.prmtop")
interchange.to_inpcrd(prefix + "interchange.inpcrd")
interchange.to_prmtop(prefix + "interchange.prm7")
interchange.to_inpcrd(prefix + "interchange.rst7")
except Exception as e:
msg = "Unable to write Interchange object to AMBER format!"
if _isVerbose():
Expand All @@ -342,13 +342,13 @@ def run(self, molecule, work_dir=None, queue=None):
# Load the parameterised molecule. (This could be a system of molecules.)
try:
par_mol = _IO.readMolecules(
[prefix + "interchange.prmtop", prefix + "interchange.inpcrd"]
[prefix + "interchange.prm7", prefix + "interchange.rst7"]
)
# Extract single molecules.
if par_mol.nMolecules() == 1:
par_mol = par_mol.getMolecules()[0]
except Exception as e:
msg = "Failed to read molecule from: 'interchange.prmtop', 'interchange.inpcrd'"
msg = "Failed to read molecule from: 'interchange.prm7', 'interchange.rst7'"
if _isVerbose():
msg += ": " + getattr(e, "message", repr(e))
raise IOError(msg) from e
Expand Down
Loading