Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View keitaroyam's full-sized avatar

keitaroyam

  • MRC-LMB / UTokyo / RIKEN SPring-8
View GitHub Profile
@keitaroyam
keitaroyam / solvent_fraction.py
Created September 9, 2018 13:14
calculate solvent fraction from pdb (cctbx)
import iotbx.pdb
import mmtbx.utils
from mmtbx.scaling.matthews import p_vm_calculator
def run(pdbin):
pdb_inp = iotbx.pdb.input(pdbin)
xray_structure = pdb_inp.xray_structure_simple()
print "Read from %s" % pdb_in
xray_structure.show_summary(prefix=" ")
print
@keitaroyam
keitaroyam / put_reversephi_info.py
Created June 10, 2016 11:56
Add reverse-phi information to master h5 file of Eiger
# This code will be unnecessary when new Eiger firmware offically writes this information
import h5py
def run(h5in):
h5 = h5py.File(h5in, "a")
if "/entry/sample/depends_on" not in h5:
h5["/entry/sample/depends_on"] = "/entry/sample/transformations/omega"
@keitaroyam
keitaroyam / check_plane_esd_first_atom_ccp4.py
Created September 27, 2016 10:00
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: