Skip to content

Commit

Permalink
fix path to file
Browse files Browse the repository at this point in the history
  • Loading branch information
rzhu committed Nov 29, 2024
1 parent cc8017e commit 192d3bf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/molearn/analysis/analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,14 +710,14 @@ def _relax(self, pdb_file: Union[str, Path], out_path: Union[str, Path], maxIter
:param str out_path: path where the modelled/relaxed structures are be saved
"""

if not isinstance(pdb_file, Path):
pdb_file = Path(pdb_file)
if not isinstance(out_path, Path):
out_path = Path(out_path)
if not isinstance(pdb_file, str):
pdb_file = str(pdb_file)
if not isinstance(out_path, str):
out_path = str(out_path)

# Assume sidechain modelling is required if the number of selected atoms is less than 6
# Assume sidechain modelling is required if the number of selected atoms is fewer than 6
if len(self.atoms) < 6:
modelled_file = out_path/(pdb_file.stem + "_modelled.pdb")
modelled_file = out_path + os.sep + (pdb_file.stem + "_modelled.pdb")
try:
env = Environ()
env.libs.topology.read(file='$(LIB)/top_heav.lib')
Expand All @@ -729,7 +729,7 @@ def _relax(self, pdb_file: Union[str, Path], out_path: Union[str, Path], maxIter
except Exception as e:
print(f'Failed to model {pdb_file}\n{e}')
try:
relaxed_file = out_path/(pdb_file.stem + "_relaxed.pdb")
relaxed_file = out_path + os.sep + (pdb_file.stem + "_relaxed.pdb")
# Read pdb
pdb = PDBFile(pdb_file)
# Add hydrogens
Expand Down

0 comments on commit 192d3bf

Please sign in to comment.