Skip to content

Commit

Permalink
Replace Pathlib with os to fix write issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshpatra committed Nov 29, 2020
1 parent 6d38a16 commit c3bee3e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pathlib import Path
import os
import math

from Bio.PDB import PDBIO
Expand Down Expand Up @@ -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 = []
Expand All @@ -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 = []
Expand Down Expand Up @@ -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 = []
Expand Down Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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"]
Expand Down

0 comments on commit c3bee3e

Please sign in to comment.