Skip to content

Instantly share code, notes, and snippets.

@keitaroyam
Created September 27, 2016 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keitaroyam/2c67c305c567be343b5fe918f6a30750 to your computer and use it in GitHub Desktop.
Save keitaroyam/2c67c305c567be343b5fe918f6a30750 to your computer and use it in GitHub Desktop.
I just wanted to check if in ccp4 monomer library there is no cif file where dist_esd of the first atom of plane is zero
import mmtbx.monomer_library.server
from mmtbx import monomer_library
import glob
import os
mon_lib_srv = monomer_library.server.server()
cif_files = glob.glob(os.path.join(os.environ["CLIBD_MON"], "*/*.cif"))
for cf in cif_files:
try:
mon_lib_srv.process_cif(cf)
except:
print "failed to parse", cf
continue
print "parsed", cf
for k in mon_lib_srv.comp_comp_id_dict:
plane_atoms = mon_lib_srv.comp_comp_id_dict[k].plane_atom_list
if not plane_atoms: continue
tmp = {}
for pa in plane_atoms:
tmp.setdefault(pa.plane_id, []).append(pa)
for pid in tmp:
if tmp[pid][0].dist_esd < 0.01:
print "=>", k, tmp[pid][0].show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment