.. oe:namespace:: OEBio

.. meta::
   :keywords: OEAltLocationFactory, AltLocationFactory


.. _OEBio_OEAltLocationFactory:

.. oe:class:: OEAltLocationFactory

   .. oe:api::

      class OEAltLocationFactory

   This class represents `OEAltLocationFactory`, a class to perceive and manage alternate locations
   in a molecule and generate new subset molecules for specific sets of :ref:`OEAltLocation <OEBio_OEAltLocation>` selections.

   .. oe:method:: Constructors

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

         .. oe:api::

            OEAltLocationFactory(const OEAltLocationFactory& fact)
            OEAltLocationFactory(const OEChem::OEMolBase& src,
                                 unsigned int options = OEBio::OEAltLocFactOption::None)

      .. oe:language:: python

         .. oe:api:: python

            OEAltLocationFactory(impl: OEAltLocationFactoryImpl) -> OEAltLocationFactory
            OEAltLocationFactory(fact: OEAltLocationFactory) -> OEAltLocationFactory
            OEAltLocationFactory(src: Union[OEGraphMol,OEMol,OEQMol],
                                 options: int) -> OEAltLocationFactory

      Default and copy constructors.

      If an :ref:`OEMolBase <OEChem_OEMolBase>` is supplied, the constructed factory will describe alternate locations
      in the input molecule and generate new single-conformation molecules on demand for any set
      of alternate location selections. The initial selection state of this factory is as if
      :oe:meth:`SetPrimaryAlt<OEBio::OEAltLocationFactory::SetPrimaryAlt>` has been called.

      .. note::

         When reading a molecule from a PDB file that will be used to construct an
         :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocation>` be sure to specify the input flavor:
         :oe:const:`OEChem::OEIFlavor::PDB::ALTLOC` so that all the alternate location atoms will be retained.

      The options argument provides control over how the factory is constructed. The set of unsigned values
      for this parameter is specified
      by the :oe:constns:`OEBio::OEAltLocFactOption` namespace.

      If an :ref:`OEAltLocationFactory <OEBio_OEAltLocationFactory>` is supplied, an object is constructed that matches the input.

      .. oe:api:

         OEAltLocationFactory(OEChem::OEAltLocationFactoryImpl *impl)

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

      .. oe:api::

         OEAltLocationFactory &operator=(const OEAltLocationFactory &fact)

      Assignment -- sets this alternate location factory to be identical to the input.

      Assignment operator.


   .. oe:method:: GetAltAtoms

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

         .. oe:api::

            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetAltAtoms() const
            OESystem::OEIterBase< OEChem::OEAtomBase> * GetAltAtoms()
            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetAltAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const
            OESystem::OEIterBase<OEChem::OEAtomBase>* GetAltAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred)
            OESystem::OEIterBase<const OEChem::OEAtomBase> * GetAltAtoms(const OEAltGroup& grp) const
            OESystem::OEIterBase< OEChem::OEAtomBase> * GetAltAtoms(const OEAltGroup& grp)
            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetAltAtoms(const OEAltGroup& grp,
                                                                        const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const
            OESystem::OEIterBase< OEChem::OEAtomBase> * GetAltAtoms(const OEAltGroup& grp,
                                                                    const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred)
            OESystem::OEIterBase<const OEChem::OEAtomBase> * GetAltAtoms(const OEAltLocation& loc) const
            OESystem::OEIterBase< OEChem::OEAtomBase> * GetAltAtoms(const OEAltLocation& loc)
            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetAltAtoms(const OEAltLocation& loc,
                                                                        const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const
            OESystem::OEIterBase< OEChem::OEAtomBase> * GetAltAtoms(const OEAltLocation& loc,
                                                                    const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred)

      .. oe:language:: python

         .. oe:api:: python

            GetAltAtoms() -> Iterable[OEAtomBase]
            GetAltAtoms() -> OEAtomIter
            GetAltAtoms(pred: OEUnaryAtomPred) -> Iterable[OEAtomBase]
            GetAltAtoms(pred: OEUnaryAtomPred) -> OEAtomIter
            GetAltAtoms(grp: OEAltGroup) -> Iterable[OEAtomBase]
            GetAltAtoms(grp: OEAltGroup) -> OEAtomIter
            GetAltAtoms(grp: OEAltGroup, pred: OEUnaryAtomPred) -> Iterable[OEAtomBase]
            GetAltAtoms(grp: OEAltGroup, pred: OEUnaryAtomPred) -> OEAtomIter
            GetAltAtoms(loc: OEAltLocation) -> Iterable[OEAtomBase]
            GetAltAtoms(loc: OEAltLocation) -> OEAtomIter
            GetAltAtoms(loc: OEAltLocation, pred: OEUnaryAtomPred) -> Iterable[OEAtomBase]
            GetAltAtoms(loc: OEAltLocation, pred: OEUnaryAtomPred) -> OEAtomIter

      Returns an :ref:`OEAtomBase <OEChem_OEAtomBase>` iterator over the atoms with alternate locations.
      Both ``const`` and non-``const`` versions are supplied for each iterator.

      If no arguments are supplied, the iterator is over all alternate location atoms.

      If an :ref:`OEAltGroup <OEBio_OEAltGroup>` or :ref:`OEAltLocation <OEBio_OEAltLocation>` is supplied, the iterator
      is only over the atoms in the specified group or location.

      If an :ref:`OEUnaryPredicate <OESystem_OEUnaryPredicate>` is supplied, the iterator will return those
      alternate location atoms that also match the predicate.

   .. oe:method:: GetAtomMapSize

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

         .. oe:api::

            unsigned int GetAtomMapSize() const

      .. oe:language:: python

         .. oe:api:: python

            GetAtomMapSize() -> int

      Returns the minimum size of the array of :ref:`OEAtomBase <OEChem_OEAtomBase>` pointers
      the user must supply to one of the
      :oe:meth:`MakePrimaryAltMol<OEBio::OEAltLocationFactory::MakePrimaryAltMol>`,
      :oe:meth:`MakeCurrentAltMol<OEBio::OEAltLocationFactory::MakeCurrentAltMol>`, or
      :oe:meth:`MakeAltMol<OEBio::OEAltLocationFactory::MakeAltMol>` methods
      if an atom map is to be returned. Atom maps are pointers to atoms
      in the generated molecule at locations in the
      array equal to the internal index of atoms in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for atoms not included
      in the generated molecule.

   .. oe:method:: GetBondMapSize

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

         .. oe:api::

            unsigned int GetBondMapSize() const

      .. oe:language:: python

         .. oe:api:: python

            GetBondMapSize() -> int

      Returns the minimum size of the array of :ref:`OEBondBase <OEChem_OEBondBase>` pointers
      the user must supply to one of the
      :oe:meth:`MakePrimaryAltMol<OEBio::OEAltLocationFactory::MakePrimaryAltMol>`,
      :oe:meth:`MakeCurrentAltMol<OEBio::OEAltLocationFactory::MakeCurrentAltMol>`, or
      :oe:meth:`MakeAltMol<OEBio::OEAltLocationFactory::MakeAltMol>` methods
      if a bond map is to be returned. Bond maps are arrays of pointers to bonds
      in the generated molecule at locations in the
      array equal to the internal index of bonds in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for bonds not included
      in the generated molecule.

   .. oe:method:: GetCurrentAtoms

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

         .. oe:api::

            OESystem::OEIterBase< OEChem::OEAtomBase> * GetCurrentAtoms()
            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetCurrentAtoms() const
            OESystem::OEIterBase< OEChem::OEAtomBase> * GetCurrentAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred)
            OESystem::OEIterBase<const OEChem::OEAtomBase>* GetCurrentAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred) const

      .. oe:language:: python

         .. oe:api:: python

            GetCurrentAtoms() -> Iterable[OEAtomBase]
            GetCurrentAtoms() -> OEAtomIter
            GetCurrentAtoms(pred: OEUnaryAtomPred) -> Iterable[OEAtomBase]
            GetCurrentAtoms(pred: OEUnaryAtomPred) -> OEAtomIter

      Returns an :ref:`OEAtomBase <OEChem_OEAtomBase>` iterator over the atoms in the current selection -- atoms in
      selected locations in each group plus atoms that are not in any alternate location group.
      Both ``const`` and non-``const`` versions are supplied for each iterator.

      If an :ref:`OEUnaryPredicate <OESystem_OEUnaryPredicate>` is supplied, the iterator will return
      those selected atoms that also match the predicate.

   .. oe:method:: GetCurrentLocations

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

         .. oe:api::

            OESystem::OEIterBase<const OEAltLocation>* GetCurrentLocations() const
            OESystem::OEIterBase<const OEAltLocation>* GetCurrentLocations(const OEAltGroup& grp) const
            OESystem::OEIterBase<const OEAltLocation>* GetCurrentLocations(int grpNum) const

      .. oe:language:: python

         .. oe:api:: python

            GetCurrentLocations() -> Iterable[OEAltLocation]
            GetCurrentLocations(grp: OEAltGroup) -> Iterable[OEAltLocation]
            GetCurrentLocations(grpNum: int) -> Iterable[OEAltLocation]

      Returns an iterator over currently selected :oe:cls:`OEAltLocations<OEBio::OEAltLocation>`.
      If no argument is supplied, every selected location is returned, otherwise only the
      selected location(s) for the specified :oe:cls:`OEAltGroup<OEBio::OEAltGroup>` is returned.
      Unless :oe:meth:`SetAlt<OEBio::OEAltLocationFactory::SetAlt>`
      has been called with ``multiLoc`` set to ``true``, only a single
      :oe:cls:`OEAltLocation<OEBio::OEAltLocation>` will be returned per
      :oe:cls:`OEAltGroup<OEBio::OEAltGroup>`.

   .. oe:method:: GetGroup

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

         .. oe:api::

            OEAltGroup GetGroup(const OEChem::OEAtomBase* selAtom) const
            OEAltGroup GetGroup(const OEAltLocation& loc) const

      .. oe:language:: python

         .. oe:api:: python

            GetGroup(selAtom: OEAtomBase) -> OEAltGroup
            GetGroup(loc: OEAltLocation) -> OEAltGroup

      If an :ref:`OEAtomBase <OEChem_OEAtomBase>` pointer is supplied, the method returns
      the :oe:cls:`OEAltGroup<OEBio::OEAltGroup>` that includes the residue of the atom provided as input.
      If the input atom residue is not in any of the alternate location groups, a warning will be thrown,
      the :oe:cls:`OEAltGroup<OEBio::OEAltGroup>` will be uninitialized and will return ``false``
      when :oe:meth:`operator bool<OEBio::OEAltGroup::operator bool>` is called.

      If an :oe:cls:`OEAltLocation<OEBio::OEAltLocation>` is supplied, the method returns the
      :oe:cls:`OEAltGroup<OEBio::OEAltGroup>` the location is associated with.

   .. oe:method:: GetGroupCount

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

         .. oe:api::

            unsigned int GetGroupCount() const

      .. oe:language:: python

         .. oe:api:: python

            GetGroupCount() -> int

      Returns the total number of :oe:cls:`OEAltGroups<OEBio::OEAltGroup>` identified by this
      :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`.

   .. oe:method:: GetGroups

      .. oe:api::

         OESystem::OEIterBase<const OEAltGroup> *GetGroups() const

      Returns an iterator over all :oe:cls:`OEAltGroups<OEBio::OEAltGroup>` managed by this
      :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`.

   .. oe:method:: GetLocation

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

         .. oe:api::

            OEAltLocation GetLocation(const OEChem::OEAtomBase* selAtom,
                                      char confCode, bool caseSensitive = true) const

      .. oe:language:: python

         .. oe:api:: python

            GetLocation(selAtom: OEAtomBase, confCode: str,
                        caseSensitive: bool = True) -> OEAltLocation

      Returns the :oe:cls:`OEAltLocation<OEBio::OEAltLocation>` that includes the residue of
      the selected atom and the
      conformation code provided as input. The user can select whether or not
      the conformation code match is case sensitive.
      If the input atom residue is not in any of the alternate location groups,
      a warning will be thrown, the :oe:cls:`OEAltLocation<OEBio::OEAltLocation>`
      will be uninitialized and will return ``false``
      when :oe:meth:`operator bool<OEBio::OEAltLocation::operator bool>` is called.

   .. oe:method:: GetLocationCodes

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

         .. oe:api::

            std::string GetLocationCodes(const OEAltGroup& grp) const
            std::string GetLocationCodes(const OEAltLocation& loc) const

      .. oe:language:: python

         .. oe:api:: python

            GetLocationCodes(grp: OEAltGroup) -> str
            GetLocationCodes(loc: OEAltLocation) -> str

      Returns a string listing all the alternate location characters in the input :oe:cls:`OEAltGroup<OEBio::OEAltGroup>`
      or :oe:cls:`OEAltLocation<OEBio::OEAltLocation>`.
      Although most :oe:cls:`OEAltLocations<OEBio::OEAltLocation>` will return a string containing
      only a single character,
      some that are more complicated will return a string with more than one character.

   .. oe:method:: GetSourceMol

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

         .. oe:api::

            const OEChem::OEMolBase& GetSourceMol() const

      .. oe:language:: python

         .. oe:api:: python

            GetSourceMol() -> OEGraphMol

      Returns a constant reference to a copy of the :ref:`OEMolBase <OEChem_OEMolBase>` supplied to the
      :oe:meth:`Constructor<OEBio::OEAltLocationFactory::Constructors>`.

   .. oe:method:: GetState

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

         .. oe:api::

            OEAltLocationState GetState() const
            void GetState(OEAltLocationState& state) const

      .. oe:language:: python

         .. oe:api:: python

            GetState() -> OEAltLocationState
            GetState(state: OEAltLocationState) -> None

      Returns an :oe:cls:`OEAltLocationState<OEBio::OEAltLocationState>` that represents
      the current selection state of this
      :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`.

      .. seealso::

         * :oe:meth:`SetState<OEBio::OEAltLocationFactory::SetState>`
         * :oe:meth:`MakeAltMol<OEBio::OEAltLocationFactory::MakeAltMol>`

   .. oe:method:: MakeAltMol

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

         .. oe:api::

            bool MakeAltMol(OEChem::OEMolBase& dst, const OEAltLocation& loc,
                            OEChem::OEAtomBase** atomMap = 0,
                            OEChem::OEBondBase** bondMap = 0,
                            unsigned int options = OEBio::OEMakeAltMolOption::None)
            bool MakeAltMol(OEChem::OEMolBase& dst,
                            const OEChem::OEAtomBase* selAtom, char confCode,
                            bool caseSensitive = true,
                            OEChem::OEAtomBase** atomMap = 0,
                            OEChem::OEBondBase** bondMap = 0,
                            unsigned int options = OEBio::OEMakeAltMolOption::None)
            bool MakeAltMol(OEChem::OEMolBase& dst,
                            const OEAltLocationState& state,
                            OEChem::OEAtomBase** atomMap = 0,
                            OEChem::OEBondBase** bondMap = 0,
                            unsigned int options = OEBio::OEMakeAltMolOption::None)

      .. oe:language:: python

         .. oe:api:: python

            MakeAltMol(dst: Union[OEGraphMol,OEMol,OEQMol], loc: OEAltLocation,
                       atomMap: OEAtomBase = None, bondMap: OEBondBase = None,
                       options: int) -> bool
            MakeAltMol(dst: Union[OEGraphMol,OEMol,OEQMol],
                       selAtom: OEAtomBase, confCode: str,
                       caseSensitive: bool = True, atomMap: OEAtomBase = None,
                       bondMap: OEBondBase = None, options: int) -> bool
            MakeAltMol(dst: Union[OEGraphMol,OEMol,OEQMol],
                       state: OEAltLocationState, atomMap: OEAtomBase = None,
                       bondMap: OEBondBase = None, options: int) -> bool

      Sets the selection state of this :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`
      and generates a new subset molecule (``dst``) for this state, returning a value indicating
      whether the selection was valid.
      Unless :oe:meth:`SetAlt<OEBio::OEAltLocationFactory::SetAlt>`
      has been called with ``multiLoc`` set to ``true``,
      the subset mol will represent a single conformation.

      If either a location or an atom selection is supplied
      (see :oe:meth:`GetLocation<OEBio::OEAltLocationFactory::GetLocation>`),
      the selection state of only one group is set.
      If an :oe:cls:`OEAltLocationState<OEBio::OEAltLocationState>` is supplied,
      the selection state of all groups may be affected
      (see :oe:meth:`GetState<OEBio::OEAltLocationFactory::GetState>`).

      If either a location or an atom selection is supplied and cannot be found in any
      alternation group, the ``dst`` molecule is not updated and ``false`` is returned.

      If an array of :ref:`OEAtomBase <OEChem_OEAtomBase>` pointers is provided, this method will fill
      it with an atom map: pointers to atoms in the generated molecule at locations in the
      array equal to the internal index of atoms in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for atoms not included
      in the generated molecule.

      If an array of :ref:`OEBondBase <OEChem_OEBondBase>` pointers is provided, this method will fill
      it with a bond map: pointers to bonds in the generated molecule at locations in the
      array equal to the internal index of bonds in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for bonds not included
      in the generated molecule.

      The options argument provides control over how the molecule is constructed.
      The set of unsigned values for this parameter is specified
      by the :oe:constns:`OEBio::OEMakeAltMolOption` namespace.

   .. oe:method:: MakeCurrentAltMol

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

         .. oe:api::

            void MakeCurrentAltMol(OEChem::OEMolBase& dst,
                                   OEChem::OEAtomBase** atomMap = 0,
                                   OEChem::OEBondBase** bondMap = 0,
                                   unsigned int options = OEBio::OEMakeAltMolOption::None) const

      .. oe:language:: python

         .. oe:api:: python

            MakeCurrentAltMol(dst: Union[OEGraphMol,OEMol,OEQMol],
                              atomMap: OEAtomBase = None,
                              bondMap: OEBondBase = None, options: int) -> None

      Generates a new subset molecule (``dst``) for the current selection state.
      Unless :oe:meth:`SetAlt<OEBio::OEAltLocationFactory::SetAlt>`
      has been called with ``multiLoc`` set to ``true``,
      the subset mol will represent a single conformation.

      If an array of :ref:`OEAtomBase <OEChem_OEAtomBase>` pointers is provided, this method will fill
      it with an atom map: pointers to atoms in the generated molecule at locations in the
      array of the internal index of atoms in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for atoms not included
      in the generated molecule.

      If an array of :ref:`OEBondBase <OEChem_OEBondBase>` pointers is provided, this method will fill
      it with a bond map: pointers to bonds in the generated molecule at locations in the
      array of the internal index of bonds in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for bonds not included
      in the generated molecule.

      The options argument provides control over how the molecule is constructed.
      The set of unsigned values for this parameter is specified
      by the :oe:constns:`OEBio::OEMakeAltMolOption` namespace.

   .. oe:method:: MakePrimaryAltMol

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

         .. oe:api::

            void MakePrimaryAltMol(OEChem::OEMolBase& dst,
                                   OEChem::OEAtomBase** atomMap = 0,
                                   OEChem::OEBondBase** bondMap = 0,
                                   unsigned int options = OEBio::OEMakeAltMolOption::None)

      .. oe:language:: python

         .. oe:api:: python

            MakePrimaryAltMol(dst: Union[OEGraphMol,OEMol,OEQMol],
                              atomMap: OEAtomBase = None,
                              bondMap: OEBondBase = None, options: int) -> None

      Resets the selection state of this :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`
      to the primary location (see :oe:meth:`SetPrimaryAlt<OEBio::OEAltLocationFactory::SetPrimaryAlt>`)
      and generates a new subset molecule (``dst``) for this state.
      Unless :oe:meth:`SetAlt<OEBio::OEAltLocationFactory::SetAlt>`
      has been called with ``multiLoc`` set to ``true``,
      the subset mol will represent a single conformation.

      If an array of :ref:`OEAtomBase <OEChem_OEAtomBase>` pointers is provided, this method will fill
      it with an atom map: pointers to atoms in the generated molecule at locations in the
      array of the internal index of atoms in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for atoms not included
      in the generated molecule.

      If an array of :ref:`OEBondBase <OEChem_OEBondBase>` pointers is provided, this method will fill
      it with a bond map: pointers to bonds in the generated molecule at locations in the
      array of the internal index of bonds in the molecule returned by
      :oe:meth:`GetSourceMol<OEBio::OEAltLocationFactory::GetSourceMol>`, or 0 for bonds not included
      in the generated molecule.

      The options argument provides control over how the molecule is constructed.
      The set of unsigned values for this parameter is specified
      by the :oe:constns:`OEBio::OEMakeAltMolOption` namespace.

   .. oe:method:: SetAlt

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

         .. oe:api::

            bool SetAlt(const OEAltLocation& loc, bool multiLoc = false)
            bool SetAlt(const OEChem::OEAtomBase* selAtom, char confCode,
                        bool caseSensitive = true)

      .. oe:language:: python

         .. oe:api:: python

            SetAlt(loc: OEAltLocation, multiLoc: bool = False) -> bool
            SetAlt(selAtom: OEAtomBase, confCode: str,
                   caseSensitive: bool = True) -> bool

      If an :oe:cls:`OEAltLocation<OEBio::OEAltLocation>` is supplied,
      the selection state of the :oe:cls:`OEAltGroup<OEBio::OEAltGroup>`
      containing the location is set to select that location, with a return value
      indicating whether the location was found. If the optional ``multiLoc``
      parameter has the (default) value of ``false``, the function acts like a
      toggle: the previous location for
      this group is unselected before the new location is selected.

      For a description of the atom selection form,
      see :oe:meth:`GetLocation<OEBio::OEAltLocationFactory::GetLocation>`.

      .. warning::

         If this method is called with the ``multiLoc`` parameter set to ``true``, the
         :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>` may be left in a state
         where :oe:meth:`MakeCurrentAltMol<OEBio::OEAltLocationFactory::MakeCurrentAltMol>`
         no longer generates a single-conformation molecule.

   .. oe:method:: SetPrimaryAlt

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

         .. oe:api::

            void SetPrimaryAlt()

      .. oe:language:: python

         .. oe:api:: python

            SetPrimaryAlt() -> None

      Resets the selection state of this :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`
      to the first location for each group -- the location with the highest average occupancy.

   .. oe:method:: SetState

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

         .. oe:api::

            bool SetState(const OEAltLocationState& state)

      .. oe:language:: python

         .. oe:api:: python

            SetState(state: OEAltLocationState) -> bool

      Resets the selection state of this :oe:cls:`OEAltLocationFactory<OEBio::OEAltLocationFactory>`
      to that represented by the input :oe:cls:`OEAltLocationState<OEBio::OEAltLocationState>`,
      with a return value indicating whether the state was valid.

      .. seealso::

         * :oe:meth:`GetState<OEBio::OEAltLocationFactory::GetState>`
         * :oe:meth:`MakeAltMol<OEBio::OEAltLocationFactory::MakeAltMol>`
