diff --git a/modules/io/doc/mmcif.rst b/modules/io/doc/mmcif.rst index 43618968faf54ce990d4e16b882c1501f510297e..1cd557a5f30bf4d441c43d22e3e23565bdd0ed14 100644 --- a/modules/io/doc/mmcif.rst +++ b/modules/io/doc/mmcif.rst @@ -1788,6 +1788,7 @@ a mmCIF file according to `mmcif_pdbx_v50 <https://mmcif.wwpdb.org/dictionaries/ * id * type + * name * `_atom_type <https://mmcif.wwpdb.org/dictionaries/mmcif_pdbx_v50.dic/Categories/atom_type.html>`_ diff --git a/modules/io/src/mol/mmcif_writer.cc b/modules/io/src/mol/mmcif_writer.cc index 77de1177ac69bc1414c7e2fdc8318bafdd03c27a..6ea364aa868975fbb5cee1a8956809de576726d6 100644 --- a/modules/io/src/mol/mmcif_writer.cc +++ b/modules/io/src/mol/mmcif_writer.cc @@ -696,6 +696,7 @@ namespace { ost::io::StarWriterLoopDesc desc("_chem_comp"); desc.Add("id"); desc.Add("type"); + desc.Add("name"); ost::io::StarWriterLoopPtr sl(new ost::io::StarWriterLoop(desc)); return sl; } @@ -978,7 +979,7 @@ namespace { unique_compounds.insert(het_it.second.begin(), het_it.second.end()); } } - std::vector<ost::io::StarWriterValue> comp_data(2); + std::vector<ost::io::StarWriterValue> comp_data(3); for(auto mon_id: unique_compounds) { comp_data[0] = ost::io::StarWriterValue::FromString(mon_id); ost::conop::CompoundPtr comp = compound_lib->FindCompound(mon_id, @@ -986,9 +987,11 @@ namespace { if(comp) { String type = ChemClassToChemCompType(comp->GetChemClass()); comp_data[1] = ost::io::StarWriterValue::FromString(type); + comp_data[2] = ost::io::StarWriterValue::FromString(comp->GetName()); } else { String type = ChemClassToChemCompType(ost::mol::ChemClass::UNKNOWN); comp_data[1] = ost::io::StarWriterValue::FromString(type); + comp_data[2] = ost::io::StarWriterValue::FromString(""); } chem_comp_ptr->AddData(comp_data); }