diff --git a/examples/evaluation.py b/examples/evaluation.py index 9a3df43..ef888f6 100755 --- a/examples/evaluation.py +++ b/examples/evaluation.py @@ -1,4 +1,4 @@ -from pathlib import Path +import os import math from Bio.PDB import PDBIO @@ -38,7 +38,7 @@ def build_linear_model(pdb_filename): parser = PDBParser() - structure = parser.get_structure("sample", Path(PDBdir, pdb_filename)) + structure = parser.get_structure("sample", os.path.join(PDBdir, pdb_filename)) model = structure[0] chain = model["A"] model_structure_geo = [] @@ -58,13 +58,13 @@ def build_linear_model(pdb_filename): def make_pdb_file(struct, file_nom): outfile = PDBIO() outfile.set_structure(struct) - outfile.save(Path(PDBdir, file_nom)) + outfile.save(os.path.join(PDBdir, file_nom)) return file_nom def build_backbone_model(pdb_filename): parser = PDBParser() - structure = parser.get_structure("sample", Path(PDBdir, pdb_filename)) + structure = parser.get_structure("sample", os.path.join(PDBdir, pdb_filename)) model = structure[0] chain = model["A"] model_structure_geo = [] @@ -134,7 +134,7 @@ def build_backbone_model(pdb_filename): def build_all_angles_model(pdb_filename): parser = PDBParser() - structure = parser.get_structure("sample", Path(PDBdir, pdb_filename)) + structure = parser.get_structure("sample", os.path.join(PDBdir, pdb_filename)) model = structure[0] chain = model["A"] model_structure_geo = [] @@ -192,7 +192,7 @@ def build_all_angles_model(pdb_filename): def build_phi_psi_model(pdb_filename): parser = PDBParser() - structure = parser.get_structure("sample", Path(PDBdir, pdb_filename)) + structure = parser.get_structure("sample", os.path.join(PDBdir, pdb_filename)) model = structure[0] chain = model["A"] seq = "" @@ -244,8 +244,8 @@ def build_phi_psi_model(pdb_filename): def compare_structure(reference, alternate): parser = PDBParser() - ref_struct = parser.get_structure("Reference", Path(PDBdir, reference)) - alt_struct = parser.get_structure("Alternate", Path(PDBdir, alternate)) + ref_struct = parser.get_structure("Reference", os.path.join(PDBdir, reference)) + alt_struct = parser.get_structure("Alternate", os.path.join(PDBdir, alternate)) ref_model = ref_struct[0] ref_chain = ref_model["A"]