def ispyb_object(): assert os.path.exists("xia2.json") assert os.path.exists("xia2.txt") command_line = "" for record in open("xia2.txt"): if record.startswith("Command line:"): command_line = record.replace("Command line:", "").strip() xinfo = XProject.from_json(filename="xia2.json") crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(iter(crystals.values())) ispyb_hdl = ISPyBXmlHandler(xinfo) ispyb_hdl.add_xcrystal(crystal) return ispyb_hdl.json_object(command_line=command_line)
def ispyb_object(): from xia2.Interfaces.ISPyB.ISPyBXmlHandler import ISPyBXmlHandler assert os.path.exists("xia2.json") assert os.path.exists("xia2.txt") command_line = "" for record in open("xia2.txt"): if record.startswith("Command line:"): command_line = record.replace("Command line:", "").strip() xinfo = XProject.from_json(filename="xia2.json") crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(crystals.itervalues()) ISPyBXmlHandler.add_xcrystal(crystal) return ISPyBXmlHandler.json_object(command_line=command_line)
def ispyb_xml(xml_out): from xia2.Interfaces.ISPyB.ISPyBXmlHandler import ISPyBXmlHandler import os assert os.path.exists('xia2.json') assert os.path.exists('xia2.txt') command_line = '' for record in open('xia2.txt'): if record.startswith('Command line:'): command_line = record.replace('Command line:', '').strip() from xia2.Schema.XProject import XProject xinfo = XProject.from_json(filename='xia2.json') crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(crystals.itervalues()) ISPyBXmlHandler.add_xcrystal(crystal) ISPyBXmlHandler.write_xml(xml_out, command_line)
def ispyb_xml(xml_out): assert os.path.exists("xia2.json") assert os.path.exists("xia2.txt") assert os.path.exists("xia2-working.phil") command_line = "" for record in open("xia2.txt"): if record.startswith("Command line:"): command_line = record.replace("Command line:", "").strip() with open("xia2-working.phil", "rb") as f: working_phil = iotbx.phil.parse(f.read()) xinfo = XProject.from_json(filename="xia2.json") crystals = xinfo.get_crystals() assert len(crystals) == 1 crystal = next(crystals.itervalues()) ISPyBXmlHandler.add_xcrystal(crystal) ISPyBXmlHandler.write_xml(xml_out, command_line, working_phil=working_phil)