Public Member Functions | |
boost::optional < AtomStereopermutator > | makePermutator (AtomIndex candidateIndex, const StereopermutatorList &stereopermutators, const boost::optional< AngstromPositions > &maybePositions=boost::none, const boost::optional< SubstitutionsGenerator::SubstitutionMap > &maybeSubstitutions=boost::none) const |
boost::optional < BondStereopermutator > | makePermutator (const BondIndex &bond, const StereopermutatorList &stereopermutators, const boost::optional< AngstromPositions > &maybePositions=boost::none, const boost::optional< SubstitutionsGenerator::SubstitutionMap > &maybeSubstitutions=boost::none, BondStereopermutator::Alignment alignment=BondStereopermutator::Alignment::Eclipsed) const |
StereopermutatorList | detectStereopermutators_ () const |
Generates a list of stereopermutators based on graph properties alone. | |
void | ensureModelInvariants_ () const |
Ensures basic expectations about what constitutes a Molecule are met. | |
bool | isValidIndex_ (AtomIndex index) const |
Returns whether the specified index is valid or not. | |
void | propagateGraphChange_ () |
Updates the molecule's StereopermutatorList after a graph modification. | |
Constructors | |
Impl () noexcept | |
Default constructor. | |
Impl (Utils::ElementType element) noexcept | |
Mono-atomic constructor. | |
Impl (Utils::ElementType a, Utils::ElementType b, BondType bondType) noexcept | |
Diatomic constructor. | |
Impl (Graph graph) | |
Graph-only constructor. | |
Impl (Graph graph, const AngstromPositions &positions, const boost::optional< std::vector< BondIndex > > &bondStereopermutatorCandidatesOptional=boost::none, const boost::optional< PeriodicBoundaryDuplicates > &periodics=boost::none) | |
Graph and positions constructor. | |
Impl (Graph graph, StereopermutatorList stereopermutators, boost::optional< AtomEnvironmentComponents > canonicalComponentsOption) | |
Graph and stereopermutators constructor. | |
Modifiers | |
AtomIndex | addAtom (Utils::ElementType elementType, AtomIndex adjacentTo, BondType bondType) |
Adds an atom by attaching it to an existing atom. | |
BondIndex | addBond (AtomIndex a, AtomIndex b, BondType bondType) |
Adds a bond between existing atoms. | |
const BondStereopermutator & | addPermutator (const BondIndex &bond, BondStereopermutator::Alignment alignment) |
Add a new BondStereopermutator to the molecule. | |
void | applyPermutation (const std::vector< AtomIndex > &permutation) |
Applies an index permutation to all member state. | |
void | assignStereopermutator (AtomIndex a, const boost::optional< unsigned > &assignment) |
void | assignStereopermutator (const BondIndex &edge, const boost::optional< unsigned > &assignment) |
void | assignStereopermutatorRandomly (AtomIndex a, Random::Engine &engine) |
void | assignStereopermutatorRandomly (const BondIndex &e, Random::Engine &engine) |
std::vector< AtomIndex > | canonicalize (AtomEnvironmentComponents componentBitmask) |
Canonicalizes the graph, invalidating all atom and bond indices. More... | |
void | removeAtom (AtomIndex a) |
void | removeBond (AtomIndex a, AtomIndex b) |
bool | removePermutator (const BondIndex &bond) |
Removes the BondStereopermutator on a specified edge, if present. More... | |
bool | setBondType (AtomIndex a, AtomIndex b, BondType bondType) |
Changes an existing bond's type. | |
void | setElementType (AtomIndex a, Utils::ElementType elementType) |
Changes an existing atom's element type. | |
void | setShapeAtAtom (AtomIndex a, Shapes::Shape shape) |
void | thermalizeStereopermutator (AtomIndex a, bool thermalization) |
Alters thermalization state of an atom stereopermutator. | |
Information | |
boost::optional < AtomEnvironmentComponents > | canonicalComponents () const |
Yield which components were used in canonicalization. | |
boost::optional< Shapes::Shape > | inferShape (AtomIndex index, const RankingInformation &ranking) const |
std::string | dumpGraphviz () const |
Returns a graphivz string representation of the molecule. | |
const Graph & | graph () const |
Provides read-only access to the graph member. | |
std::size_t | hash () const |
Convolutional hash. | |
const StereopermutatorList & | stereopermutators () const |
Provides read-only access to the list of stereopermutators. | |
StereopermutatorList | inferStereopermutatorsFromPositions (const AngstromPositions &angstromWrapper, const boost::optional< std::vector< BondIndex > > &explicitBondStereopermutatorCandidatesOption=boost::none, boost::optional< const std::unordered_set< AtomIndex > & > uninteresting=boost::none, const boost::optional< SubstitutionsGenerator::SubstitutionMap > &substitutions=boost::none) const |
Yield which components were used in canonicalization. | |
bool | canonicalCompare (const Impl &other, AtomEnvironmentComponents componentBitmask) const |
Compares two canonical instances with one another. | |
boost::optional< std::vector < AtomIndex > > | modularIsomorphism (const Impl &other, AtomEnvironmentComponents componentBitmask) const |
Modular comparison of this Impl with another. | |
std::string | str () const |
Returns a command-line interface information string. | |
RankingInformation | rankPriority (AtomIndex a, const std::vector< AtomIndex > &excludeAdjacent={}, const boost::optional< AngstromPositions > &positionsOption=boost::none) const |
Yield which components were used in canonicalization. | |
Operators | |
bool | operator== (const Impl &other) const |
Equality operator, performs most strict equality comparison. | |
bool | operator!= (const Impl &other) const |
Negates. More... | |
Static Public Member Functions | |
static Utils::AtomCollection | applyCanonicalizationMap (const std::vector< AtomIndex > &canonicalizationIndexMap, const Utils::AtomCollection &atomCollection) |
static bool | isGraphBasedBondStereopermutatorCandidate_ (BondType bondType) |
Returns whether an edge is double, triple or higher bond order. | |
Data Fields | |
Data | |
Graph | adjacencies_ |
StereopermutatorList | stereopermutators_ |
boost::optional < AtomEnvironmentComponents > | canonicalComponentsOption_ |
void Scine::Molassembler::Molecule::Impl::assignStereopermutator | ( | AtomIndex | a, |
const boost::optional< unsigned > & | assignment | ||
) |
Sets the stereopermutator assignment at a particular atom
This sets the stereopermutator assignment at a specific atom index. For this, a stereopermutator must be instantiated and contained in the StereopermutatorList returned by stereopermutators(). The supplied assignment must be either boost::none or smaller than stereopermutatorPtr->numAssignments().
void Scine::Molassembler::Molecule::Impl::assignStereopermutator | ( | const BondIndex & | edge, |
const boost::optional< unsigned > & | assignment | ||
) |
Sets the stereopermutator assignment on a bond
This sets the stereopermutator assignment at a specific bond index. For this, a stereopermutator must be instantiated and contained in the StereopermutatorList returned by stereopermutators(). The supplied assignment must be either boost::none or smaller than stereopermutatorPtr->numAssignments().
void Scine::Molassembler::Molecule::Impl::assignStereopermutatorRandomly | ( | AtomIndex | a, |
Random::Engine & | engine | ||
) |
Assigns a stereopermutator stereopermutation at random
This sets the stereocetner assignment at a specific index, taking relative statistical occurence weights of each stereopermutation into account.
If | no AtomStereopermutator exists at the passed index |
void Scine::Molassembler::Molecule::Impl::assignStereopermutatorRandomly | ( | const BondIndex & | e, |
Random::Engine & | engine | ||
) |
Assigns a bond stereopermutator to a random assignment
If | no BondStereopermutator exists at the passed edge |
std::vector<AtomIndex> Scine::Molassembler::Molecule::Impl::canonicalize | ( | AtomEnvironmentComponents | componentBitmask | ) |
Canonicalizes the graph, invalidating all atom and bond indices.
componentBitmask | The components of the molecular graph to include in the canonicalization procedure. |
components
bitmask. If you choose a stricter bitmask than you have used in the canonicalization procedure, you risk false positives and false negatives.boost::optional<Shapes::Shape> Scine::Molassembler::Molecule::Impl::inferShape | ( | AtomIndex | index, |
const RankingInformation & | ranking | ||
) | const |
Determines what the local geometry at a non-terminal atom ought to be
Returns the expected shape name at a non-terminal atom.
if | the supplied atomic index is invalid |
bool Scine::Molassembler::Molecule::Impl::operator!= | ( | const Impl & | other | ) | const |
Negates.
void Scine::Molassembler::Molecule::Impl::removeAtom | ( | AtomIndex | a | ) |
Removes an atom from the graph, including bonds to it.
Removes an atom from the molecular graph, including bonds to the atom, after checking that removing it is safe, i.e. the removal does not disconnect the graph.
if | the supplied index is invalid or isSafeToRemoveAtom returns false. |
Removes an atom after checking if removing that bond is safe, i.e. does not disconnect the graph. An example of bonds that can always be removed are ring-closing bonds, since they never disconnect the molecular graph.
if | isSafeToRemoveBond returns false. |
bool Scine::Molassembler::Molecule::Impl::removePermutator | ( | const BondIndex & | bond | ) |
Removes the BondStereopermutator on a specified edge, if present.
void Scine::Molassembler::Molecule::Impl::setShapeAtAtom | ( | AtomIndex | a, |
Shapes::Shape | shape | ||
) |
Sets the local geometry at an atom index
This sets the local geometry at a specific atom index. There are a number of cases that this function treats differently, besides faulty arguments: If there is already a AtomStereopermutator instantiated at this atom index, its underlying shape is altered. If there is no AtomStereopermutator at this index, one is instantiated. In all cases, new or modified stereopermutators are default-assigned if there is only one possible assignment.
if |
|