
Oh, does phenixbb really strip off attachments under 1 KB in size?! Terrible. Anyway, I’m inlining it below (make sure your email client doesn’t mess up the indentation): ******** from iotbx import reflection_file_reader import iotbx.pdb def run(): # Read your reflection data miller_arrays = reflection_file_reader.any_reflection_file(file_name = "1yjp.mtz").as_miller_arrays() for ma in miller_arrays: print (ma.info().label_string()) if(ma.info().label_string()=="FOBS,SIGFOBS"): f_obs = ma # Get phases by computing Fcalc (for example) pdb_inp = iotbx.pdb.input(file_name = "1yjp.pdb") xrs = pdb_inp.xray_structure_simple() f_calc = f_obs.structure_factors_from_scatterers(xray_structure=xrs).f_calc() # Transfer phased from f_calc to f_obs f_obs_cmpl = f_obs.phase_transfer(phase_source = f_calc.phases()) print(f_obs_cmpl.data()) # just to see the data are now complex array! # Write into MTZ mtz_dataset = f_calc.as_mtz_dataset(column_root_label = "Fcmpl") mtz_object = mtz_dataset.mtz_object() mtz_object.write(file_name = "data.mtz") if __name__ == '__main__': run() ******** Pavel On 9/12/25 12:04, Petrus Zwart wrote:
Hi Pavel,
You say 25 lines, but there are zero - can you attach the code?
P
On Fri, Sep 12, 2025 at 11:57 AM Pavel Afonine
wrote: Hi James,
attached script shows how to do that in cctbx. ( And it is just 25 lines including comments compared Claud's 173 )
It uses 1yjp as a source of sample files to run the example, you can get it using
phenix.fetch_pdb 1yjp action=all convert_to_mtz=true
Pavel
On 9/12/25 11:28, James Holton wrote: > Greetings Phenix developers! > > I have what I hope is a quick question. I'm trying to add a stack of > phased structure factors together. Specifically from separate runs of > phenix.fmodel. Normally, I'd use sftools for this, but the > distributed version has a size limitation. According to Tom's phenix > chatbot, I can use phenix.maps for adding two sets of structure > factors together, but it seems to only want to combine an mtz with a > pdb. There is iotbx.reflection_file_editor, but it only works from the > GUI (and I want to add 1000 mtz files together). phenix.xmanip looks > promising too, but again, seems to want a pdb and an mtz. Is there a > recommended way to do this? > > I've already asked this on CCP4BB, but I wanted to get the Phenix take > on these kinds of manipulations. > > Thank you, > > -James Holton > MAD Scientist > _______________________________________________ phenixbb mailing list -- [email protected] To unsubscribe send an email to [email protected] Unsubscribe: phenixbb-leave@%(host_name)s
-- ------------------------------------------------------------------------------------------ Peter Zwart Staff Scientist, Molecular Biophysics and Integrated Bioimaging Berkeley Synchrotron Infrared Structural Biology Biosciences Lead, Center for Advanced Mathematics for Energy Research Applications Lawrence Berkeley National Laboratories 1 Cyclotron Road, Berkeley, CA-94703, USA Cell: 510 289 9246 ------------------------------------------------------------------------------------------