OEAltLocationFactory¶
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 OEAltLocation selections.
Constructors¶
OEAltLocationFactory(const OEAltLocationFactory &fact)
OEAltLocationFactory(const OEChem::OEMolBase &src, unsigned int options=OEBio::OEAltLocFactOption::None)
Default and copy constructors.
If an 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
SetPrimaryAlt has been called.
Note
When reading a molecule from a PDB file that will be used to construct an
OEAltLocationFactory be sure to specify the input flavor:
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 OEAltLocFactOption namespace.
If an OEAltLocationFactory is supplied, an object is constructed that matches the input.
operator=¶
OEAltLocationFactory &operator=(const OEAltLocationFactory &fact)
Assignment – sets this alternate location factory to be identical to the input.
GetAltAtoms¶
OESystem::OEIterBase<OEChem::OEAtomBase> *GetAltAtoms()
OESystem::OEIterBase<const OEChem::OEAtomBase> *GetAltAtoms() const
OESystem::OEIterBase<OEChem::OEAtomBase> *GetAltAtoms(const OEAltGroup &grp)
OESystem::OEIterBase<OEChem::OEAtomBase> *GetAltAtoms(const OEAltLocation &loc)
OESystem::OEIterBase<const OEChem::OEAtomBase> * GetAltAtoms(const OEAltGroup &grp) const
OESystem::OEIterBase<const OEChem::OEAtomBase> * GetAltAtoms(const OEAltLocation &loc) const
OESystem::OEIterBase<OEChem::OEAtomBase> *
GetAltAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred)
OESystem::OEIterBase<const OEChem::OEAtomBase> *
GetAltAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred) const
OESystem::OEIterBase<const OEChem::OEAtomBase> *
GetAltAtoms(const OEAltLocation &loc,
const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred) const
OESystem::OEIterBase<OEChem::OEAtomBase> *
GetAltAtoms(const OEAltGroup &grp,
const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred)
OESystem::OEIterBase<OEChem::OEAtomBase> *
GetAltAtoms(const OEAltLocation &loc,
const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred)
OESystem::OEIterBase<const OEChem::OEAtomBase> *
GetAltAtoms(const OEAltGroup &grp,
const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &pred) const
Returns an 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 OEAltGroup or OEAltLocation is supplied, the iterator is only over the atoms in the specified group or location.
If an OEUnaryPredicate is supplied, the iterator will return those alternate location atoms that also match the predicate.
GetAtomMapSize¶
unsigned int GetAtomMapSize() const
Returns the minimum size of the array of OEAtomBase pointers
the user must supply to one of the
MakePrimaryAltMol,
MakeCurrentAltMol, or
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
GetSourceMol, or 0 for atoms not included
in the generated molecule.
GetBondMapSize¶
unsigned int GetBondMapSize() const
Returns the minimum size of the array of OEBondBase pointers
the user must supply to one of the
MakePrimaryAltMol,
MakeCurrentAltMol, or
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
GetSourceMol, or 0 for bonds not included
in the generated molecule.
GetCurrentAtoms¶
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
Returns an 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 OEUnaryPredicate is supplied, the iterator will return those selected atoms that also match the predicate.
GetCurrentLocations¶
OESystem::OEIterBase<const OEAltLocation> *GetCurrentLocations() const
OESystem::OEIterBase<const OEAltLocation> *GetCurrentLocations(const OEAltGroup &grp) const
OESystem::OEIterBase<const OEAltLocation> *GetCurrentLocations(int grpNum) const
Returns an iterator over currently selected OEAltLocations.
If no argument is supplied, every selected location is returned, otherwise only the
selected location(s) for the specified OEAltGroup is returned.
Unless SetAlt
has been called with multiLoc set to true, only a single
OEAltLocation will be returned per
OEAltGroup.
GetGroup¶
OEAltGroup GetGroup(const OEChem::OEAtomBase *selAtom) const
OEAltGroup GetGroup(const OEAltLocation &loc) const
If an OEAtomBase pointer is supplied, the method returns
the 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 OEAltGroup will be uninitialized and will return false
when operator bool is called.
If an OEAltLocation is supplied, the method returns the
OEAltGroup the location is associated with.
GetGroupCount¶
unsigned int GetGroupCount() const
Returns the total number of OEAltGroups identified by this
OEAltLocationFactory.
GetGroups¶
OESystem::OEIterBase<const OEAltGroup> *GetGroups() const
Returns an iterator over all OEAltGroups managed by this
OEAltLocationFactory.
GetLocation¶
OEAltLocation GetLocation(const OEChem::OEAtomBase *selAtom, char confCode,
bool caseSensitive=true) const
Returns the 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 OEAltLocation
will be uninitialized and will return false
when operator bool is called.
GetLocationCodes¶
std::string GetLocationCodes(const OEAltGroup &grp) const
std::string GetLocationCodes(const OEAltLocation &loc) const
Returns a string listing all the alternate location characters in the input OEAltGroup
or OEAltLocation.
Although most OEAltLocations will return a string containing
only a single character,
some that are more complicated will return a string with more than one character.
GetSourceMol¶
const OEChem::OEMolBase &GetSourceMol() const
Returns a constant reference to a copy of the OEMolBase supplied to the
Constructor.
GetState¶
OEAltLocationState GetState() const
void GetState(OEAltLocationState &state) const
Returns an OEAltLocationState that represents
the current selection state of this
OEAltLocationFactory.
See also
MakeAltMol¶
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)
Sets the selection state of this OEAltLocationFactory
and generates a new subset molecule (dst) for this state, returning a value indicating
whether the selection was valid.
Unless 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 GetLocation),
the selection state of only one group is set.
If an OEAltLocationState is supplied,
the selection state of all groups may be affected
(see 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 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
GetSourceMol, or 0 for atoms not included
in the generated molecule.
If an array of 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
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 OEMakeAltMolOption namespace.
MakeCurrentAltMol¶
void MakeCurrentAltMol(OEChem::OEMolBase &dst,
OEChem::OEAtomBase **atomMap=0, OEChem::OEBondBase **bondMap=0,
unsigned int options=OEBio::OEMakeAltMolOption::None) const
Generates a new subset molecule (dst) for the current selection state.
Unless SetAlt
has been called with multiLoc set to true,
the subset mol will represent a single conformation.
If an array of 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
GetSourceMol, or 0 for atoms not included
in the generated molecule.
If an array of 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
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 OEMakeAltMolOption namespace.
MakePrimaryAltMol¶
void MakePrimaryAltMol(OEChem::OEMolBase &dst,
OEChem::OEAtomBase **atomMap=0, OEChem::OEBondBase **bondMap=0,
unsigned int options=OEBio::OEMakeAltMolOption::None)
Resets the selection state of this OEAltLocationFactory
to the primary location (see SetPrimaryAlt)
and generates a new subset molecule (dst) for this state.
Unless SetAlt
has been called with multiLoc set to true,
the subset mol will represent a single conformation.
If an array of 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
GetSourceMol, or 0 for atoms not included
in the generated molecule.
If an array of 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
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 OEMakeAltMolOption namespace.
SetAlt¶
bool SetAlt(const OEAltLocation &loc, bool multiLoc=false)
bool SetAlt(const OEChem::OEAtomBase *selAtom, char confCode,
bool caseSensitive=true)
If an OEAltLocation is supplied,
the selection state of the 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 GetLocation.
Warning
If this method is called with the multiLoc parameter set to true, the
OEAltLocationFactory may be left in a state
where MakeCurrentAltMol
no longer generates a single-conformation molecule.
SetPrimaryAlt¶
void SetPrimaryAlt()
Resets the selection state of this OEAltLocationFactory
to the first location for each group – the location with the highest average occupancy.
SetState¶
bool SetState(const OEAltLocationState &state)
Resets the selection state of this OEAltLocationFactory
to that represented by the input OEAltLocationState,
with a return value indicating whether the state was valid.
See also