openmm / pdbfixer

PDBFixer fixes problems in PDB files
Other
461 stars 115 forks source link

MMCIF _atom_site.pdbx_PDB_ins_code problem #193

Closed MauriceKarrenbrock closed 4 years ago

MauriceKarrenbrock commented 4 years ago

Hello, when I repair the 4x8u MMCIF from the pdb database and rewrite a MMCIF it happens that the ASP with _atom_site.auth_seq_id = 60 loses all the _atom_site.pdbx_PDB_ins_code values but keeps all the alternative configurations for the atoms, in this way I get an unusable file with a nonsense residue. What could be done to fix it? (I am not interested in keeping the alternative locations for the atoms, so if it is needed to eliminate them no problem)

pdbfixer 1.6 openmm 7.4.0

import pdbfixer
import simtk.openmm.app

with open("4x8u.cif", 'r') as f:
    fixer = pdbfixer.PDBFixer(pdbxfile = f)
    fixer.findMissingResidues()
    fixer.findNonstandardResidues()
    fixer.replaceNonstandardResidues()
    fixer.findMissingAtoms()
    fixer.addMissingAtoms()

with open("4x8u_repaired.cif", 'w') as f:
    simtk.openmm.app.pdbxfile.PDBxFile.writeFile(fixer.topology, fixer.positions, f, keepIds= True)

Thank you very much

peastman commented 4 years ago

I see what you mean. Let me see if I can track down what's causing the problem.

peastman commented 4 years ago

The fix is in https://github.com/openmm/openmm/pull/2508.

You'll also need to use the latest PDBFixer code from this repository. A related fix was checked in recently in #191.

MauriceKarrenbrock commented 4 years ago

Thank you very much, and have a happy new year!