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
Modifier and TypeFieldDescriptionstatic final String
Default salt dictionary file path.static final String
Property key for "Don't Remove Last Component" optionstatic final String
Property key for salt IDstatic final String
Property key for salt list modificationstatic final String
Property key for use default salts modificationFields inherited from class chemaxon.standardizer.AbstractStandardizerAction
CONFIG_PATH_KEY, FORMAT_KEY, ID_KEY, support
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds 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 indexint
Gets the count of the salts of the actiongetSaltID
(int index) Gets the salt ID at the provided indexGets the custom salt list of the actionboolean
boolean
Gets whether default salt dictionary should be usedReads the default salt dictionary.void
Removes all salts from the salt list of the action.void
removeSalt
(int index) Removes a salt from the salt list of the actionvoid
removeSalts
(int... indexes) Removes a salt from the salt list of the actionvoid
setDontRemoveLastComponent
(boolean dontRemoveLastComponent) void
setMolecule
(int index, Molecule molecule) Sets the molecule of the salt at the provided indexvoid
Sets the name of the salt at the provided indexvoid
setUseDefaultSalts
(boolean useDefaultSalts) Sets whether default salt dictionary should be usedprotected Changes
standardize1
(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:AbstractStandardizerAction
This 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:
standardize1
in classAbstractStandardizerAction
- Parameters:
molecule
- theMolecule
instance 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:
clone
in classAbstractStandardizerAction
- Throws:
CloneNotSupportedException
-
toString
- Overrides:
toString
in classAbstractStandardizerAction
-
getComponents
Description copied from class:AbstractStandardizerAction
A 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:
getComponents
in classAbstractStandardizerAction
- Parameters:
molecule
- the target molecule- Returns:
- the resulted list of components
-