.. include:: ../../toolkit-substitutions

.. oe:namespace:: OEConfGen

.. meta::
   :keywords: OEMakeFragLib, MakeFragLib


.. _OEConfGen_OEMakeFragLib:

.. oe:class:: OEMakeFragLib

   .. oe:api::

      class OEMakeFragLib : public OEBuilderBase

   This class defines an interface for generating a fragment library.
   The builder allows building either a partial or a complete
   fragment library by controlling the content of the fragment library currently
   loaded in the builder.

   .. admonition:: Code Examples

      * :ref:`section_examples_make_fraglib` example

   The following methods are publicly inherited from :ref:`OEBuilderBase <OEConfGen_OEBuilderBase>`:
    * :oe:meth:`AddFragLib<OEConfGen::OEBuilderBase::AddFragLib>`
    * :oe:meth:`ClearFragLibs<OEConfGen::OEBuilderBase::ClearFragLibs>`

   The :ref:`OEMakeFragLib <OEConfGen_OEMakeFragLib>` class defines the following public methods:
    * :oe:meth:`AddFrag<OEConfGen::OEMakeFragLib::AddFrag>`
    * :oe:meth:`GenerateMissingFrags<OEConfGen::OEMakeFragLib::GenerateMissingFrags>`
    * :oe:meth:`GetMissingFrags<OEConfGen::OEMakeFragLib::GetMissingFrags>`


   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OEMakeFragLib(const OEFragBuilderOptions& argOpts = OEFragBuilderOptions(OEFragBuilderMode::Strict))
            OEMakeFragLib(const OEMakeFragLib&)

      .. oe:language:: python

         .. oe:api:: python

            OEMakeFragLib(argOpts: OEFragBuilderOptions = OEFragBuilderOptions(OEFragBuilderMode_Strict)) -> OEMakeFragLib
            OEMakeFragLib(arg2: OEMakeFragLib) -> OEMakeFragLib

      Default and copy constructors. The default constructor instantiates the
      class with :ref:`OEFragBuilderOptions <OEConfGen_OEFragBuilderOptions>` with the
      :oe:const:`OEConfGen::OEFragBuilderMode::Strict` mode.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OEMakeFragLib &operator=(const OEMakeFragLib&)

      Assignment operator.

   .. _OEConfGen_OEMakeFragLib_AddFrag:


   .. oe:method:: AddFrag

      .. oe:language:: c++ java csharp

         .. oe:api::

            void AddFrag(const OEChem::OEMCMolBase&)

      .. oe:language:: python

         .. oe:api:: python

            AddFrag(arg2: OEMol) -> None

      Adds the specified **fragment** to the currently loaded fragment library.

      .. seealso::

         * :oe:meth:`AddFragLib<OEConfGen::OEBuilderBase::AddFragLib>` method.

   .. _OEConfGen_OEMakeFragLib_GenerateMissingFrags:


   .. oe:method:: GenerateMissingFrags

      .. oe:language:: c++ java csharp

         .. oe:api::

            void GenerateMissingFrags(OEChem::oemolistream& ,
                                      OEChem::oemolostream&) const
            void GenerateMissingFrags(const OEChem::OEMolBase&,
                                      OEChem::oemolostream&) const

      .. oe:language:: python

         .. oe:api:: python

            GenerateMissingFrags(infile: oemolistream, outfile: oemolostream) -> None
            GenerateMissingFrags(mol: Union[OEGraphMol,OEMol,OEQMol],
                                 outfile: oemolostream) -> None

      Finds the missing fragments corresponding to the given input file stream or
      molecule, generates 3D structures of the fragments, and adds those to the output
      file stream.

   .. _OEConfGen_OEMakeFragLib_GetMissingFrags:


   .. oe:method:: GetMissingFrags

      .. oe:language:: c++ java csharp

         .. oe:api::

            OESystem::OEIterBase<OEChem::OEMCMolBase>* GetMissingFrags(OEChem::oemolistream&) const
            OESystem::OEIterBase<OEChem::OEMCMolBase>* GetMissingFrags(const OEChem::OEMolBase&) const

      .. oe:language:: python

         .. oe:api:: python

            GetMissingFrags(infile: oemolistream) -> Iterable[OEMol]
            GetMissingFrags(mol: Union[OEGraphMol,OEMol,OEQMol]) -> Iterable[OEMol]

      Finds the missing fragments corresponding to the given input file stream or
      molecule and returns a collection of the fragments.
      This method does not generate 3D structures of the fragments.
