Skip to content
Browse files

Added override option for models and fixed consensus calculations to …

…honor this.

Now, results from a test marked as override in extension takes precedence over all others if positive or negative result.
  • Loading branch information...
1 parent 0f2e499 commit 65917b9c4679db615586569179b9f68834b5e02c @olas olas committed Oct 6, 2010
View
5 plugins/net.bioclipse.ds.ahr/plugin.xml
@@ -22,6 +22,8 @@
id="ahr.lookup.exact"
name="AHR exact matches"
endpoint="net.bioclipse.ds.ahr"
+ override="true"
+ propertycalculator="AHR Exact Match"
class="net.bioclipse.ds.matcher.SDFPosNegExactMatchSignatures">
<resource name="file"
path="data/2796_nosalts_molsign.sdf">
@@ -36,6 +38,7 @@
name="AHR nearest neighbour"
endpoint="net.bioclipse.ds.ahr"
class="net.bioclipse.ds.matcher.SDFPosNegNearestMatchFP"
+ propertycalculator="AHR Nearest Neighbours"
consensus="net.bioclipse.ds.consensus.majority.emptyinconclusive">
<resource name="file"
path="data/2796_nosalts_fp.sdf">
@@ -51,6 +54,7 @@
name="AHR Signature Alerts"
endpoint="net.bioclipse.ds.ahr"
consensus="net.bioclipse.ds.consensus.majority.emptynegative"
+ propertycalculator="AHR Signature Matches"
class="net.bioclipse.ds.matcher.SignatureAlertsMatcher">
<resource name="file"
path="models/2796_nosalts_as0-5.sdf_exportedSignatures.txt">
@@ -61,6 +65,7 @@
id="ahr.signatures"
name="AHR Signature Significance"
class="net.bioclipse.ds.libsvm.Signatures2ClassesPredictionTest"
+ propertycalculator="AHR Signature Significance"
endpoint="net.bioclipse.ds.ahr">
<resource name="modelfile" path="models/ahr.train.model" />
<resource name="rangefile" path="models/ahr.train.range" />
View
85 plugins/net.bioclipse.ds.ames/plugin.xml
@@ -26,7 +26,7 @@
endpoint="net.bioclipse.ds.mutagenicity"
class="net.bioclipse.ds.matcher.SDFPosNegExactMatchSignatures"
propertycalculator="Ames Exact Match"
- informative="true">
+ override="true">
<resource name="file"
path="data/bursi_nosalts_molsign.sdf">
</resource>
@@ -94,7 +94,7 @@
<test
id="ames.consensus"
- name="Mutagenicity Consensus"
+ name="Ames Consensus"
visible="false"
endpoint="net.bioclipse.ds.mutagenicity"
class="net.bioclipse.ds.matcher.BogusTest"
@@ -129,7 +129,7 @@
<Calculator
class="net.bioclipse.ds.ames.calc.ConsensusCalculator"
- id="Mutagenicity Consensus">
+ id="Ames Consensus">
</Calculator>
</extension>
@@ -229,12 +229,12 @@
<command
commandId="net.bioclipse.cdk.ui.sdfeditor.addProperty"
- label="Mutagenicity Consensus Clasification"
+ label="Ames Consensus Clasification"
icon="icons/poll.gif"
style="push">
<parameter
name="net.bioclipse.cdk.ui.sdfeditor.calculatorId"
- value="Ames Exact Match,Ames Nearest Neighbours,Ames Toxicophores,Ames Signature Significance">
+ value="Ames Exact Match,Ames Nearest Neighbours,Ames Toxicophores,Ames Signature Significance, Ames Consensus">
</parameter>
<visibleWhen
checkEnabled="true">
@@ -246,79 +246,6 @@
</menuContribution>
</extension>
-
-
-
- <!--extension
- point="org.eclipse.core.expressions.definitions">
- <definition
- id="net.bioclipse.cdk.ui.sdfeditor.menu.file">
- <iterate
- ifEmpty="false"
- operator="and">
- <adapt
- type="org.eclipse.core.resources.IResource">
- <or>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="net.bioclipse.contenttypes.sdf0d">
- </test>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="net.bioclipse.contenttypes.sdf2d">
- </test>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="net.bioclipse.contenttypes.sdf3d">
- </test>
- </or>
- </adapt>
- </iterate>
- </definition>
-
- <definition
- id="net.bioclipse.cdk.ui.sdfeditor.menu.editor">
- <with
- variable="activeEditor">
- <instanceof
- value="net.bioclipse.cdk.ui.sdfeditor.editor.MultiPageMoleculesEditorPart">
- </instanceof>
- </with>
- </definition>
- <definition
- id="net.bioclipse.cdk.ui.sdfeditor.menu.fileOrEditor">
- <or>
- <iterate
- ifEmpty="false"
- operator="and">
- <adapt
- type="org.eclipse.core.resources.IResource">
- <or>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="net.bioclipse.contenttypes.sdf0d">
- </test>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="net.bioclipse.contenttypes.sdf2d">
- </test>
- <test
- property="org.eclipse.core.resources.contentTypeId"
- value="net.bioclipse.contenttypes.sdf3d">
- </test>
- </or>
- </adapt>
- </iterate>
- <with
- variable="activeEditor">
- <instanceof
- value="net.bioclipse.cdk.ui.sdfeditor.editor.MultiPageMoleculesEditorPart">
- </instanceof>
- </with>
- </or>
- </definition>
- </extension-->
-
-
+
</plugin>
View
2 plugins/net.bioclipse.ds.ames/src/net/bioclipse/ds/ames/calc/ConsensusCalculator.java
@@ -13,7 +13,7 @@
@Override
public String getPropertyName() {
- return "Mutagenicity Consensus";
+ return "Ames Consensus";
}
@Override
View
4 plugins/net.bioclipse.ds.common/src/net/bioclipse/ds/cons/MajorityVote.java
@@ -19,7 +19,7 @@
* This implementation follows the following rules:
* <ol>
* <li>if #err > #pos && #err > #neg >> ERROR
- * <li>if #incon >=pos && #incon >= #neg >> INCONCLUSIVE
+ * <li>if #incon >pos && #incon > #neg >> INCONCLUSIVE
* <li>if #pos == #neg >> INCONCLUSIVE
* <li>if #pos > #neg >> POSITIVE
* <li>else >> NEGATIVE
@@ -58,7 +58,7 @@ else if (res==ITestResult.INFORMATIVE)
if (numerr>numneg && numerr>numpos)
return ITestResult.ERROR;
- else if (numinc >= numpos && numinc >= numneg)
+ else if (numinc > numpos && numinc > numneg)
return ITestResult.INCONCLUSIVE;
else if (numpos==numneg)
View
19 plugins/net.bioclipse.ds.common/src/net/bioclipse/ds/prop/calc/DSConsensusCalculator.java
@@ -30,6 +30,7 @@
import net.bioclipse.ds.model.Endpoint;
import net.bioclipse.ds.model.IConsensusCalculator;
import net.bioclipse.ds.model.IDSTest;
+import net.bioclipse.ds.model.ITestResult;
import net.bioclipse.ds.model.TestRun;
import net.bioclipse.ds.model.result.SimpleResult;
import net.bioclipse.ds.report.StatusHelper;
@@ -60,7 +61,22 @@ public TestRun calculate( ICDKMolecule molecule ) {
TestRun tr = (TestRun) molecule.getProperty( id, Property.USE_CACHED );
if (tr!=null){
- if (!(tr.getTest().isInformative())){
+
+ //If we find one with override and either pos or neg,
+ //set consensus to this
+ //testruns consensus directly, ignoring all other testruns.
+ if (tr.getTest().isOverride()
+ &&
+ (tr.getConsensusStatus()==ITestResult.POSITIVE
+ ||
+ tr.getConsensusStatus()==ITestResult.NEGATIVE)
+ ){
+ classifications.clear();
+ classifications.add(tr.getConsensusStatus());
+ break;
+ }
+
+ if (!(tr.getTest().isInformative())){
if (tr.getTest().getTestErrorMessage().length()<1){
classifications.add( new Integer(tr.getConsensusStatus()));
logger.debug(" $$ Test: " + tr.getTest() + " got " +
@@ -84,6 +100,7 @@ public TestRun calculate( ICDKMolecule molecule ) {
TestRun consrun=new TestRun();
consrun.setTest( consensusTest );
+
//Add a single result to consrun
SimpleResult consres = new SimpleResult(getPropertyName(),
consCalc.calculate( classifications ) );
View
2 plugins/net.bioclipse.ds.cpdb/plugin.xml
@@ -26,7 +26,7 @@
endpoint="net.bioclipse.ds.carcinogenicity"
class="net.bioclipse.ds.matcher.SDFPosNegExactMatchSignatures"
propertycalculator="CPDB Exact Match"
- informative="true">
+ override="true">
<resource name="file"
path="data/cpdb_molsign.sdf">
</resource>
View
7 plugins/net.bioclipse.ds/schema/decisionsupport.exsd
@@ -215,6 +215,13 @@ This atribute is deprecated and will be ignored.
</documentation>
</annotation>
</attribute>
+ <attribute name="override" type="boolean">
+ <annotation>
+ <documentation>
+ If set to true, a non-inconclusive model result will be directly assign to its endpoint.
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
View
11 plugins/net.bioclipse.ds/src/net/bioclipse/ds/business/DSBusinessModel.java
@@ -170,6 +170,17 @@ public void readTestsFromEP(){
}
else
test.setInformative(false);
+
+ String pOver=element.getAttribute("override");
+ if (pOver!=null){
+ if (pOver.equalsIgnoreCase( "true" ))
+ test.setOverride(true);
+ else
+ test.setOverride(false);
+ }
+ else
+ test.setOverride(false);
+
String pvisible=element.getAttribute("visible");
if (pvisible!=null){
View
12 plugins/net.bioclipse.ds/src/net/bioclipse/ds/model/AbstractDSTest.java
@@ -65,8 +65,9 @@
private Image excludedIcon;
private IConsensusCalculator consensusCalculator;
private String propertycalculator;
+ public boolean override;
- private String helppage;
+ private String helppage;
/**
@@ -83,6 +84,15 @@ public AbstractDSTest(){
testErrorMessage="";
}
+ public boolean isOverride() {
+ return override;
+ }
+
+ public void setOverride(boolean override) {
+ this.override = override;
+ }
+
+
public boolean isExcluded() {
return excluded;
}
View
8 plugins/net.bioclipse.ds/src/net/bioclipse/ds/model/Endpoint.java
@@ -172,6 +172,14 @@ public int getConsensus() {
for (TestRun tr : testruns){
if (!(tr.getTest().isExcluded()) && tr.getTest().isVisible())
res.add(tr.getConsensusStatus());
+
+ //If any test with a hit has isOverride, then just assign
+ //result based on this test
+ if (tr.getTest().isOverride() && tr.hasMatches())
+ if (tr.getConsensusStatus()==ITestResult.POSITIVE
+ ||
+ tr.getConsensusStatus()==ITestResult.NEGATIVE)
+ return tr.getConsensusStatus();
}
int consensus = getConsensusCalculator().calculate(res);
View
2 plugins/net.bioclipse.ds/src/net/bioclipse/ds/model/IDSTest.java
@@ -69,5 +69,7 @@
public String getDescription();
public void setInitialized(boolean initialized);
public boolean isInitialized();
+ boolean isOverride();
+ void setOverride(boolean override);
}
View
2 plugins/net.bioclipse.ds/src/net/bioclipse/ds/model/TestRun.java
@@ -193,7 +193,7 @@ public int getConsensusStatus() {
ints.add( res.getClassification() );
}
}
-
+
//Use the consensuscalculator from the test
if (getTest().getConsensusCalculator()==null){
logger.error("Could not get ConsensusCalculator for test: "

0 comments on commit 65917b9

Please sign in to comment.
Something went wrong with that request. Please try again.