toxTree.tree
Class UserDefinedTree
java.lang.Object
java.util.Observable
toxTree.tree.AbstractTree
toxTree.tree.UserDefinedTree
- All Implemented Interfaces:
- ambit2.core.data.IStructureDiagramHighlights, java.io.Serializable, java.lang.Cloneable, java.util.Observer, org.openscience.cdk.qsar.IDescriptor, org.openscience.cdk.qsar.IMolecularDescriptor, IDecisionInteractive, IDecisionMethod, IDecisionMethodPrority, XMLSerializable
- Direct Known Subclasses:
- BB_CarcMutRules, BiodgeradationRules, CompoundLookup, CramerRules, CramerRulesWithExtensions, DNABindingPlugin, EyeIrritationRules, FuncRules, Kroes1Tree, LewisTree, MichaelAcceptorRules, MICRules, MOARules, ProteinBindingPlugin, SicretRules, SkinSensitisationPlugin, SMARTCYPPlugin, SMARTSTree, SubstructureTree, VerhaarScheme
public class UserDefinedTree
- extends AbstractTree
- implements IDecisionInteractive, org.openscience.cdk.qsar.IMolecularDescriptor
A default decision tree class, implementing IDecisionMethod
interface.
It stores categories in a IDecisionCategories
and
the tree itself in a DecisionNodesList
.
The tree is editable, i.e. rules can be added , removed and modified.
- Author:
- Nina Jeliazkova
Modified 2005-11-10
- See Also:
- Serialized Form
Fields inherited from class toxTree.tree.AbstractTree |
categories, changes, explanation, falseIfRuleNotImplemented, imageSize, logger, modified, name, priority, rules, treeRoot, web |
Fields inherited from interface toxTree.core.XMLSerializable |
xmltag_CATEGORIES, xmltag_CATEGORY, xmltag_CATEGORYTHRESHOLD, xmltag_CLASS, xmltag_EXPLANATION, xmltag_ID, xmltag_METHOD, xmltag_METHODPARAMETER, xmltag_METHODS, xmltag_NAME, xmltag_RULE, xmltag_RULEEXAMPLE, xmltag_RULES, xmltag_TREEROOT |
Method Summary |
org.openscience.cdk.qsar.DescriptorValue |
calculate(org.openscience.cdk.interfaces.IAtomContainer mol)
|
java.lang.Object |
clone()
|
protected ambit2.core.data.ArrayResult |
createArrayResult(int length)
|
IDecisionRule |
getBranch(IDecisionRule rule,
boolean answer)
|
IDecisionRule |
getBranch(int ruleId,
boolean answer)
|
IDecisionCategory |
getCategory(IDecisionRule rule,
boolean answer)
|
IDecisionCategory |
getCategory(int ruleId,
boolean answer)
|
java.lang.String[] |
getDescriptorNames()
|
org.openscience.cdk.qsar.result.IDescriptorResult |
getDescriptorResultType()
|
boolean |
getInteractive()
|
java.beans.PropertyChangeListener |
getListener()
|
IDecisionNodesFactory |
getNodesFactory()
|
IDecisionInteractive.UserOptions |
getOptions()
|
java.lang.String[] |
getParameterNames()
|
java.lang.Object[] |
getParameters()
|
java.lang.Object |
getParameterType(java.lang.String arg0)
|
IDecisionRule |
getRule(int id)
|
org.openscience.cdk.qsar.DescriptorSpecification |
getSpecification()
|
IDecisionRuleList |
hasUnreachableRules()
|
IDecisionCategories |
hasUnusedCategories()
|
protected IDecisionRuleList |
initRules()
public AbstractTree(
IDecisionCategories classes,
String[] customRules, int[][] customTransitions) throws DecisionMethodException {
this(categories,customRules,customTransitions);
}
public AbstractTree(
String[] customRules, int[][] customTransitions) throws DecisionMethodException {
this();
setRules(customRules);
setTransitions(customTransitions);
setChanged();
notifyObservers();
} |
boolean |
isEditable()
|
void |
removeListener()
|
protected void |
setArrayValue(ambit2.core.data.ArrayResult result,
int index,
org.openscience.cdk.interfaces.IAtomContainer mol,
java.lang.String propertyName)
|
void |
setEditable(boolean value)
|
void |
setInteractive(boolean value)
|
void |
setListener(java.beans.PropertyChangeListener listener)
|
void |
setNodesFactory(IDecisionNodesFactory nodesFactory)
|
void |
setOptions(IDecisionInteractive.UserOptions options)
|
void |
setParameters(org.openscience.cdk.interfaces.IAtomContainer mol)
Can be used to display some options before applying the rules. |
void |
setParameters(java.lang.Object[] arg0)
|
protected void |
setTransitions(int[][] customTransitions)
|
java.lang.String |
toString()
|
protected boolean |
verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result,
IDecisionRule topRule)
abstract method, to be implemented in the child class |
protected void |
visitCategories(DecisionNode rule,
IDecisionCategories usedCategories)
|
protected void |
visitRules(DecisionNode rule)
|
Methods inherited from class toxTree.tree.AbstractTree |
addDecisionRule, addPropertyChangeListener, classify, clearChanged, createDecisionResult, equals, explainRules, fromXML, getCategories, getEditor, getExplanation, getImage, getImage, getImageSize, getLegend, getNumberOfClasses, getNumberOfRules, getPriority, getRule, getRules, getTitle, getTopRule, isFalseIfRuleNotImplemented, isModified, isWeb, optionsPanel, printResults, printToStream, removePropertyChangeListener, retrieveExplanation, setCategories, setChanged, setDecisionRule, setExplanation, setFalseIfRuleNotImplemented, setImageSize, setModified, setPriority, setRules, setRules, setTitle, setWeb, testRulesWithSelector, toShallowXML, toXML, update, verifyResidues, verifyRules, walkRules, walkRules |
Methods inherited from class java.util.Observable |
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
editable
protected boolean editable
nodesFactory
protected IDecisionNodesFactory nodesFactory
options
protected IDecisionInteractive.UserOptions options
listener
protected transient java.beans.PropertyChangeListener listener
UserDefinedTree
public UserDefinedTree(IDecisionNodesFactory nodesFactory)
UserDefinedTree
public UserDefinedTree()
UserDefinedTree
public UserDefinedTree(IDecisionCategories classes,
IDecisionRuleList rules)
UserDefinedTree
public UserDefinedTree(IDecisionCategories classes,
java.lang.String[] customRules,
int[][] customTransitions,
IDecisionNodesFactory nodesFactory)
throws DecisionMethodException
- Parameters:
classes
- customRules
- customTransitions
-
- Throws:
DecisionMethodException
getOptions
public IDecisionInteractive.UserOptions getOptions()
- Specified by:
getOptions
in interface IDecisionInteractive
setOptions
public void setOptions(IDecisionInteractive.UserOptions options)
- Specified by:
setOptions
in interface IDecisionInteractive
getListener
public java.beans.PropertyChangeListener getListener()
- Specified by:
getListener
in interface IDecisionInteractive
setListener
public void setListener(java.beans.PropertyChangeListener listener)
- Specified by:
setListener
in interface IDecisionInteractive
initRules
protected IDecisionRuleList initRules()
- Description copied from class:
AbstractTree
- public AbstractTree(
IDecisionCategories classes,
String[] customRules, int[][] customTransitions) throws DecisionMethodException {
this(categories,customRules,customTransitions);
}
public AbstractTree(
String[] customRules, int[][] customTransitions) throws DecisionMethodException {
this();
setRules(customRules);
setTransitions(customTransitions);
setChanged();
notifyObservers();
}
- Specified by:
initRules
in class AbstractTree
setTransitions
protected void setTransitions(int[][] customTransitions)
- Specified by:
setTransitions
in class AbstractTree
visitRules
protected void visitRules(DecisionNode rule)
hasUnreachableRules
public IDecisionRuleList hasUnreachableRules()
- Specified by:
hasUnreachableRules
in interface IDecisionMethod
visitCategories
protected void visitCategories(DecisionNode rule,
IDecisionCategories usedCategories)
hasUnusedCategories
public IDecisionCategories hasUnusedCategories()
- Specified by:
hasUnusedCategories
in interface IDecisionMethod
verifyRules
protected boolean verifyRules(org.openscience.cdk.interfaces.IAtomContainer mol,
IDecisionResult result,
IDecisionRule topRule)
throws DecisionMethodException
- Description copied from class:
AbstractTree
- abstract method, to be implemented in the child class
- Specified by:
verifyRules
in class AbstractTree
- Parameters:
mol
- - org.openscience.cdk.interfaces.AtomContainer
to be analyzedresult
- - IDecisionResult
the result from the decision tree applicationtopRule
- - the starting rule
- Returns:
-
- Throws:
DecisionMethodException
getBranch
public IDecisionRule getBranch(IDecisionRule rule,
boolean answer)
- Specified by:
getBranch
in interface IDecisionMethod
getBranch
public IDecisionRule getBranch(int ruleId,
boolean answer)
getCategory
public IDecisionCategory getCategory(IDecisionRule rule,
boolean answer)
- Specified by:
getCategory
in interface IDecisionMethod
getCategory
public IDecisionCategory getCategory(int ruleId,
boolean answer)
isEditable
public boolean isEditable()
- Specified by:
isEditable
in interface IDecisionMethod
setEditable
public void setEditable(boolean value)
- Specified by:
setEditable
in interface IDecisionMethod
getRule
public IDecisionRule getRule(int id)
- Specified by:
getRule
in interface IDecisionMethod
- Overrides:
getRule
in class AbstractTree
- See Also:
IDecisionMethod.getRule(int)
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone
in class java.lang.Object
- Throws:
java.lang.CloneNotSupportedException
toString
public java.lang.String toString()
- Overrides:
toString
in class AbstractTree
setParameters
public void setParameters(org.openscience.cdk.interfaces.IAtomContainer mol)
- Description copied from class:
AbstractTree
- Can be used to display some options before applying the rules.
- Specified by:
setParameters
in interface IDecisionMethod
- Specified by:
setParameters
in class AbstractTree
getNodesFactory
public IDecisionNodesFactory getNodesFactory()
setNodesFactory
public void setNodesFactory(IDecisionNodesFactory nodesFactory)
getInteractive
public boolean getInteractive()
- Specified by:
getInteractive
in interface IDecisionInteractive
setInteractive
public void setInteractive(boolean value)
- Specified by:
setInteractive
in interface IDecisionInteractive
createArrayResult
protected ambit2.core.data.ArrayResult createArrayResult(int length)
setArrayValue
protected void setArrayValue(ambit2.core.data.ArrayResult result,
int index,
org.openscience.cdk.interfaces.IAtomContainer mol,
java.lang.String propertyName)
calculate
public org.openscience.cdk.qsar.DescriptorValue calculate(org.openscience.cdk.interfaces.IAtomContainer mol)
- Specified by:
calculate
in interface org.openscience.cdk.qsar.IMolecularDescriptor
getDescriptorNames
public java.lang.String[] getDescriptorNames()
- Specified by:
getDescriptorNames
in interface org.openscience.cdk.qsar.IDescriptor
getDescriptorResultType
public org.openscience.cdk.qsar.result.IDescriptorResult getDescriptorResultType()
- Specified by:
getDescriptorResultType
in interface org.openscience.cdk.qsar.IMolecularDescriptor
getParameterNames
public java.lang.String[] getParameterNames()
- Specified by:
getParameterNames
in interface org.openscience.cdk.qsar.IDescriptor
getParameters
public java.lang.Object[] getParameters()
- Specified by:
getParameters
in interface org.openscience.cdk.qsar.IDescriptor
getParameterType
public java.lang.Object getParameterType(java.lang.String arg0)
- Specified by:
getParameterType
in interface org.openscience.cdk.qsar.IDescriptor
setParameters
public void setParameters(java.lang.Object[] arg0)
throws org.openscience.cdk.exception.CDKException
- Specified by:
setParameters
in interface org.openscience.cdk.qsar.IDescriptor
- Throws:
org.openscience.cdk.exception.CDKException
getSpecification
public org.openscience.cdk.qsar.DescriptorSpecification getSpecification()
- Specified by:
getSpecification
in interface org.openscience.cdk.qsar.IDescriptor
removeListener
public void removeListener()
- Specified by:
removeListener
in interface IDecisionInteractive
Copyright © 2004-2012 Ideaconsult Ltd.. All Rights Reserved.