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

.. oe:namespace:: OEBio

.. _OEDesignUnit_bio:

.. _OEBio_OEDesignUnit:

.. oe:class:: OEDesignUnit

   .. attention::

      |TWOLANGUAGE|

   .. oe:api::

      class OEDesignUnit : public OESystem::OEBase

   This is a container class derived from :ref:`OEBase <OESystem_OEBase>`
   that holds all molecules needed to construct a model-ready biomolecular system.

   .. oe:method:: Constructors

      .. oe:language:: c++

         .. oe:api:: c++

            OEDesignUnit()

         Default constructor.

         .. oe:api:: c++

            OEDesignUnit(const OEDesignUnit& rhs)

         Copy constructor.

      .. oe:language:: python

         .. oe:api:: python

            OEDesignUnit() -> OEDesignUnit
            OEDesignUnit(rhs: OEDesignUnit) -> OEDesignUnit
            OEDesignUnit(target: Union[OEGraphMol,OEMol,OEQMol],
                         siteResidues: OEStringVector,
                         solvent: Union[OEGraphMol,OEMol,OEQMol]=OEGraphMol(),
                         cofactors: Union[OEGraphMol,OEMol,OEQMol]=OEGraphMol(),
                         targetID: int) -> OEDesignUnit
            OEDesignUnit(target: Union[OEGraphMol,OEMol,OEQMol],
                         ligand: Union[OEGraphMol,OEMol,OEQMol],
                         solvent: Union[OEGraphMol,OEMol,OEQMol]=OEGraphMol(),
                         cofactors: Union[OEGraphMol,OEMol,OEQMol]=OEGraphMol(),
                         targetID: int) -> OEDesignUnit

         Default constructor.

   .. oe:method:: Molecule constructors

      .. note::

         Molecule constructors are intended for already prepared molecules. They requires a target structure, as well as either a ligand or a list of binding site residues. Solvent and co-factors are optional, and are only set if the molecules passed are valid.
         The target molecule is not split into components and no structure preparation take place. A title will be generated based on the names of the provided molecules, but can be set manually afterwards.
         
      .. oe:api::

         OEDesignUnit(const OEChem::OEMolBase& target,
                      const OEChem::OEMolBase& ligand,
                      const OEChem::OEMolBase& solvent = OEChem::OEGraphMol(),
                      const OEChem::OEMolBase& cofactors = OEChem::OEGraphMol(),
                      const unsigned targetID = OEDesignUnitComponents::Protein)

      Target-ligand constructor

      .. oe:api::

         OEDesignUnit(const OEChem::OEMolBase& target,
                      const std::vector<std::string>& siteResidues,
                      const OEChem::OEMolBase& solvent = OEChem::OEGraphMol(),
                      const OEChem::OEMolBase& cofactors = OEChem::OEGraphMol(),
                      const unsigned targetID = OEDesignUnitComponents::Protein)

      Apo target constructor

   .. oe:method:: operator=

      .. oe:language:: c++

         .. oe:api:: c++

            OEDesignUnit& operator=(const OEDesignUnit& rhs)

         Assignment operator

      Assignment operator.


   .. oe:method:: operator bool

      .. oe:language:: c++

         .. oe:api:: c++
         
            operator bool() const

         Returns whether the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object is valid.

   .. _OEBio_OEDesignUnit_Clear:

   .. oe:method:: Clear

      .. oe:language:: c++
      
         .. oe:api:: c++

            void Clear()

         Resets the  :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object to its initial state. This method
         deletes all internally stored molecules, and clears any
         :ref:`OEBase <OESystem_OEBase>` data from the object.

      .. oe:language:: python

         .. oe:api:: python

            Clear() -> None

         Resets the  :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object to its initial state. This method
         deletes all internally stored molecules, and clears any
         :ref:`OEBase <OESystem_OEBase>` data from the object.

   .. _OEBio_OEDesignUnit_CreateCopy:

   .. oe:method:: CreateCopy

      .. oe:language:: c++
      
         .. oe:api:: c++

            OEBio::OEDesignUnit* CreateCopy() const

         Deep copy constructor that returns a copy of the object. The
         memory for the returned  :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object is dynamically
         allocated and owned by the caller.

      .. oe:language:: python
      
         .. oe:api:: python

            CreateCopy() -> OEDesignUnit

         Deep copy constructor that returns a copy of the object. The
         memory for the returned  :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object is dynamically
         allocated and owned by the caller.

   .. _OEBio_OEDesignUnit_GetComponent:

   .. oe:method:: GetComponent

      .. oe:language:: c++
      
         .. oe:api:: c++

            const OEChem::OEMolBase& GetComponent(unsigned componentID) const

         Returns a const reference to the molecule on the
         :ref:`OEDesignUnit <OEBio_OEDesignUnit>` that is associated with the input
         componentID. Note that this function only works for single molecule components (e.g. protein, ligand, etc).
         This function requires an empty :ref:`OEMolBase <OEChem_OEMolBase>` or it will clear the incoming molecule.

         .. oe:api:: c++

            bool GetComponent(OEMolBase& mol, unsigned componentID) const

         Returns success based on a valid copy of the molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object that is associated with the input
         componentID.

      .. oe:language:: python

         .. oe:api:: python

            GetComponent(molecule: Union[OEGraphMol,OEMol,OEQMol],
                         componentID: int) -> bool

         Returns a const reference to the molecule on the
         :ref:`OEDesignUnit <OEBio_OEDesignUnit>` that is associated with the input
         componentID. Note that this function only works for single molecule components (e.g. protein, ligand, etc).
         This function requires an empty :ref:`OEMolBase <OEChem_OEMolBase>` or it will clear the incoming molecule.

   .. _OEBio_OEDesignUnit_GetComponentID:

   .. oe:method:: GetComponentID

      .. oe:language:: c++

         .. oe:api:: c++

            unsigned GetComponentID(const std::string& componentTag) const

         Returns the internal unsigned integer representation of the
         componentTag string from the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            GetComponentID(componentTag: str) -> int

         Returns the internal unsigned integer representation of the
         componentTag string from the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetComponentTag:

   .. oe:method:: GetComponentTag

      .. oe:language:: c++
      
         .. oe:api:: c++

            std::string GetComponentTag(unsigned componentID) const

         Returns the string tag representation of the componentID
         unsigned integer from the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
      
         .. oe:api:: python

            GetComponentTag(componentID: int) -> str

         Returns the string tag representation of the componentID
         unsigned integer from the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetComponents:

   .. oe:method:: GetComponents

      .. oe:language:: c++

         .. oe:api:: c++

            bool GetComponents(OEChem::OEMolBase& mol, unsigned componentMask,
                               bool bondCovalent = true,
                               const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& pred = OEChem::OEIsTrueAtom())) const

         The function creates a single output mol from the components
         given in the componentMask bit mask. The bit mask can be
         constructed using unsigned integers stored in the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace. The
         function returns a boolean value to alert if the operation was
         successful. Note that this function only works for a list of components (e.g. other_ligands, excipients, etc).
         The optional predicate can be used to subset some of the components
         in the specified bit mask. The predicate does not have to be complete,
         e.g. two water molecules can be specified to subset the solvent category,
         but that will not subset the protein component also included in that mask.
         In essence the predicate is checked to see if it matches part of a design unit
         component and only in this case does it take effect. 

      .. oe:language:: python

         .. oe:api:: python

            GetComponents(mol: Union[OEGraphMol,OEMol,OEQMol],
                          componentMask: int, bondCovalent: bool = True,
                          pred: OEUnaryAtomPred = OEIsTrueAtom()) -> bool

         The function creates a single output mol from the components
         given in the componentMask bit mask. The bit mask can be
         constructed using unsigned integers stored in the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace. The
         function returns a boolean value to alert if the operation was
         successful. Note that this function only works for a list of components (e.g. other_ligands, excipients, etc).
         The optional predicate can be used to subset some of the components
         in the specified bit mask. The predicate does not have to be complete,
         e.g. two water molecules can be specified to subset the solvent category,
         but that will not subset the protein component also included in that mask.
         In essence the predicate is checked to see if it matches part of a design unit
         component and only in this case does it take effect. 

   .. _OEBio_OEDesignUnit_GetComponentsWithin:

   .. oe:method:: GetComponentsWithin

      .. oe:language:: c++
         
         .. oe:api:: c++

            bool GetComponentsWithin(OEChem::OEMolBase& mol,
                                     unsigned componentMask = OEDesignUnitComponents::Solvent,
                                     unsigned withinMask = OEDesignUnitComponents::Protein,
                                     double dist = 5.0, bool includeself,
                                     bool bondCovalent = true) const

         The function creates a single output mol from the components
         given in the componentMask bit mask that fall within a dist
         distance of components given in the withinMask bit mask. All bit
         masks can be constructed using unsigned integers stored in the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace. If the
         boolean bondCovalent flag is set, all components that should be
         covalently bonded will have bonded added in the output mol. The
         function returns a boolean value to alert if the operation was
         successful.

      .. oe:language:: python
         
         .. oe:api:: python

            GetComponentsWithin(mol: Union[OEGraphMol,OEMol,OEQMol],
                                componentMask: int, withinMask: int,
                                dist: float = 5.0, includeSelf: bool = False,
                                bondCovalent: bool = True) -> bool

         The function creates a single output mol from the components
         given in the componentMask bit mask that fall within a dist
         distance of components given in the withinMask bit mask. All bit
         masks can be constructed using unsigned integers stored in the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace. If the
         boolean bondCovalent flag is set, all components that should be
         covalently bonded will have bonded added in the output mol. The
         function returns a boolean value to alert if the operation was
         successful.


   .. _OEBio_OEDesignUnit_GetDataType:

   .. oe:method:: GetDataType

      .. oe:language:: c++

         .. oe:api:: c++

            const void* GetDataType() const

         This pure virtual function is used to perform run-time type
         identification. The value returned by the method should be
         equivalent to the value returned by :oe:func:`OESystem::OEGetDataType`
         using the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` derived class type as the template argument.

      .. oe:language:: python

         .. oe:api:: python

            GetDataType() -> void

         This pure virtual function is used to perform run-time type
         identification. The value returned by the method should be
         equivalent to the value returned by :oe:func:`OESystem::OEGetDataType`
         using the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` derived class type as the template argument.

   .. _OEBio_OEDesignUnit_GetIDs:

   .. oe:method:: GetIDs

      .. oe:language:: c++

         .. oe:api:: c++

            const std::vector<unsigned> GetIDs() const

         Returns a vector of the component IDs stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            GetIDs() -> OEUIntVector
         
         Returns a vector of the component IDs stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetLigand:

   .. oe:method:: GetLigand

      .. oe:language:: c++

         .. oe:api::

            const OEChem::OEMolBase& GetLigand() const

         Returns a const reference to the ligand molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
      
         .. oe:api:: python

            GetLigand(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool
      
         Returns success based on a valid copy of the ligand molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:source:: extract_ligand_oedu.py
         :language: python
         :noindent:
         :frag: SNIPPET-ExtractLigandFromDesignUnit
      
      .. oe:language:: python

         Whole example script can be downloaded from :ref:`here<section_example_oebio_extract_ligand>`.


   .. _OEBio_OEDesignUnit_GetMetal:

   .. oe:method:: GetMetal

      .. oe:language:: c++

         .. oe:api:: c++

            const OEChem::OEMolBase& GetMetal() const

         Returns a const reference to the metal on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
   
         .. oe:api:: python

            GetMetal(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool

         Returns success based on a valid copy of the metal in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetNucleicAcid:

   .. oe:method:: GetNucleicAcid

      .. oe:language:: c++

         .. oe:api:: c++

            const OEChem::OEMolBase& GetNucleicAcid() const

         Returns a const reference to the nucleic acid molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

         .. oe:api:: c++

            bool GetNucleicAcid(OEMolBase& mol) const
      
         Returns success based on a valid copy of the nucleic acid molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.
      
      .. oe:language:: python
   
         .. oe:api:: python

            GetNucleicAcid(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool
         
         Returns success based on a valid copy of the nucleic acid molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetPDBMetaData:

   .. oe:method:: GetPDBMetaData

      .. oe:language:: c++

         .. oe:api:: c++

            bool OEDesignUnit::GetPDBMetaData(OEChem::OEMolBase& mol) const
      
         Returns success based on a valid copy of the PDB metadata in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.
      
      .. oe:language:: python
   
         .. oe:api:: python

            GetPDBMetaData(mol: Union[OEGraphMol,OEMol,OEQMol]) -> bool
         
         Returns success based on a valid copy of the PDB metadata in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object. 

         .. seealso::

            * :ref:`OEResidueToString <OEChem_OEResidueToString>` function.

   .. _OEBio_OEDesignUnit_GetPackingResidues:

   .. oe:method:: GetPackingResidues

      .. oe:language:: c++

         .. oe:api:: c++

            const OEChem::OEMolBase& GetPackingResidues() const

         Returns a const reference to the packing residue molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

         .. oe:api:: c++

            bool GetPackingResidues(OEMolBase& mol) const

         Returns success based on a valid copy of the packing residue molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            GetPackingResidues(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool

         Returns success based on a valid copy of the packing residue molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetProtein:

   .. oe:method:: GetProtein

      .. oe:language:: c++
         
         .. oe:api:: c++

            const OEChem::OEMolBase& GetProtein() const

         Returns a const reference to the protein molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.
         Note that this function requires an empty :ref:`OEMolBase <OEChem_OEMolBase>` or it will clear the incoming molecule.

         .. oe:api:: c++

            bool GetProtein(OEMolBase& mol) const
      
         Returns success based on a valid copy of the protein molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
         
         .. oe:api:: python

            GetProtein(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool
      
         Returns success based on a valid copy of the protein molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.
         Note that this function requires an empty :ref:`OEMolBase <OEChem_OEMolBase>` or it will clear the incoming molecule.

   .. _OEBio_OEDesignUnit_GetReceptor:

   .. oe:method:: GetReceptor

      .. oe:language:: c++

         .. oe:api:: c++

            const OEBio::OEReceptor& GetReceptor() const
            OEBio::OEReceptor& GetReceptor()

         Returns a reference to the receptor on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

         .. oe:api:: c++

            bool OEDesignUnit::GetReceptor(OEBio::OEReceptor& receptor) const

         Returns success based on a valid copy of the receptor in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            GetReceptor() -> OEReceptor

         Returns a reference to the receptor on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.


   .. _OEBio_OEDesignUnit_GetSiteResidues:

   .. oe:method:: GetSiteResidues

      .. oe:language:: c++
         
         .. oe:api:: c++

            const std::vector<std::string> GetSiteResidues() const

         Returns a vector of the site residue strings stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object. This function calls the :ref:`OEResidueToString <OEChem_OEResidueToString>` function with ":" delimiter.

      .. oe:language:: python
         
         .. oe:api:: python

            GetSiteResidues() -> OEStringVector

         Returns a vector of the site residue strings stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.  This function calls the :ref:`OEResidueToString <OEChem_OEResidueToString>` function with ":" delimiter.

   .. _OEBio_OEDesignUnit_GetSolvent:

   .. oe:method:: GetSolvent

      .. oe:language:: c++
   
         .. oe:api:: c++

            const OEChem::OEMolBase& GetSolvent() const

         Returns a const reference to the solvent molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

         .. oe:api:: c++

            bool GetSolvent(OEMolBase& mol) const
      
         Returns success based on a valid copy of the solvent molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
   
         .. oe:api:: python

            GetSolvent(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool
      
         Returns success based on a valid copy of the solvent molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetStructureQuality:

   .. oe:method:: GetStructureQuality

      .. oe:language:: c++
   
         .. oe:api:: c++

            const OEBio::OEStructureQuality& GetStructureQuality() const

         Returns the :ref:`OEStructureQuality <OEBio_OEStructureQuality>` class stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
   
         .. oe:api:: python

            GetStructureQuality() -> OEStructureQuality

         Returns the :ref:`OEStructureQuality <OEBio_OEStructureQuality>` class stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. seealso::

         * :ref:`OEStructureQuality <OEBio_OEStructureQuality>` class

   .. _OEBio_OEDesignUnit_GetTransform:

   .. oe:method:: GetTransform

      .. oe:language:: c++
      
         .. oe:api:: c++

            const OEChem::OETrans& GetTransform() const

         Returns the :ref:`OETrans <OEChem_OETrans>` class stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

         .. oe:api:: c++

            bool GetTransform(OEChem::OETrans& trans) const

         Returns success based on a valid copy of the input :ref:`OETrans <OEChem_OETrans>` object in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
      
         .. oe:api:: python

            GetTransform(trans: OETrans) -> bool

         Returns success based on a valid copy of the input :ref:`OETrans <OEChem_OETrans>` object in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. seealso::

         * :ref:`OETrans <OEChem_OETrans>` class

   .. _OEBio_OEDesignUnit_GetTaggedComponents:

   .. oe:method:: GetTaggedComponents

      .. oe:language:: c++
      
         .. oe:api:: c++

            OESystem::OEIterBase<std::pair<std::string, const OEChem::OEMolBase &> > *
            GetTaggedComponents(unsigned componentMask) const

         Returns an :ref:`OEIter <OESystem_OEIter>` of all molecules and
         corresponding molecular tags stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>`
         object. A bit mask of desired components can be constructed from
         constants in the :oe:constns:`OEBio::OEDesignUnitComponents`
         namespace and be passed in via the componentMask argument.

      .. oe:language:: python
      
         .. oe:api:: python

            GetTaggedComponents(componentMask: int) -> Iterable[Tuple[int, OEMolBase]]

         Returns an :ref:`OEIter <OESystem_OEIter>` of all molecules and
         corresponding molecular tags stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>`
         object. A bit mask of desired components can be constructed from
         constants in the :oe:constns:`OEBio::OEDesignUnitComponents`
         namespace and be passed in via the componentMask argument.

   .. _OEBio_OEDesignUnit_GetTags:

   .. oe:method:: GetTags

      .. oe:language:: c++

         .. oe:api:: c++

            const std::vector<std::string> GetTags() const

         Returns a vector of the tags of the molecules stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            GetTags() -> OEStringVector

         Returns a vector of the tags of the molecules stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetTarget:

   .. oe:method:: GetTarget

      .. oe:language:: c++

         .. oe:api:: c++

            const OEChem::OEMolBase& GetTarget() const

         Returns a const reference to target molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

         .. oe:api:: c++

            bool GetTarget(OEMolBase& mol) const
         
         Returns success based on a valid copy of the target molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            GetTarget(molecule: Union[OEGraphMol,OEMol,OEQMol]) -> bool
         
         Returns success based on a valid copy of the target molecule in the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetTargetComponentID:

   .. oe:method:: GetTargetComponentID

      .. oe:language:: c++
   
         .. oe:api:: c++

            unsigned GetTargetComponentID() const

         Returns the component ID from the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace of the
         target molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
   
         .. oe:api:: python

            GetTargetComponentID() -> int

         Returns the component ID from the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace of the
         target molecule on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetTargetComponentTag:


   .. oe:method:: GetTargetComponentTag

      .. oe:language:: c++
      
         .. oe:api:: c++

            std::string GetTargetComponentTag() const

         Returns the string tag of the title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
      
         .. oe:api:: python

            GetTargetComponentTag() -> str

         Returns the string tag of the title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetTitle:

   .. oe:method:: GetTitle

      .. oe:language:: c++
      
         .. oe:api:: c++

            std::string GetTitle() const

         Returns the title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python
      
         .. oe:api:: python

            GetTitle() -> str

         Returns the title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_GetAltLoc:

   .. oe:method:: GetAltLoc

      .. oe:language:: c++
      
         .. oe:api:: c++

            std::string GetAltLoc() const

         Returns the alternate location code used to generate the :ref:`OEDesignUnit <OEBio_OEDesignUnit>`.

      .. oe:language:: python
      
         .. oe:api:: python

            GetAltLoc() -> str

         Returns the alternate location code used to generate the :ref:`OEDesignUnit <OEBio_OEDesignUnit>`.

   .. _OEBio_OEDesignUnit_HasAltLoc:

   .. oe:method:: HasAltLoc

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasAltLoc() const

         Checks that the alternate locations flag on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasAltLoc(OEDesignUnit self) -> bool

         Checks that the alternate locations flag on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.


   .. _OEBio_OEDesignUnit_HasComponent:

   .. oe:method:: HasComponent

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasComponent(unsigned componentID) const

         Checks that a molecule given by the componentID from the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace has been
         set on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            HasComponent(componentID: int) -> bool

         Checks that a molecule given by the componentID from the
         :oe:constns:`OEBio::OEDesignUnitComponents` namespace has been
         set on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_HasLigand:

   .. oe:method:: HasLigand

      .. oe:language:: c++

         .. oe:api:: c++
         
            bool HasLigand() const

         Checks that the ligand molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasLigand() -> bool

         Checks that the ligand molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasMetal:

   .. oe:method:: HasMetal

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasMetal() const

         Checks that the metal molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasMetal() -> bool

         Checks that the metal molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasNucleicAcid:

   .. oe:method:: HasNucleicAcid

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasNucleicAcid() const

         Checks that the nucleic acid molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasNucleicAcid() -> bool

         Checks that the nucleic acid molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasPDBMetaData:


   .. oe:method:: HasPDBMetaData

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasPDBMetaData() const

         Checks that the PDB metadata of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasPDBMetaData() -> bool

         Checks that the PDB metadata of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasPackingResidues:

   .. oe:method:: HasPackingResidues

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasPackingResidues() const

         Checks that the packing residue molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasPackingResidues() -> bool

         Checks that the packing residue molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasProtein:

   .. oe:method:: HasProtein

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasProtein() const

         Checks that the protein molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasProtein() -> bool

         Checks that the protein molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasReceptor:

   .. oe:method:: HasReceptor

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasReceptor() const

         Checks that the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object contains a valid receptor.

      .. oe:language:: python

         .. oe:api:: python

            HasReceptor() -> bool

         Checks that the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object contains a valid receptor.

   .. _OEBio_OEDesignUnit_HasSiteResidues:

   .. oe:method:: HasSiteResidues

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasSiteResidues() const

         Checks that the site residues of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasSiteResidues() -> bool

         Checks that the site residues of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasSolvent:

   .. oe:method:: HasSolvent

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasSolvent() const

         Checks that the solvent molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasSolvent() -> bool

         Checks that the solvent molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasStructureQuality:

   .. oe:method:: HasStructureQuality

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasStructureQuality() const

         Checks that the internal :ref:`OEStructureQuality <OEBio_OEStructureQuality>` object stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasStructureQuality() -> bool

         Checks that the internal :ref:`OEStructureQuality <OEBio_OEStructureQuality>` object stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` has been set.

   .. _OEBio_OEDesignUnit_HasTransform:

   .. oe:method:: HasTransform

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasTransform() const

         Checks that the internal :ref:`OETrans <OEChem_OETrans>` object stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` has been set.

      .. oe:language:: python

         .. oe:api:: python

            HasTransform() -> bool

         Checks that the internal :ref:`OETrans <OEChem_OETrans>` object stored on the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` has been set.

   .. _OEBio_OEDesignUnit_HasTarget:

   .. oe:method:: HasTarget

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasTarget() const

         Checks that the target molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language::python

         .. oe:api:: python

            HasTarget(OEDesignUnit self) -> bool

         Checks that the target molecule of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_HasTitle:

   .. oe:method:: HasTitle

      .. oe:language:: c++

         .. oe:api:: c++

            bool HasTitle() const

         Checks that a title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

      .. oe:language::python

         .. oe:api:: python

            HasTitle(OEDesignUnit self) -> bool

         Checks that a title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object has been set.

   .. _OEBio_OEDesignUnit_IsDataType:

   .. oe:method:: IsDataType

      .. oe:language:: c++

         .. oe:api:: c++

            bool IsDataType(const void *) const

         Returns whether the type is the same as the instance this method is called on.

      .. oe:language:: python

         .. oe:api:: python

            IsDataType(arg2: void) -> bool

         Returns whether the type is the same as the instance this method is called on.

   .. _OEBio_OEDesignUnit_SetTitle:

   .. oe:method:: SetTitle

      .. oe:language:: c++

         .. oe:api:: c++

            bool SetTitle(const std::string& title)

         Sets the title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

      .. oe:language:: python

         .. oe:api:: python

            SetTitle(title: str) -> bool

         Sets the title of the :ref:`OEDesignUnit <OEBio_OEDesignUnit>` object.

   .. _OEBio_OEDesignUnit_SetSiteResidues:

   .. oe:method:: SetSiteResidues

      .. oe:language:: c++

         .. oe:api:: c++

            bool SetSiteResidues(const std::vector<OEChem::OEResidue>& siteResidues,
                                 const float threshold = 0.80f,
                                 const float addBox = 2.0f,
                                 const bool rearrangeComponents = false,
                                 const float siteSize = 5.0f)

         SetSiteResidues sets site residues from :oe:cls:`OEChem::OEResidue` objects, updates site-based components, and regenerates site-dependent interaction and style data.

      .. oe:language:: python

         .. oe:api:: python

            SetSiteResidues(siteResidues: OEResidueVector,
                            threshold: float = 0.80, addBox: float = 2.0,
                            rearrangeComponents: bool = False,
                            siteSize: float = 5.0) -> bool

         SetSiteResidues sets site residues from :oe:cls:`OEChem::OEResidue` objects, updates site-based components, and regenerates site-dependent interaction and style data.

      SetSiteResidues requires residues that are present in the current target component. SetSiteResidues returns ``False`` if ``siteResidues`` is empty, or if any residue in ``siteResidues`` is not found in the target.

      SetSiteResidues uses the optional parameters as follows:

      - The ``threshold`` option defines the minimum heavy-atom fraction of the current ligand that must fall inside the site box. Setting the value to 0.0 skips the ligand coverage validation.
      - The ``addBox`` option expands the site box before ligand coverage is evaluated.
      - The ``rearrangeComponents`` option controls whether components are re-arranged in the design unit based on whether the ligand coverage validation is true or false. 
        Setting ``rearrangeComponents`` to ``False`` causes SetSiteResidues to return ``False`` when ligand coverage is below ``threshold``. Setting the value to ``True``,
        allows component reassignment when ligand coverage is below ``threshold``. The current ligand is moved to ``OtherLigands`` and cofactors are moved to ``OtherCofactors``.
        The list of ``OtherLigands`` is then evaluated, and the best ligand that meets ``threshold`` can be promoted into the ligand component, with corresponding ``OtherCofactors`` moved to the ``Cofactors`` component.
      - ``siteSize`` controls how site-associated cofactors are determined.

      .. note::

         SetSiteResidues preserves an existing receptor only when at least one new site residue overlaps the previous site-residue set. SetSiteResidues clears the receptor when no overlap is found.

   .. _OEBio_OEDesignUnit_ClearReceptor:

   .. oe:method:: ClearReceptor

      .. oe:language:: c++

         .. oe:api:: c++

            bool ClearReceptor()

         Clears the stored :ref:`OEReceptor <OEBio_OEReceptor>` object.

      .. oe:language:: python

         .. oe:api:: python

            ClearReceptor() -> bool

         Clears the stored :ref:`OEReceptor <OEBio_OEReceptor>` object.


   .. _OEBio_OEDesignUnit_ClearComponent:

      .. oe:method:: ClearComponent

      .. oe:language:: c++

         .. oe:api:: c++

            bool ClearComponent(const std::string& componentTag,
                                int listIndex = -1)
            bool ClearComponent(unsigned componentID, int listIndex = -1)

         Clears a specified component.
         The listIndex is intended for listComponents, e.g. co-factors.
         If the listIndex is -1 the entire list is removed, otherwise only the 
         co-factor with the given index is removed.

      .. oe:language:: python

         .. oe:api:: python

            ClearComponent(componentTag: str, listIndex: int = -1) -> bool
            ClearComponent(componentID: int, listIndex: int = -1) -> bool

         Clears a specified component.
         The listIndex is intended for listComponents, e.g. co-factors.
         If the listIndex is -1 the entire list is removed, otherwise only the 
         co-factor with the given index is removed.
