
.. oe:namespace:: OEMedChem

.. oe:function:: OEMoleculeToCores

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

      .. oe:api::

         OESystem::OEIterBase<const std::string>* OEMoleculeToCores(const OEChem::OEMolBase& mol,
                                                                    const OEMCSFragDatabaseOptions& opts,
                                                                    bool permuteFragments = true)

   .. oe:language:: python

      .. oe:api:: python

         OEMoleculeToCores(mol: Union[OEGraphMol,OEMol,OEQMol],
                           fragopts: OEMCSFragDatabaseOptions,
                           permuteFragments: bool = True) -> Iterable[str ]

   Given a molecule, return the fragmentation cores using the provided fragmentation options. If the
   ``permuteFragments`` argument is ``true``, all combinations of the generated fragmentation
   cores are generated, otherwise a unique set of multi-fragment cores is returned representing
   all combinations of bond fragmentations between the min and max cut limits.

   Shown below is a version that uses the free function and custom options setup from command line arguments:

   .. oe:source:: MoleculeToCoreExample.cpp
      :language: c++
      :frag:     SNIPPET-MOLECULETOCORE-OPTS-EXAMPLE

   .. oe:source:: MoleculeToCoreExample.py
      :language: python
      :frag:     SNIPPET-MOLECULETOCORE-OPTS-EXAMPLE

   .. oe:source:: MoleculeToCoreExample.java
      :language: java
      :frag:     SNIPPET-MOLECULETOCORE-OPTS-EXAMPLE

   .. oe:source:: MoleculeToCoreExample.cs
      :language: csharp
      :frag:     SNIPPET-MOLECULETOCORE-OPTS-EXAMPLE

   .. seealso::

      * :ref:`OEMCSFragDatabase <OEMedChem_OEMCSFragDatabase>` class
      * :ref:`OEMCSFragDatabaseOptions <OEMedChem_OEMCSFragDatabaseOptions>` class
