Closed rimmartin closed 1 year ago
First, we'd have to store the coordinates somewhere. Currently, they are not in ChemComp::Atom. How do you store them in your program?
There is also a question of how to name these columns.
_chem_comp_atom.x
is used in, for example, Refmac monomer library. In CCD and in PDBx/mmCIF spec x coordinates are named: _chem_comp_atom.model_Cartn_x
and _chem_comp_atom.pdbx_model_Cartn_x_ideal
.
I build a gemmi::Structure
from our internal backbone and use
std::unique_ptr<gemmi::ChemComp>&& cc = gemmi::make_chemcomp_with_restraints((*it_residues));
to begin populating a gemmi::ChemComp
for the atoms, bonds and angles. *it_residues
is a gemmi::Residue
. Then use internal properties to fill torsion, planar and chiral data structures into the same ChemComp. And they write out to stream
gemmi::cif::Block new_block((*it_residues).name);
gemmi::add_chemcomp_to_block(*cc.get(), new_block);
gemmi::cif::write_cif_block_to_stream(buf, new_block, gemmi::cif::Style::Simple);
Would it fit other people's needs and gemmi design if the make_chemcomp_with_restraints
moved a copy of the residue's coordinates to new properties for them in ChemComp::Atom
?
I tested _chem_comp_atom.x
, _chem_comp_atom.model_Cartn_x
and _chem_comp_atom.pdbx_model_Cartn_x_ideal
labels in cifs which are successfully read by pymol and moe
It makes sense. I'll add copying coordinates in make_chemcomp_with_restraints
and add_chemcomp_to_block
.
This or next week.
Oh that will be fine! I got plenty of other things to do so a few weeks is good timing. Thank you
I added it. The coordinates can now be written as .x/y/z. If anyone would prefer to write it as model_Cartn_x/y/z in the future, I can add an option for it.
Hi,
In the _chem_comp_atom loop the add_chemcomp_to_block(add_chemcomp_to_block) the addition of x, y, z columns would be appreciated by my users to help them visualize the component. PyMol would open such a chem comp cif.
Example: