.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEDeleteEverythingExceptTheFirstLargestComponent, DeleteEverythingExceptTheFirstLargestComponent

.. oe:function:: OEDeleteEverythingExceptTheFirstLargestComponent

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

      .. oe:api::

         bool OEDeleteEverythingExceptTheFirstLargestComponent(OEMolBase & mol)

   .. oe:language:: python

      .. oe:api:: python

         OEDeleteEverythingExceptTheFirstLargestComponent(arg1: Union[OEGraphMol,OEMol,OEQMol]) -> bool

   Deletes all atoms that are not part of the largest connected component
   of a molecule. If two or more components of a molecule are the size
   of the largest component, this function keeps the first one
   encountered.
   Only heavy atoms are taken into consideration when determining the size
   of the components.
   The :oe:func:`OEChem::OEDeleteEverythingExceptTheFirstLargestComponent` function returns
   ``false`` if the given molecule has only one connected component,
   otherwise it returns ``true``.

.. note::

   The :oe:func:`OEChem::OEDeleteEverythingExceptTheFirstLargestComponent` function is
   identical to :oe:func:`OEChem::OETheFunctionFormerlyKnownAsStripSalts`.

.. seealso::

  .. oe:language:: c++

      * Example program :ref:`stripsalts.cpp<section_example_oechem_stripsalts>`

  .. oe:language:: python

      * Example program :ref:`stripsalts.py<section_example_oechem_stripsalts>`

  .. oe:language:: java

      * Example program :ref:`StripSalts.java<section_example_oechem_stripsalts>`

  .. oe:language:: csharp

      * Example program :ref:`StripSalts.cs<section_example_oechem_stripsalts>`
