Package chemaxon.marvin.calculations
Class StructuralFrameworksPlugin
java.lang.Object
chemaxon.marvin.plugin.CalculatorPlugin
chemaxon.marvin.calculations.StructuralFrameworksPlugin
- All Implemented Interfaces:
TaggedCalculator,chemaxon.license.Licensable
Plugin class to calculate Bemis-Murcko and other structural scaffolds of input
molecules.
The plugin inside executes a series of atomic (not in chemical sense) operations
which are accessible to the user. The configuration which is set either by
setParameters(Properties) or by the individual setters. The operation
chain is set up according to the actual configuration by getHost(boolean).
API usage example:
try (MolImporter mi = new MolImporter("test.mol")) {
// read input molecule
Molecule mol = mi.read();
// create plugin
StructuralFrameworksPlugin plugin = new StructuralFrameworksPlugin();
// set framework type
plugin.setType(StructuralFrameworksPlugin.FrameworkTypes.bemismurcko);
// process only the largest fragment
plugin.setLfin(true);
// set target molecule
plugin.setMolecule(mol);
// run the calculation
plugin.run();
// get result
Molecule result = plugin.getResultMolecule();
// print result
System.out.println("Bemis-Murcko framework in SMILES format: " + MolExporter.toFormat(result, "smiles"));
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumFrameworkTypes represents the available calculationsstatic interfaceVerbose printer specificationNested classes/interfaces inherited from class chemaxon.marvin.plugin.CalculatorPlugin
CalculatorPlugin.HydrogenData -
Field Summary
Fields inherited from class chemaxon.marvin.plugin.CalculatorPlugin
ATOM, BLUE, CALCRGB_OFF, COVALENT_HYDRATION_ERROR_REMARK, CRITICAL_ERROR_MSG, EPSILON, explicitHydrogens, INCORRECT_AROMATIC_NITROGEN_REMARK, INSTABLE_TAUTOMERIC_FORM_REMARK, KEEP_HYDROGENS, keepHydrogens, licenseEnvironment, MOLECULE, MOLECULES, NAN, PLUGIN_CLASS_KEY, PLUGIN_DIR, RED, TRUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif repeatedly running the same plugin object while getting the results on the GUI is allowed,falseotherwise.voidcheckMolecule(Molecule mol) Checks the input molecule.Returns the product identifier of the plugin as given byLicenseManager.Returns the result item for the specified type and index.getResultAsString(Object type, int index, Object result) Get a calculation result (returned bygetResultMolecule()after arun()call in the given formatsetFormat(String)intReturns the number of result items for the first result type.intgetResultDomain(Object type) Returns the calculation domainCalculatorPlugin.ATOM,CalculatorPlugin.MOLECULEorCalculatorPlugin.MOLECULES.Get result structureObject[]Returns the result types.getTypeString(Object type) Returns a string representation of the given type.booleanThis plugin handles multifrag molecules.booleanrun()Run calculationvoidsetDehydrogenize(boolean b) Set dehydrogenize parametervoidSet output format used byCalculatorPlugin.getResultAsString(int, Object)voidsetHydrogenize(boolean b) Set hydrogenize parameterprotected voidsetInputMolecule(Molecule mol) Set input molecule to processvoidsetKeepSingleAtom(boolean b) Set behavior on acyclic inputvoidsetLfin(boolean b) Set handling option for multi fragment (disconnected) inputsvoidsetLfout(boolean b) Set handling option for multi fragment (disconnected) results.voidsetOeqcheck(boolean b) Set oeqcheck parametervoidsetParameters(Properties params) Sets the input parameters for the plugin Accepted parameters: type: [bmf|mcs|sssr|cssr|allringsystems|largestringsystem| largestring|keep] Framework calculation type bmf: Bemis-Murcko framework bmfl: Bemis-Murcko loose framework mcs: Pairwise Maximum Common Substructure sssr: SSSR cssr: CSSR allringsystems: all fused ring systems largestringsystem: largest fused ring system largestring: largest ring keep: no framework reduction; useful for testing pre/post process keepsingleatom: [true|false] If set true then a single atom will be assigned to acyclic fragments.voidsetPruneIn(boolean b) Set prunein parametervoidsetPruneOut(boolean b) Set pruneout parametervoidSet framework type to calculate.voidstandardize(Molecule mol) Standardize input molecule
Standardization currently ungroups SGroupsMethods inherited from class chemaxon.marvin.plugin.CalculatorPlugin
addHeavyAtomLimitChecker, addInputChecker, arrangeHydrogenIncerments, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, getAtomIndexMapping, getCalcMolecule, getDisplayMolecule, getDocument, getDoublePrecision, getErrorMessage, getExplicitHydrogenData, getInputMolDim, getMainMolecule, getOriginalMolecule, getpH, getPluginResource, getQueryMoleculeErrorMessage, getRemark, getResult, getResult, getResult, getResultAsRGB, getResultAsRGB, getResultAsString, getResultCount, getResultDomain, getResultMessage, getResultMolecules, getResultsAsRGB, getResultsAsRGB, getResultsAsString, getResultsAsString, getResultSource, getWarningMessage, isInputMoleculeAromatized, isLicensed, isMsCalc, isMultiThreadedRunEnabled, isNegligibleResult, isOK, isRgrouped, loadClass, loadPluginClass, loadPluginClass, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setChemicalTermsArgument, setChemicalTermsParameters, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroupsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface chemaxon.calculator.TaggedCalculator
tags
-
Constructor Details
-
StructuralFrameworksPlugin
public StructuralFrameworksPlugin()
-
-
Method Details
-
checkMolecule
Checks the input molecule. Throws exception if the molecule is not accepted as input molecule, otherwise does nothing (simply returns). In addition to the default implementation (which refuses query molecules, molecules with SRU S-groups, molecules with multicenter S-groups and molecules with coordinate bonds) this method will check if Frameworks can be executed on the structure.Currently the following cases (in addition to the default behavior) fail:
- mcs Framework calculation needs at least two disconnected fragments. If the molecule contains no atoms or consists of one connected fragment exception is thrown.
- Overrides:
checkMoleculein classCalculatorPlugin- Parameters:
mol- is the input molecule- Throws:
PluginException- with error message for the user if the molecule is refused
-
setInputMolecule
Set input molecule to process- Specified by:
setInputMoleculein classCalculatorPlugin- Parameters:
mol- Input molecule- Throws:
PluginException
-
canRepeat
public boolean canRepeat()Description copied from class:CalculatorPluginReturnstrueif repeatedly running the same plugin object while getting the results on the GUI is allowed,falseotherwise. For internal use.- Overrides:
canRepeatin classCalculatorPlugin- Returns:
trueif allowed,falseotherwise
-
standardize
Standardize input molecule
Standardization currently ungroups SGroups- Overrides:
standardizein classCalculatorPlugin- Parameters:
mol- Input molecule to standardize
-
run
Run calculation- Specified by:
runin classCalculatorPlugin- Returns:
- true if success
- Throws:
PluginException- See Also:
-
getResultMolecule
Get result structure- Overrides:
getResultMoleculein classCalculatorPlugin- Returns:
- The calculated framework
- Throws:
PluginException
-
handlesMultiFragmentMolecules
public boolean handlesMultiFragmentMolecules()This plugin handles multifrag molecules.- Overrides:
handlesMultiFragmentMoleculesin classCalculatorPlugin- Returns:
- true
-
setKeepSingleAtom
public void setKeepSingleAtom(boolean b) Set behavior on acyclic input- Parameters:
b- If set true then a single atom will be assigned to acyclic fragments. If false then acyclic fragments will be projected to empty structures
-
setFormat
Set output format used byCalculatorPlugin.getResultAsString(int, Object)- Parameters:
f- Output format to use
-
setLfin
public void setLfin(boolean b) Set handling option for multi fragment (disconnected) inputs- Parameters:
b- If set true then the calculation will run only on the largest input fragment. Note that this necessarily yields the largest scaffold
-
setLfout
public void setLfout(boolean b) Set handling option for multi fragment (disconnected) results. Note that disconnected result can be caused by disconnected input or by further modifications of the scaffold generation algorithm- Parameters:
b- If set true then only the largest calculated scaffold will be returned. Note that the returned scaffold not necessarily calculated from the largest fragment.
-
setType
Set framework type to calculate.Note that default framework type is Bemis-Murcko
- Parameters:
ft- Framework to calculate
-
setPruneIn
public void setPruneIn(boolean b) Set prunein parameter- Parameters:
b- If true then input will be generalizes
-
setPruneOut
public void setPruneOut(boolean b) Set pruneout parameter- Parameters:
b- If true then result will be generalized
-
setHydrogenize
public void setHydrogenize(boolean b) Set hydrogenize parameter- Parameters:
b- If true then input will be hydrogenized
-
setDehydrogenize
public void setDehydrogenize(boolean b) Set dehydrogenize parameter- Parameters:
b- If true then explicit hydrogens will be removed from the input
-
setOeqcheck
public void setOeqcheck(boolean b) Set oeqcheck parameter- Parameters:
b- If true then eqivalent result fragments will be filtered
-
setParameters
Sets the input parameters for the plugin Accepted parameters:- type: [bmf|mcs|sssr|cssr|allringsystems|largestringsystem|
largestring|keep] Framework calculation type
- bmf: Bemis-Murcko framework
- bmfl: Bemis-Murcko loose framework
- mcs: Pairwise Maximum Common Substructure
- sssr: SSSR
- cssr: CSSR
- allringsystems: all fused ring systems
- largestringsystem: largest fused ring system
- largestring: largest ring
- keep: no framework reduction; useful for testing pre/post process
- keepsingleatom: [true|false] If set true then a single atom will be assigned to acyclic fragments. If false then acyclic fragments will be projected to empty structures
- lfin: [true|false] If set true then the calculation will run only on the largest input fragment. Note that this necessarily yields the largest scaffold
- lfout: [true|false] If set true then only the largest calculated scaffold will be returned. Note that the returned scaffold not necessarily calculated from the largest fragment.
- prunein: [true|false] Generalize input
- pruneout: [true|false] Generalize output
- hydrogenize: [true|false] Add explicit hydrogens
- dehydrogenize: [true|false] Remove explicit hydrogens
- oeqcheck: [true|false] Remove equivalent output fragments
- format: format to use for string export
- Overrides:
setParametersin classCalculatorPlugin- Parameters:
params- parameter table- Throws:
PluginException
- type: [bmf|mcs|sssr|cssr|allringsystems|largestringsystem|
largestring|keep] Framework calculation type
-
getProductName
Description copied from class:CalculatorPluginReturns the product identifier of the plugin as given byLicenseManager. The name is used by theCalculatorPlugin.isLicensed()method.- Specified by:
getProductNamein classCalculatorPlugin- Returns:
- product identifier or a default string
-
getResultDomain
Description copied from class:CalculatorPluginReturns the calculation domainCalculatorPlugin.ATOM,CalculatorPlugin.MOLECULEorCalculatorPlugin.MOLECULES. The default implementation returnsCalculatorPlugin.MOLECULE.- Overrides:
getResultDomainin classCalculatorPlugin- Parameters:
type- is the result type- Returns:
- the calculation domain
- See Also:
-
getResultTypes
Description copied from class:CalculatorPluginReturns the result types. The default implementation returnsnull.- Overrides:
getResultTypesin classCalculatorPlugin- Returns:
- the result types
-
getResultCount
public int getResultCount()Description copied from class:CalculatorPluginReturns the number of result items for the first result type.- Overrides:
getResultCountin classCalculatorPlugin- Returns:
- the number of result items
- See Also:
-
getResult
- Throws:
PluginException
-
getResult
Description copied from class:CalculatorPluginReturns the result item for the specified type and index. The default implementation returnsnull.- Overrides:
getResultin classCalculatorPlugin- Parameters:
type- is the result typeindex- is the result index- Returns:
- the result item for the specified type and index
- Throws:
PluginException- if the result cannot be returned- See Also:
-
getResultAsString
Get a calculation result (returned bygetResultMolecule()after arun()call in the given formatsetFormat(String)- Overrides:
getResultAsStringin classCalculatorPlugin- Parameters:
type- this parameter is ignoredindex- this patameter is ignoredresult- result given bygetResultMolecule()- Returns:
- String representatin in the given format
- Throws:
PluginException
-
getTypeString
Returns a string representation of the given type.- Overrides:
getTypeStringin classCalculatorPlugin- Parameters:
type- is the type object- Returns:
- the type string
-