openmm / pdbfixer

PDBFixer fixes problems in PDB files
Other
453 stars 114 forks source link

Problem with mmcif format #202

Closed georopon closed 3 years ago

georopon commented 4 years ago

i'have an error: OSError: [Errno 36] File name too long when run fixer for code: 5xy3 ribosome. help me.

peastman commented 4 years ago

What filename are you getting that error for?

If you're on Windows, you also have to be careful of the location you save files to. There's a limit on the maximum length of the full path to the file, so if you have folders with long names, or just a lot of nested folders, you can get errors trying to save files inside them.

dww100 commented 3 years ago

I get this error to - the issue appears to be that in pdbfixer.py you have:

    243             file = open(filename, 'r')
    244             if _guessFileFormat(file, filename) == 'pdbx':
--> 245                 self._initializeFromPDBx(file.read())
    246             else:
    247                 self._initializeFromPDB(file)

Then the type check in the openmm PDBx reader sees a string and tries to open as a file. I'll make a pull request with the obvious fix.