Skip to content

Commit

Permalink
Allow for both apbs.dx and apbs-PE0.dx as valid dx file names (#24)
Browse files Browse the repository at this point in the history
* Allow for both apbs.dx and apbs-PE0.dx as valid dx file names

* Remove unnecessary import
  • Loading branch information
vhoer authored Feb 13, 2024
1 parent 4f681c1 commit 2f1bf4a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion surface_analyses/commandline_electrostatic.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,12 @@ def get_apbs_potential_from_mdtraj(traj, apbs_dir, pH, ion_species):
print("apbs stderr:")
print(apbs.stderr)
raise RuntimeError("apbs failed")
dxfile = str(run_dir / "apbs.pqr-PE0.dx")
if (run_dir / "apbs.pqr-PE0.dx").is_file():
dxfile = str(run_dir / "apbs.pqr-PE0.dx")
elif (run_dir / "apbs.pqr.dx").is_file():
dxfile = str(run_dir / "apbs.pqr.dx")
else:
raise ValueError("Neither apbs.pqr-PE0.dx nor apbs.pqr.dx were found in the apbs directory.")
griddata = load_dx(dxfile, colname='DX')
griddata.struct = traj[0]
return griddata
Expand Down

0 comments on commit 2f1bf4a

Please sign in to comment.