Closed rimmartin closed 1 year ago
There is undocumented function add_chemcomp_to_block()
for ChemComp->cif.
I found a fragment of code that writes ChemComp to a file:
cif::Block new_block("out");
gemmi::add_chemcomp_to_block(cc, new_block);
gemmi::Ofstream os("ags.cif");
cif::write_cif_block_to_stream(os.ref(), new_block, cif::Style::Simple);
The same is possible in Python. The resulting cif file is more like Refmac dictionary than CCD.
As for populating ChemComp, it's possible from C++, but Python bindings are likely missing some of the functions. If you write more about what you want to do, we might be able to help you more.
Hi @wojdyr , that is promising:-) I'm at https://www.quantumbioinc.com/ where I write c++ code for better refinement and re-refinement of crystal structures. At the end of calculations we(or people using our software) want to output standards that can be used in the place of previous standards from refmac/ccd or donate them back to https://www.wwpdb.org/data/ccd Likely other people could use gemmi for similar or from raw crystal refinement.
I see https://project-gemmi.github.io/cxx-api/structgemmi_1_1Topo.html sets up restraints from reading standards from comp cif's. There would need to be algorithms implemented in gemmi for determining all the restraints from xyz structures/models? Or should apps do this on their own and populate ChemComp for io?
Normally, restraints are read from a monomer library such as the ones in CCP4 and in Phenix.
Gemmi has a function for making ad-hoc restraints based on the current geometry of a residue:
ChemComp cc = make_chemcomp_with_restraints(res);
but it's only to be used when the proper restraints are not available (because the user doesn't care enough to generate them). These ad-hoc restraints only stabilize the existing molecule's geometry. Does it answer your question?
Yes, I'll implement calling it that far and see if the people like the restraints it generates and the cif. Thank you
Is it possible to populate a ChemComp or other structure in memory and then write to Chemical Component Dictionary cif?
Produce such standards as refmac monlib or Chemical Component Dictionary entries?