.. meta::
   :keywords: OESliceEnsemble

.. oe:namespace:: OEConfGen

.. _OEConfGen_OESliceEnsemble:

.. oe:function:: OESliceEnsemble

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

      .. oe:api::

         bool OESliceEnsemble(OEChem::OEMCMolBase& mol,
                              double rms = OESliceEnsembleDefaults::RMS,
                              double ewindow = OESliceEnsembleDefaults::EWindow,
                              unsigned maxconfs = OESliceEnsembleDefaults::MaxConfs)
         bool OESliceEnsemble(OEChem::OEMCMolBase& mol,
                              const OESliceEnsembleOptions& options)

   .. oe:language:: python

      .. oe:api:: python

         OESliceEnsemble(argMol: OEMol, argRms: float, argEWindow: float,
                         argMaxConfs: int) -> bool
         OESliceEnsemble(argMol: OEMol, argSlicerOpts: OESliceEnsembleOptions) -> bool

   Reduces the number of conformers in the input ``mol`` using the
   **OMEGA** deduplication algorithm. This allows for
   :ref:`OEOmega <OEConfGen_OEOmega>` to generate a very large ensemble with
   much looser deduplication parameters and then to "slice" that
   ensemble of conformations by various different parameters after the
   fact. 

   The default values for the first overload of the function are picked from the
   :oe:constns:`OEConfGen::OESliceEnsembleDefaults` namespace. 

   Conformer slicing proceeds in the following order: 

   #. Slice by energy window. Decreasing this value will result in
      fewer conformers. For slicing by energy, the algorithm assumes
      that the energy for each conformer has been precalculated and
      set as the energy property of the conformer using the
      :oe:meth:`OEChem::OEMolBase::SetEnergy` method.  Conformer
      generation using :ref:`OEOmega <OEConfGen_OEOmega>`, sets this property
      by default.
   #. Slice by RMS. Increasing this value will result in fewer
      conformers.
   #. Slice by maximum number of conformers. Decreasing this value
      will result in fewer conformers.

   .. note:: 

      If the same energy window and RMS values are being chosen as the
      defaults being used in the previous :ref:`OEOmega <OEConfGen_OEOmega>`
      calculation, it will be faster to delete conformers
      directly with :oe:meth:`OEChem::OEMCMolBase::DeleteConf`. This
      function is really intended to be run whenever the RMS has
      changed, or when the conformer geometries themselves have changed.
