Package chemaxon.standardizer
Class Changes
java.lang.Object
chemaxon.standardizer.Changes
The change set of the standardization procedure.
Contains a clone of the original molecule, the result molecule and a map of
atoms and atom-indexes for each atom of the input molecule. All modifications
(added removed and modified) made by the standardization process atoms should
be stored here.
The mapping of the indexes can be gathered using the methods
newToOld()
and oldToNew()
Getting the mapping based on a list of sequential changes on a molecule can
be gathered using the methods newToOld(List, Molecule)
and
newToOld(List, Molecule)
To merge more than one Changes
object is possible using
append(Changes)
method.
- Since:
- 5.11
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllAtoms
(Collection<MolAtom> atoms) Adds atoms to the "added atom" list.void
addAllAtoms
(Collection<MolAtom> atoms, boolean cleanRelevant) Adds atoms to the "added atom" list.void
Adds an atom to the "added atom" list.void
Adds an atom to the "added atom" list.void
Appends a set of changes to the already existing changes.Gets the baseStandardizerAction
of the changesGets the list of atoms added during the standardization procedureGets the list of atoms changed during the standardization procedure, and needs to be cleanedGets the list of modified atoms during the standardization procedureGets the original molecule of the standardization process.Gets the list of atoms removed during the standardization procedureGets the result molecule of the standardization processboolean
Gets whether any modifications were applied on the molecule.void
modifyAllAtoms
(Collection<MolAtom> atoms) Adds atoms to the "modified atom" list.void
modifyAllAtoms
(Collection<MolAtom> atoms, boolean cleanRelevant) Adds atoms to the "modified atom" list.void
modifyAtom
(MolAtom atom) Adds an atom to the "modified atom" list.void
modifyAtom
(MolAtom atom, boolean cleanRelevant) Adds an atom to the "modified atom" list.int[]
newToOld()
Returns the new -> old atom index mapping.
newToOld[i]==j means that the i-th atom of the new molecule corresponds to the j-th atom of the old molecule.static int[]
Calculates the new -> old atom index mapping based on a list of changes.
newToOld[i]==j means that the i-th atom of the new molecule corresponds to the j-th atom of the old molecule.int[]
oldToNew()
Returns the old -> new atom index mapping.
oldToNew[i]==j means that the i-th atom of the old molecule corresponds to the j-th atom of the new molecule.static int[]
Calculates the old -> new atom index mapping based on a list of changes.
oldToNew[i]==j means that the i-th atom of the old molecule corresponds to the j-th atom of the new molecule.void
removeAllAtoms
(Collection<MolAtom> atoms) Adds atoms to the "removed atom" listvoid
removeAllAtoms
(Collection<MolAtom> atoms, boolean cleanRelevant) Adds atoms to the "removed atom" listvoid
removeAtom
(MolAtom atom) Adds an atom to the "removed atom" list.void
removeAtom
(MolAtom atom, boolean cleanRelevant) Adds an atom to the "removed atom" list.void
setAction
(StandardizerAction action) Sets the baseStandardizerAction
of the changesvoid
setModified
(boolean modified) Sets whether any modifications were applied on the molecule.toString()
-
Constructor Details
-
Changes
Initializes the changes object. Default index mapping is based on the original molecule. A clone of the original molecule is created and stored to represent the molecule in the state before standardization process.- Parameters:
original
- the original molecule
-
Changes
Initializes the changes object. Default index mapping is based on the original molecule. The clone of the original molecule is stored to represent the molecule in the state before standardization process.- Parameters:
original
- the original moleculeresult
- the result molecule to be standardized. should be different of the original molecule
-
Changes
Initializes the changes object. Default index mapping is based on the original molecule. A clone of the original molecule is created and stored to represent the molecule in the state before standardization process.- Parameters:
molecule
- the original moleculeaction
- the action generating the changes
-
-
Method Details
-
getOriginal
Gets the original molecule of the standardization process. (It is a clone of the original molecule in the state before the standardization)- Returns:
- the clone of the original molecule in the state before the standardization process
-
getResult
Gets the result molecule of the standardization process- Returns:
- the result molecule of the standardization process
-
getAddedAtoms
Gets the list of atoms added during the standardization procedure- Returns:
- the list of atoms added during the standardization procedure. This list should be not modified, as it affects the changes object!
-
getRemovedAtoms
Gets the list of atoms removed during the standardization procedure- Returns:
- the list of atoms removed during the standardization procedure. This list should be not modified, as it affects the changes object!
-
getModifiedAtoms
Gets the list of modified atoms during the standardization procedure- Returns:
- the list of modified atoms during the standardization procedure. This list should be not modified, as it affects the changes object!
-
getCleanRelevantAtoms
Gets the list of atoms changed during the standardization procedure, and needs to be cleaned- Returns:
- the list of atoms changed during the standardization procedure. This list should be not modified, as it affects the changes object!
-
addAtom
Adds an atom to the "added atom" list.- Parameters:
atom
- an atom to be added to the "added atom" list.
-
addAtom
Adds an atom to the "added atom" list.- Parameters:
atom
- an atom to be added to the "added atom" list.cleanRelevant
- whether the atom is relevant for cleaning the output molecule
-
removeAtom
Adds an atom to the "removed atom" list.- Parameters:
atom
- an atom to be added to the "removed atom" list.
-
removeAtom
Adds an atom to the "removed atom" list.- Parameters:
atom
- an atom to be added to the "removed atom" list.cleanRelevant
- whether the atom is relevant for cleaning the output molecule
-
modifyAtom
Adds an atom to the "modified atom" list.- Parameters:
atom
- an atom to be added to the "modified atom" list.
-
modifyAtom
Adds an atom to the "modified atom" list.- Parameters:
atom
- an atom to be added to the "modified atom" list.cleanRelevant
- whether the atom is relevant for cleaning the output molecule
-
addAllAtoms
Adds atoms to the "added atom" list.- Parameters:
atoms
- atoms to be added to the "added atom" list.
-
addAllAtoms
Adds atoms to the "added atom" list.- Parameters:
atoms
- atoms to be added to the "added atom" list.cleanRelevant
- whether the atoms are relevant for cleaning the output molecule
-
removeAllAtoms
Adds atoms to the "removed atom" list- Parameters:
atoms
- atoms to be added to the "removed atom" list
-
removeAllAtoms
Adds atoms to the "removed atom" list- Parameters:
atoms
- atoms to be added to the "removed atom" listcleanRelevant
- whether the atoms are relevant for cleaning the output molecule
-
modifyAllAtoms
Adds atoms to the "modified atom" list.- Parameters:
atoms
- atoms to be added to the "modified atom" list.
-
modifyAllAtoms
Adds atoms to the "modified atom" list.- Parameters:
atoms
- atoms to be added to the "modified atom" list.cleanRelevant
- whether the atoms are relevant for cleaning the output molecule
-
setModified
public void setModified(boolean modified) Sets whether any modifications were applied on the molecule.- Parameters:
modified
- whether any modifications were applied on the molecule.
-
isModified
public boolean isModified()Gets whether any modifications were applied on the molecule.- Returns:
- whether any modifications were applied on the molecule.
-
oldToNew
public int[] oldToNew()Returns the old -> new atom index mapping.
oldToNew[i]==j means that the i-th atom of the old molecule corresponds to the j-th atom of the new molecule.- Returns:
- the old -> new atom index mapping
-
newToOld
public int[] newToOld()Returns the new -> old atom index mapping.
newToOld[i]==j means that the i-th atom of the new molecule corresponds to the j-th atom of the old molecule.- Returns:
- the new -> old atom index mapping
-
oldToNew
Calculates the old -> new atom index mapping based on a list of changes.
oldToNew[i]==j means that the i-th atom of the old molecule corresponds to the j-th atom of the new molecule.- Parameters:
changeList
- the target list of changestarget
- the target molecule (needed in case of no changes)- Returns:
- the old -> new atom index mapping based on a list of changes
-
newToOld
Calculates the new -> old atom index mapping based on a list of changes.
newToOld[i]==j means that the i-th atom of the new molecule corresponds to the j-th atom of the old molecule.- Parameters:
changeList
- the target list of changestarget
- the target molecule (needed in case of no changes)- Returns:
- the new -> old atom index mapping based on a list of changes
-
toString
-
append
Appends a set of changes to the already existing changes. Added / Removed / Modified molecules contained by the parameter are added to this object.- Parameters:
changes
- the set of changes to be appended
-
getAction
Gets the baseStandardizerAction
of the changes- Returns:
- the base
StandardizerAction
of the changes
-
setAction
Sets the baseStandardizerAction
of the changes- Parameters:
action
- the baseStandardizerAction
of the changes
-