Class StripSaltsAction
java.lang.Object
chemaxon.standardizer.AbstractStandardizerAction
chemaxon.standardizer.advancedactions.StripSaltsAction
- All Implemented Interfaces:
chemaxon.license.Licensable,StandardizerAction,PropertyChangeListener,Cloneable,EventListener
Strip salts standardizer action
Additional salts can be added in action string.
Example configuration: "stripsalts:na='[Na+]':soo='[#8]S([#8])(=O)=O'"
- Since:
- 6.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault salt dictionary file path.static final StringProperty key for "Don't Remove Last Component" optionstatic final StringProperty key for salt IDstatic final StringProperty key for salt list modificationstatic final StringProperty key for use default salts modificationFields inherited from class chemaxon.standardizer.AbstractStandardizerAction
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a salt to the salt list of the actionclone()getComponents(Molecule molecule) A recursive algorithm getting all components (reactants, agents and products of reaction molecules, R-group definitions of Rg-Molecules) of the molecule.getMolecule(int index) Gets the molecule at the provided indexintGets the count of the salts of the actiongetSaltID(int index) Gets the salt ID at the provided indexGets the custom salt list of the actionbooleanbooleanGets whether default salt dictionary should be usedReads the default salt dictionary.voidRemoves all salts from the salt list of the action.voidremoveSalt(int index) Removes a salt from the salt list of the actionvoidremoveSalts(int... indexes) Removes a salt from the salt list of the actionvoidsetDontRemoveLastComponent(boolean dontRemoveLastComponent) voidsetMolecule(int index, Molecule molecule) Sets the molecule of the salt at the provided indexvoidSets the name of the salt at the provided indexvoidsetUseDefaultSalts(boolean useDefaultSalts) Sets whether default salt dictionary should be usedprotected Changesstandardize1(Molecule molecule) This method contains the current standardization mechanism.toString()Methods inherited from class chemaxon.standardizer.AbstractStandardizerAction
addPropertyChangeListener, addPropertyChangeListener, anyBooleanPropertyTrue, cloneItem, getDescriptor, getID, isActive, isAvailable, isLicensed, isValid, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setActive, setID, setLicenseEnvironment, setValid, standardize
-
Field Details
-
SALT_LIST_KEY
Property key for salt list modification- See Also:
-
USE_DEFAULT_SALTS_KEY
Property key for use default salts modification- See Also:
-
DONT_REMOVE_LAST_COMPONENT_KEY
Property key for "Don't Remove Last Component" option- See Also:
-
DEFAULT_SALT_DICTIONARY_PATH
Default salt dictionary file path.- See Also:
-
SALT_ID_PROPERTY
Property key for salt ID- See Also:
-
-
Constructor Details
-
StripSaltsAction
Initializes strip salts action- Parameters:
params- the parameters of the action
-
-
Method Details
-
isUseDefaultSalts
public boolean isUseDefaultSalts()Gets whether default salt dictionary should be used- Returns:
- whether default salt dictionary should be used
-
setUseDefaultSalts
public void setUseDefaultSalts(boolean useDefaultSalts) Sets whether default salt dictionary should be used- Parameters:
useDefaultSalts- whether default salt dictionary should be used
-
addSalt
Adds a salt to the salt list of the action- Parameters:
saltID- saltID of the saltmolecule- the molecule of the salt
-
setSaltID
Sets the name of the salt at the provided index- Parameters:
index- the target indexsaltID- the saltID to be set
-
isDontRemoveLastComponent
public boolean isDontRemoveLastComponent() -
setDontRemoveLastComponent
public void setDontRemoveLastComponent(boolean dontRemoveLastComponent) -
setMolecule
Sets the molecule of the salt at the provided index- Parameters:
index- the target indexmolecule- the molecule to be set
-
getSaltCount
public int getSaltCount()Gets the count of the salts of the action- Returns:
- the count of the salts of the action
-
getMolecule
Gets the molecule at the provided index- Parameters:
index- the required index- Returns:
- the molecule at the provided index
-
getSaltID
Gets the salt ID at the provided index- Parameters:
index- the required index- Returns:
- the salt ID at the provided index
-
removeSalt
public void removeSalt(int index) Removes a salt from the salt list of the action- Parameters:
index- index of the salt to be removed
-
removeSalts
public void removeSalts(int... indexes) Removes a salt from the salt list of the action- Parameters:
indexes- indexes of the salts to be removed
-
removeAllSalts
public void removeAllSalts()Removes all salts from the salt list of the action. -
standardize1
Description copied from class:AbstractStandardizerActionThis method contains the current standardization mechanism. Descendants needs to implement this method.
Special molecules containing more components (e.g.RgMolecule,RxnMolecule) are decomponented by the methodAbstractStandardizerAction.getComponents(Molecule), andAbstractStandardizerAction.standardize1(Molecule)method is called on each component, before applied on the original molecule. If a descendant does not want this to occur, this method must be overridden.
Logs of standardization should be generated to aLogger, that can be collected by usingStandardizerLogger.getLogger()method.- Specified by:
standardize1in classAbstractStandardizerAction- Parameters:
molecule- theMoleculeinstance to be standardized- Returns:
- the changes applied on the molecule during the standardization process
- Throws:
IllegalArgumentException- if the provided molecule or the provided parameters of the action are invalid
-
readSaltDictionary
Reads the default salt dictionary. The name of the salt will be the name of the molecule- Returns:
- the default salt dictionary
-
getSaltList
Gets the custom salt list of the action- Returns:
- the custom salt list of the action
-
clone
- Overrides:
clonein classAbstractStandardizerAction- Throws:
CloneNotSupportedException
-
toString
- Overrides:
toStringin classAbstractStandardizerAction
-
getComponents
Description copied from class:AbstractStandardizerActionA recursive algorithm getting all components (reactants, agents and products of reaction molecules, R-group definitions of Rg-Molecules) of the molecule. Used to collect all. If components must not be standardized, this method should be overridden.- Overrides:
getComponentsin classAbstractStandardizerAction- Parameters:
molecule- the target molecule- Returns:
- the resulted list of components
-