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

Replace Pathlib with os to fix write issues #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nileshpatra
Copy link

Currently, the evaluation.py file fails with:

$ python3 evaluation.py 
1aq7
/usr/lib/python3/dist-packages/Bio/PDB/PDBParser.py:395: PDBConstructionWarning: Ignoring unrecognized record 'TER' at line 1630
  warnings.warn(
/usr/lib/python3/dist-packages/Bio/PDB/PDBParser.py:395: PDBConstructionWarning: Ignoring unrecognized record 'TER' at line 1630
  warnings.warn(
/usr/lib/python3/dist-packages/Bio/PDB/PDBParser.py:395: PDBConstructionWarning: Ignoring unrecognized record 'TER' at line 1630
  warnings.warn(
Traceback (most recent call last):
  File "/home/nilesh/ups/PeptideBuilder/examples/evaluation.py", line 365, in <module>
    f_out.write(test_PeptideBuilder(i))
  File "/home/nilesh/ups/PeptideBuilder/examples/evaluation.py", line 313, in test_PeptideBuilder
    pdb_file, make_pdb_file(structure_backbone, "Backbone_" + pdb_file)
  File "/home/nilesh/ups/PeptideBuilder/examples/evaluation.py", line 61, in make_pdb_file
    outfile.save(Path(PDBdir, file_nom))
  File "/usr/lib/python3/dist-packages/Bio/PDB/PDBIO.py", line 380, in save
    fp.write(s)
AttributeError: 'PosixPath' object has no attribute 'write'

Biopython version: 1.78

This is an attempt to fix the problem, avoiding the use of POSIX path.

@nileshpatra
Copy link
Author

Rest reformatting changes are done to make CI happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant