public class StructuralFrameworksPlugin extends CalculatorPlugin
setParameters( Properties )
or by the individual setters. The operation
chain is set up according to the actual configuration by getHost( boolean )
.
API usage example:
// read input molecule MolImporter mi = new MolImporter("test.mol"); Molecule mol = mi.read(); mi.close(); // 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: "+result.toFormat("smiles") );
Modifier and Type | Class and Description |
---|---|
static class |
StructuralFrameworksPlugin.FrameworkTypes
FrameworkTypes represents the available calculations
|
static interface |
StructuralFrameworksPlugin.VerbosePrinter
Verbose printer specification
|
CalculatorPlugin.HydrogenData
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 and Description |
---|
StructuralFrameworksPlugin() |
Modifier and Type | Method and Description |
---|---|
boolean |
canRepeat()
Returns
true if repeatedly running the same plugin object
while getting the results on the GUI is allowed, false otherwise. |
void |
checkMolecule(Molecule mol)
Checks the input molecule.
|
String |
getProductName()
Returns the product identifier of the plugin as given by
LicenseManager . |
Molecule |
getResult() |
Object |
getResult(Object type,
int index)
Returns the result item for the specified type and index.
|
String |
getResultAsString(Object type,
int index,
Object result)
Get a calculation result (returned by
getResultMolecule() after a
run() call in the given format setFormat(String) |
int |
getResultCount()
Returns the number of result items for the first result type.
|
int |
getResultDomain(Object type)
Returns the calculation domain
CalculatorPlugin.ATOM , CalculatorPlugin.MOLECULE or CalculatorPlugin.MOLECULES . |
Molecule |
getResultMolecule()
Get result structure
|
Object[] |
getResultTypes()
Returns the result types.
|
String |
getTypeString(Object type)
Returns a string representation of the given type.
|
boolean |
handlesMultiFragmentMolecules()
This plugin handles multifrag molecules.
|
boolean |
run()
Run calculation
|
void |
setDehydrogenize(boolean b)
Set dehydrogenize parameter
|
void |
setFormat(String f)
Set output format used by
CalculatorPlugin.getResultAsString(int, Object) |
void |
setHydrogenize(boolean b)
Set hydrogenize parameter
|
protected void |
setInputMolecule(Molecule mol)
Set input molecule to process
|
void |
setKeepSingleAtom(boolean b)
Set behavior on acyclic input
|
void |
setLfin(boolean b)
Set handling option for multi fragment (disconnected) inputs
|
void |
setLfout(boolean b)
Set handling option for multi fragment (disconnected) results.
|
void |
setOeqcheck(boolean b)
Set oeqcheck parameter
|
void |
setParameters(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.
|
void |
setPruneIn(boolean b)
Set prunein parameter
|
void |
setPruneOut(boolean b)
Set pruneout parameter
|
void |
setType(StructuralFrameworksPlugin.FrameworkTypes ft)
Set framework type to calculate.
|
void |
setVerbosePrinter(StructuralFrameworksPlugin.VerbosePrinter verb)
Set or clear verbose printer
Verbose messages will be sent to the verbose printer to ease debugging
|
void |
standardize(Molecule mol)
Standardize input molecule
Standardization currently ungroups SGroups |
arrangeHydrogenIncerments, checkLicense, checkType, containsCoordinateBond, containsMulticenterSgroup, containsPseudoAtom, containsSRUSgroup, create, createModifiedInputMolecule, createStandardizedMolecule, createStandardizedMolecule, dehydrogenize, format, format, format, format, getAtomCount, getAtomIndex, getAtomIndexMap, 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, readAttribute, removeWhitespace, restoreExplicitHydrogens, setAtomIndexMap, setDoublePrecision, setDoublePrecision, setDoublePrecision, setKeepHydrogens, setLicenseEnvironment, setMolecule, setMolecule, setMolecule, setMolecule, setProgressMonitor, standardizeIonicGroups, standardizeNeutralGroups
public void setVerbosePrinter(StructuralFrameworksPlugin.VerbosePrinter verb)
verb
- Verbose printer. Use null to clear verbose.public void checkMolecule(Molecule mol) throws PluginException
Currently the following cases (in addition to the default behavior) fail:
checkMolecule
in class CalculatorPlugin
mol
- is the input moleculePluginException
- with error message for the user if the molecule is refusedprotected void setInputMolecule(Molecule mol) throws PluginException
setInputMolecule
in class CalculatorPlugin
mol
- Input moleculePluginException
public boolean canRepeat()
CalculatorPlugin
true
if repeatedly running the same plugin object
while getting the results on the GUI is allowed, false
otherwise.
For internal use.canRepeat
in class CalculatorPlugin
true
if allowed, false
otherwisepublic void standardize(Molecule mol)
standardize
in class CalculatorPlugin
mol
- Input molecule to standardizepublic boolean run() throws PluginException
run
in class CalculatorPlugin
PluginException
CalculatorPlugin.getErrorMessage()
public Molecule getResultMolecule() throws PluginException
getResultMolecule
in class CalculatorPlugin
PluginException
public boolean handlesMultiFragmentMolecules()
handlesMultiFragmentMolecules
in class CalculatorPlugin
public void setKeepSingleAtom(boolean b)
b
- If set true then a single atom
will be assigned to acyclic fragments. If false then acyclic fragments
will be projected to empty structurespublic void setFormat(String f)
CalculatorPlugin.getResultAsString(int, Object)
f
- Output format to usepublic void setLfin(boolean b)
b
- If set true then the calculation will run
only on the largest input fragment. Note that this necessarily yields the
largest scaffoldpublic void setLfout(boolean b)
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.public void setType(StructuralFrameworksPlugin.FrameworkTypes ft)
Note that default framework type is Bemis-Murcko
ft
- Framework to calculatepublic void setPruneIn(boolean b)
b
- If true then input will be generalizespublic void setPruneOut(boolean b)
b
- If true then result will be generalizedpublic void setHydrogenize(boolean b)
b
- If true then input will be hydrogenizedpublic void setDehydrogenize(boolean b)
b
- If true then explicit hydrogens will be removed from the inputpublic void setOeqcheck(boolean b)
b
- If true then eqivalent result fragments will be filteredpublic void setParameters(Properties params) throws PluginException
setParameters
in class CalculatorPlugin
params
- parameter tablePluginException
public String getProductName()
CalculatorPlugin
LicenseManager
.
The name is used by the CalculatorPlugin.isLicensed()
method.getProductName
in class CalculatorPlugin
public int getResultDomain(Object type)
CalculatorPlugin
CalculatorPlugin.ATOM
, CalculatorPlugin.MOLECULE
or CalculatorPlugin.MOLECULES
.
The default implementation returns CalculatorPlugin.MOLECULE
.getResultDomain
in class CalculatorPlugin
type
- is the result typeCalculatorPlugin.getResultTypes()
public Object[] getResultTypes()
CalculatorPlugin
null
.getResultTypes
in class CalculatorPlugin
public int getResultCount()
CalculatorPlugin
getResultCount
in class CalculatorPlugin
CalculatorPlugin.getResultTypes()
public Molecule getResult() throws PluginException
PluginException
public Object getResult(Object type, int index) throws PluginException
CalculatorPlugin
null
.getResult
in class CalculatorPlugin
type
- is the result typeindex
- is the result indexPluginException
- if the result cannot be returnedCalculatorPlugin.getResultTypes()
public String getResultAsString(Object type, int index, Object result) throws PluginException
getResultMolecule()
after a
run()
call in the given format setFormat(String)
getResultAsString
in class CalculatorPlugin
type
- this parameter is ignoredindex
- this patameter is ignoredresult
- result given by getResultMolecule()
PluginException
public String getTypeString(Object type)
getTypeString
in class CalculatorPlugin
type
- is the type object