diff --git a/modules/io/doc/mmcif.rst b/modules/io/doc/mmcif.rst index 97d411507da50ea4c87d0e148186f23ddb154f90..fefd64b7bc2117150dbb414af7d3a91ceec7eccd 100644 --- a/modules/io/doc/mmcif.rst +++ b/modules/io/doc/mmcif.rst @@ -1974,9 +1974,19 @@ To see it all in action: :type ent: :class:`ost.mol.EntityHandle`/:class:`ost.mol.EntityView` :param mmcif_conform: Determines data extraction strategy as described above :type mmcif_conform: :class:`bool` - :param entity_info: Predefine mmCIF entities - guarantees complete SEQRES - info. Starts from empty list if not given. + :param entity_info: Predefine mmCIF entities - useful to define complete + SEQRES. If given, the provided list serves as a + starting point, i.e. chains in *ent* are matched to + entities in *entity_info*. In case of no match, this + list gets extended. Starts from empty list if not given. :type entity_info: :class:`list` of :class:`MMCifWriterEntity` + + .. method:: GetEntities() + + Returns :class:`list` of :class:`MMCifWriterEntity`. Useful to check after + :func:`SetStructure` has been called. Order in this list defines entity + ids in written mmCIF file with zero based indexing. + Biounits -------------------------------------------------------------------------------- diff --git a/modules/io/pymod/export_mmcif_io.cc b/modules/io/pymod/export_mmcif_io.cc index 200e4255696c3bb5c3084e94a3460d3651deaa15..f08315a4978499bfef95d2fe014a2c9e4fe74b49 100644 --- a/modules/io/pymod/export_mmcif_io.cc +++ b/modules/io/pymod/export_mmcif_io.cc @@ -170,6 +170,7 @@ void export_mmcif_io() arg("entity_info")=std::vector<MMCifWriterEntity>())) .def("SetStructure", &WrapSetStructureView, (arg("ent"), arg("mmcif_conform")=true, arg("entity_info")=std::vector<MMCifWriterEntity>())) + .def("GetEntities", &MMCifWriter::GetEntities, return_value_policy<copy_const_reference>()) ; enum_<MMCifInfoCitation::MMCifInfoCType>("MMCifInfoCType") diff --git a/modules/io/src/mol/mmcif_writer.hh b/modules/io/src/mol/mmcif_writer.hh index 85b3f9a2a6caec5cb2167006cdab723e922dc668..730549814d3fee8520dd4f281c540fb2d525659e 100644 --- a/modules/io/src/mol/mmcif_writer.hh +++ b/modules/io/src/mol/mmcif_writer.hh @@ -109,6 +109,8 @@ public: void SetStructure(const ost::mol::EntityView& ent, bool mmcif_conform=true, const std::vector<MMCifWriterEntity>& entity_info=std::vector<MMCifWriterEntity>()); + + const std::vector<MMCifWriterEntity>& GetEntities() const { return entity_info_; } private: