summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2011-01-19 16:12:21 +0100
committermguetlein <martin.guetlein@gmail.com>2011-01-19 16:12:21 +0100
commit7b06ce45180a5b2c0dd0095cd1a60ec974b46aa5 (patch)
tree39d34044b9879d1bd22df1cc9005fcbe6a0afb00
parentbba009c7c59655392236e1cdaf873117bb59600f (diff)
aa suport, rdf support
-rw-r--r--data/hamster_carcinogenicity.csv171
-rwxr-xr-xdata/hamster_carcinogenicity.yaml516
-rwxr-xr-xexample.rb12
-rwxr-xr-xlib/active_record_setup.rb8
-rw-r--r--lib/format_util.rb28
-rwxr-xr-xlib/validation_db.rb26
-rwxr-xr-xreach_reports/reach_application.rb8
-rwxr-xr-xreach_reports/reach_persistance.rb4
-rwxr-xr-xreach_reports/reach_service.rb10
-rwxr-xr-xreach_reports/reach_test.rb18
-rwxr-xr-xreport/report_application.rb12
-rwxr-xr-xreport/report_persistance.rb46
-rw-r--r--report/report_service.rb12
-rwxr-xr-xreport/report_test.rb25
-rwxr-xr-xreport/xml_report.rb4
-rwxr-xr-xtest/test_examples.rb40
-rwxr-xr-xtest/test_examples_util.rb24
-rwxr-xr-xvalidation/validation_application.rb85
-rwxr-xr-xvalidation/validation_format.rb32
-rwxr-xr-xvalidation/validation_service.rb160
-rwxr-xr-xvalidation/validation_test.rb241
21 files changed, 844 insertions, 638 deletions
diff --git a/data/hamster_carcinogenicity.csv b/data/hamster_carcinogenicity.csv
index 009808f..d314193 100644
--- a/data/hamster_carcinogenicity.csv
+++ b/data/hamster_carcinogenicity.csv
@@ -1,85 +1,86 @@
-CC=O,true
-C12C3=C(C=CC=C3)CC1=CC(=CC=2)NC(C)=O,true
-O=C(N)\C(C2=CC=CO2)=C/C1=CC=C([N+]([O-])=O)O1,true
-C1(N=CNN=1)N,false
-Br(=O)(=O)[O-].[K+],true
-[Cl-].[Cd+2].[Cl-],false
-O=S(=O)([O-])[O-].[Cd+2],false
-ClC1=CC(=NC(=N1)SCC(=O)O)NC2=CC=CC(=C2C)C,false
-ClCOC,true
-C=C(Cl)C=C,false
-Clc1ccc(cc1)c2ccc(COC(C)(C)C(O)=O)cc2,false
-O=C1OC2=C(C=CC=C2)C=C1,false
-ClC(=C(C1=CC=C(C=C1)Cl)C2=CC=C(C=C2)Cl)Cl,true
-ClC(C(C1=CC=C(C=C1)Cl)C2=CC=C(C=C2)Cl)(Cl)Cl,false
-C=CCN(CC=C)N=O,true
-Cl\C2=C(/Cl)C3(Cl)C1C4CC(C1C2(Cl)C3(Cl)Cl)C5OC45,false
-O=C(N(C)C)Cl,true
-CN(C)N,true
-N(NC)C.[H]Cl.[H]Cl,true
-CCO,false
-O=C(N(CC)N=O)NCCO,true
-O=C(N(CC)N=O)NCC(=O)C,true
-C=O,false
-[O-][N+](=O)C1=CC=C(O1)C2=CSC(=N2)NNC=O,true
-O=CC1=CC=CO1,false
-OCC1CO1,true
-O=C2C1=C(OC)C=C(OC)C(Cl)=C1O[C@]32C(OC)=CC(C[C@@](C)3[H])=O,false
-ClC1=C(C(=C(C(=C1Cl)Cl)Cl)Cl)Cl,true
-NN,true
-OS(=O)(=O)O.NN,true
-CC(=O)N(O)C1=CC2=C(C=C1)C3=CC=CC=C3C2,true
-OCCNN,false
-O=C(C1=CC=NC=C1)NN,false
-OC(=O)C1=CC=NC=C1,false
-O=C(NC1=CC=CC(=C1)Cl)OC(C)C,false
-O=C(NC1=CC=CC=C1)OC(C)C,false
-[O-]C(C)=O.[O-]C(C)=O.[Pb+2].[OH-].[OH-].[Pb+2].[OH-].[OH-].[Pb+2],false
-CN(C)CCN(CC2=CC=CS2)C1=NC=CC=C1.Cl,false
-NC1=C2C(=NC(=N1)N)N=CC(=N2)CN(C3=CC=C(C=C3)C(=O)N[C@@H](CCC(=O)O)C(=O)O)C,false
-CN(N)C=O,true
-O=C(C(=C)C)OC,false
-CNN,true
-O=C(C1=CC=CN=C1)CCCN(N=O)C,false
-CC1=CC(=O)NC(=S)N1,true
-CC(C(O)=O)(OC1=CC=C(C=C1)C2CCCC3=C2C=CC=C3)C,false
-O=N[O-].[Na+],false
-[O-][N+](C1=CC=C(C2=CSC(NC(C)=O)=N2)O1)=O,true
-[O-][N+](=O)C1=CC=C(O1)C2=CSC(=N2)NC=O,true
-O=[N+](C1=CC=C2C3=C1C=CC=C3CC2)[O-],false
-N(CC(CO)O)(CC(O)C)N=O,true
-N(CC(CO)O)(CC(C)=O)N=O,true
-N(CC(CO)O)(CCO)N=O,false
-O=C(C)CN(N=O)CCO,true
-C1C(N(C(CN1N=O)C)C)C,true
-N(CC(C)=O)(CC=C)N=O,true
-N(CC(CO)O)(C)N=O,true
-O=NN1CCOCC1,true
-N1C=CC=C(C=1)C2N(N=O)CCC2,true
-C1=CC=C(C=[N+]1[O-])C2CCCN2N=O,false
-O=NN1CCCCC1,true
-O=NN1CCCC1,true
-O=C(N(CC(C)=O)N=O)NCCCl,true
-N(C(=O)N)(N=O)CC(C)=O,true
-C1(CCN=C=S)=CC=CC=C1,false
-O=C1C(C2=CC=CC=C2)(C(=O)NC(=O)N1)CC,false
-C1=C2C(=CC=C1NC3=CC=CC=C3)C=CC=C2,false
-O=C1N2C(C3=C(C=CC=C3)CC2)CN(C1)C(=O)C4CCCCC4,false
-C1(=CC(=C(O)C=C1)O)C(O)=O,false
-O=C1C2=C(C=C(C=C2O)O)O/C(=C\1O)C3=CC(=C(C=C3)O)O.O.O,false
-C1=C(C=CC(=C1)C(C2=CC=C(N)C(=C2)C)=C3C=CC(=N)C=C3)N.[H]Cl,false
-C(C1=CC=C(C=C1)N)(C2=CC=C(C=C2)N)=C3C=CC(C=C3)=N.[H]Cl,false
-OC2=CC1=C(C(O)=C2)C(C(O[C@@H]4O[C@@H]([C@H]([C@H](O)[C@H]4O)O)CO[C@H]3[C@H](O)[C@H](O)[C@H]([C@H](C)O3)O)=C(C5=CC(O)=C(C=C5)O)O1)=O,false
-ClC(=CCl)Cl,false
-NC(=O)OCC,true
-C=CCl,true
-N#[N+]C1=CC=CC=C1.F[B-](F)(F)F,false
-C1(CN(CC(N1N=O)C)N=O)C,true
-N(CCN(C)C)(C)N=O,true
-C1(CN(N=O)CC(O1)C)C,true
-O1C(N(CC1C)N=O)=O,true
-CCOC(=O)N(C)N=O,true
-C1N(COC1)N=O,true
-O=C(N(CCC1=CC=CC=C1)N=O)N,true
-O=NN1CCC1,true
-F[B-](F)(F)F.[Na+],false
+SMILES, Hamster Carcinogenicity
+CC=O,1
+C12C3=C(C=CC=C3)CC1=CC(=CC=2)NC(C)=O,1
+O=C(N)\C(C2=CC=CO2)=C/C1=CC=C([N+]([O-])=O)O1,1
+C1(N=CNN=1)N,0
+Br(=O)(=O)[O-].[K+],1
+[Cl-].[Cd+2].[Cl-],0
+O=S(=O)([O-])[O-].[Cd+2],0
+ClC1=CC(=NC(=N1)SCC(=O)O)NC2=CC=CC(=C2C)C,0
+ClCOC,1
+C=C(Cl)C=C,0
+Clc1ccc(cc1)c2ccc(COC(C)(C)C(O)=O)cc2,0
+O=C1OC2=C(C=CC=C2)C=C1,0
+ClC(=C(C1=CC=C(C=C1)Cl)C2=CC=C(C=C2)Cl)Cl,1
+ClC(C(C1=CC=C(C=C1)Cl)C2=CC=C(C=C2)Cl)(Cl)Cl,0
+C=CCN(CC=C)N=O,1
+Cl\C2=C(/Cl)C3(Cl)C1C4CC(C1C2(Cl)C3(Cl)Cl)C5OC45,0
+O=C(N(C)C)Cl,1
+CN(C)N,1
+N(NC)C.[H]Cl.[H]Cl,1
+CCO,0
+O=C(N(CC)N=O)NCCO,1
+O=C(N(CC)N=O)NCC(=O)C,1
+C=O,0
+[O-][N+](=O)C1=CC=C(O1)C2=CSC(=N2)NNC=O,1
+O=CC1=CC=CO1,0
+OCC1CO1,1
+O=C2C1=C(OC)C=C(OC)C(Cl)=C1O[C@]32C(OC)=CC(C[C@@](C)3[H])=O,0
+ClC1=C(C(=C(C(=C1Cl)Cl)Cl)Cl)Cl,1
+NN,1
+OS(=O)(=O)O.NN,1
+CC(=O)N(O)C1=CC2=C(C=C1)C3=CC=CC=C3C2,1
+OCCNN,0
+O=C(C1=CC=NC=C1)NN,0
+OC(=O)C1=CC=NC=C1,0
+O=C(NC1=CC=CC(=C1)Cl)OC(C)C,0
+O=C(NC1=CC=CC=C1)OC(C)C,0
+[O-]C(C)=O.[O-]C(C)=O.[Pb+2].[OH-].[OH-].[Pb+2].[OH-].[OH-].[Pb+2],0
+CN(C)CCN(CC2=CC=CS2)C1=NC=CC=C1.Cl,0
+NC1=C2C(=NC(=N1)N)N=CC(=N2)CN(C3=CC=C(C=C3)C(=O)N[C@@H](CCC(=O)O)C(=O)O)C,0
+CN(N)C=O,1
+O=C(C(=C)C)OC,0
+CNN,1
+O=C(C1=CC=CN=C1)CCCN(N=O)C,0
+CC1=CC(=O)NC(=S)N1,1
+CC(C(O)=O)(OC1=CC=C(C=C1)C2CCCC3=C2C=CC=C3)C,0
+O=N[O-].[Na+],0
+[O-][N+](C1=CC=C(C2=CSC(NC(C)=O)=N2)O1)=O,1
+[O-][N+](=O)C1=CC=C(O1)C2=CSC(=N2)NC=O,1
+O=[N+](C1=CC=C2C3=C1C=CC=C3CC2)[O-],0
+N(CC(CO)O)(CC(O)C)N=O,1
+N(CC(CO)O)(CC(C)=O)N=O,1
+N(CC(CO)O)(CCO)N=O,0
+O=C(C)CN(N=O)CCO,1
+C1C(N(C(CN1N=O)C)C)C,1
+N(CC(C)=O)(CC=C)N=O,1
+N(CC(CO)O)(C)N=O,1
+O=NN1CCOCC1,1
+N1C=CC=C(C=1)C2N(N=O)CCC2,1
+C1=CC=C(C=[N+]1[O-])C2CCCN2N=O,0
+O=NN1CCCCC1,1
+O=NN1CCCC1,1
+O=C(N(CC(C)=O)N=O)NCCCl,1
+N(C(=O)N)(N=O)CC(C)=O,1
+C1(CCN=C=S)=CC=CC=C1,0
+O=C1C(C2=CC=CC=C2)(C(=O)NC(=O)N1)CC,0
+C1=C2C(=CC=C1NC3=CC=CC=C3)C=CC=C2,0
+O=C1N2C(C3=C(C=CC=C3)CC2)CN(C1)C(=O)C4CCCCC4,0
+C1(=CC(=C(O)C=C1)O)C(O)=O,0
+O=C1C2=C(C=C(C=C2O)O)O/C(=C\1O)C3=CC(=C(C=C3)O)O.O.O,0
+C1=C(C=CC(=C1)C(C2=CC=C(N)C(=C2)C)=C3C=CC(=N)C=C3)N.[H]Cl,0
+C(C1=CC=C(C=C1)N)(C2=CC=C(C=C2)N)=C3C=CC(C=C3)=N.[H]Cl,0
+OC2=CC1=C(C(O)=C2)C(C(O[C@@H]4O[C@@H]([C@H]([C@H](O)[C@H]4O)O)CO[C@H]3[C@H](O)[C@H](O)[C@H]([C@H](C)O3)O)=C(C5=CC(O)=C(C=C5)O)O1)=O,0
+ClC(=CCl)Cl,0
+NC(=O)OCC,1
+C=CCl,1
+N#[N+]C1=CC=CC=C1.F[B-](F)(F)F,0
+C1(CN(CC(N1N=O)C)N=O)C,1
+N(CCN(C)C)(C)N=O,1
+C1(CN(N=O)CC(O1)C)C,1
+O1C(N(CC1C)N=O)=O,1
+CCOC(=O)N(C)N=O,1
+C1N(COC1)N=O,1
+O=C(N(CCC1=CC=CC=C1)N=O)N,1
+O=NN1CCC1,1
+F[B-](F)(F)F.[Na+],0
diff --git a/data/hamster_carcinogenicity.yaml b/data/hamster_carcinogenicity.yaml
index 108edd9..1638049 100755
--- a/data/hamster_carcinogenicity.yaml
+++ b/data/hamster_carcinogenicity.yaml
@@ -1,352 +1,352 @@
--- !ruby/object:OpenTox::Dataset
compounds:
-- http://localhost/compound/InChI=1S/C2H4O/c1-2-3/h2H,1H3
-- http://localhost/compound/InChI=1S/C15H13NO/c1-10(17)16-13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9H,8H2,1H3,(H,16,17)
-- http://localhost/compound/InChI=1S/C11H8N2O5/c12-11(14)8(9-2-1-5-17-9)6-7-3-4-10(18-7)13(15)16/h1-6H,(H2,12,14)
-- http://localhost/compound/InChI=1S/C2H4N4/c3-2-4-1-5-6-2/h1H,(H3,3,4,5,6)
-- http://localhost/compound/InChI=1S/BrHO3.K/c2-1(3)4;/h(H,2,3,4);/q;+1/p-1
-- http://localhost/compound/InChI=1S/Cd.2ClH/h;2*1H/q+2;;/p-2
-- http://localhost/compound/InChI=1S/Cd.H2O4S/c;1-5(2,3)4/h;(H2,1,2,3,4)/q+2;/p-2
-- http://localhost/compound/InChI=1S/C14H14ClN3O2S/c1-8-4-3-5-10(9(8)2)16-12-6-11(15)17-14(18-12)21-7-13(19)20/h3-6H,7H2,1-2H3,(H,19,20)(H,16,17,18)
-- http://localhost/compound/InChI=1S/C2H5ClO/c1-4-2-3/h2H2,1H3
-- http://localhost/compound/InChI=1S/C4H5Cl/c1-3-4(2)5/h3H,1-2H2
-- http://localhost/compound/InChI=1S/C17H17ClO3/c1-17(2,16(19)20)21-11-12-3-5-13(6-4-12)14-7-9-15(18)10-8-14/h3-10H,11H2,1-2H3,(H,19,20)
-- http://localhost/compound/InChI=1S/C9H6O2/c10-9-6-5-7-3-1-2-4-8(7)11-9/h1-6H
-- http://localhost/compound/InChI=1S/C14H8Cl4/c15-11-5-1-9(2-6-11)13(14(17)18)10-3-7-12(16)8-4-10/h1-8H
-- http://localhost/compound/InChI=1S/C14H9Cl5/c15-11-5-1-9(2-6-11)13(14(17,18)19)10-3-7-12(16)8-4-10/h1-8,13H
-- http://localhost/compound/InChI=1S/C6H10N2O/c1-3-5-8(7-9)6-4-2/h3-4H,1-2,5-6H2
-- http://localhost/compound/InChI=1S/C12H8Cl6O/c13-8-9(14)11(16)5-3-1-2(6-7(3)19-6)4(5)10(8,15)12(11,17)18/h2-7H,1H2
-- http://localhost/compound/InChI=1S/C3H6ClNO/c1-5(2)3(4)6/h1-2H3
-- http://localhost/compound/InChI=1S/C2H8N2/c1-4(2)3/h3H2,1-2H3
-- http://localhost/compound/InChI=1S/C2H8N2.2ClH/c1-3-4-2;;/h3-4H,1-2H3;2*1H
-- http://localhost/compound/InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3
-- http://localhost/compound/InChI=1S/C5H11N3O3/c1-2-8(7-11)5(10)6-3-4-9/h9H,2-4H2,1H3,(H,6,10)
-- http://localhost/compound/InChI=1S/C6H11N3O3/c1-3-9(8-12)6(11)7-4-5(2)10/h3-4H2,1-2H3,(H,7,11)
-- http://localhost/compound/InChI=1S/CH2O/c1-2/h1H2
-- http://localhost/compound/InChI=1S/C8H6N4O4S/c13-4-9-11-8-10-5(3-17-8)6-1-2-7(16-6)12(14)15/h1-4H,(H,9,13)(H,10,11)
-- http://localhost/compound/InChI=1S/C5H4O2/c6-4-5-2-1-3-7-5/h1-4H
-- http://localhost/compound/InChI=1S/C3H6O2/c4-1-3-2-5-3/h3-4H,1-2H2
-- http://localhost/compound/InChI=1S/C17H17ClO6/c1-8-5-9(19)6-12(23-4)17(8)16(20)13-10(21-2)7-11(22-3)14(18)15(13)24-17/h6-8H,5H2,1-4H3/t8-,17?/m1/s1
-- http://localhost/compound/InChI=1S/C6Cl6/c7-1-2(8)4(10)6(12)5(11)3(1)9
-- http://localhost/compound/InChI=1S/H4N2/c1-2/h1-2H2
-- http://localhost/compound/InChI=1S/H4N2.H2O4S/c1-2;1-5(2,3)4/h1-2H2;(H2,1,2,3,4)
-- http://localhost/compound/InChI=1S/C15H13NO2/c1-10(17)16(18)13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9,18H,8H2,1H3
-- http://localhost/compound/InChI=1S/C2H8N2O/c3-4-1-2-5/h4-5H,1-3H2
-- http://localhost/compound/InChI=1S/C6H7N3O/c7-9-6(10)5-1-3-8-4-2-5/h1-4H,7H2,(H,9,10)
-- http://localhost/compound/InChI=1S/C6H5NO2/c8-6(9)5-1-3-7-4-2-5/h1-4H,(H,8,9)
-- http://localhost/compound/InChI=1S/C10H12ClNO2/c1-7(2)14-10(13)12-9-5-3-4-8(11)6-9/h3-7H,1-2H3,(H,12,13)
-- http://localhost/compound/InChI=1S/C10H13NO2/c1-8(2)13-10(12)11-9-6-4-3-5-7-9/h3-8H,1-2H3,(H,11,12)
-- http://localhost/compound/InChI=1S/2C2H4O2.4H2O.3Pb/c2*1-2(3)4;;;;;;;/h2*1H3,(H,3,4);4*1H2;;;/q;;;;;;3*+2/p-6
-- http://localhost/compound/InChI=1S/C14H19N3S.ClH/c1-16(2)9-10-17(12-13-6-5-11-18-13)14-7-3-4-8-15-14;/h3-8,11H,9-10,12H2,1-2H3;1H
-- http://localhost/compound/InChI=1S/C20H22N8O5/c1-28(9-11-8-23-17-15(24-11)16(21)26-20(22)27-17)12-4-2-10(3-5-12)18(31)25-13(19(32)33)6-7-14(29)30/h2-5,8,13H,6-7,9H2,1H3,(H,25,31)(H,29,30)(H,32,33)(H4,21,22,23,26,27)/t13-/m0/s1
-- http://localhost/compound/InChI=1S/C2H6N2O/c1-4(3)2-5/h2H,3H2,1H3
-- http://localhost/compound/InChI=1S/C5H8O2/c1-4(2)5(6)7-3/h1H2,2-3H3
-- http://localhost/compound/InChI=1S/CH6N2/c1-3-2/h3H,2H2,1H3
-- http://localhost/compound/InChI=1S/C10H13N3O2/c1-13(12-15)7-3-5-10(14)9-4-2-6-11-8-9/h2,4,6,8H,3,5,7H2,1H3
-- http://localhost/compound/InChI=1S/C5H6N2OS/c1-3-2-4(8)7-5(9)6-3/h2H,1H3,(H2,6,7,8,9)
-- http://localhost/compound/InChI=1S/C20H22O3/c1-20(2,19(21)22)23-16-12-10-15(11-13-16)18-9-5-7-14-6-3-4-8-17(14)18/h3-4,6,8,10-13,18H,5,7,9H2,1-2H3,(H,21,22)
-- http://localhost/compound/InChI=1S/HNO2.Na/c2-1-3;/h(H,2,3);/q;+1/p-1
-- http://localhost/compound/InChI=1S/C9H7N3O4S/c1-5(13)10-9-11-6(4-17-9)7-2-3-8(16-7)12(14)15/h2-4H,1H3,(H,10,11,13)
-- http://localhost/compound/InChI=1S/C8H5N3O4S/c12-4-9-8-10-5(3-16-8)6-1-2-7(15-6)11(13)14/h1-4H,(H,9,10,12)
-- http://localhost/compound/InChI=1S/C12H9NO2/c14-13(15)11-7-6-9-5-4-8-2-1-3-10(11)12(8)9/h1-3,6-7H,4-5H2
-- http://localhost/compound/InChI=1S/C6H14N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h5-6,9-11H,2-4H2,1H3
-- http://localhost/compound/InChI=1S/C6H12N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h6,9,11H,2-4H2,1H3
-- http://localhost/compound/InChI=1S/C5H12N2O4/c8-2-1-7(6-11)3-5(10)4-9/h5,8-10H,1-4H2
-- http://localhost/compound/InChI=1S/C5H10N2O3/c1-5(9)4-7(6-10)2-3-8/h8H,2-4H2,1H3
-- http://localhost/compound/InChI=1S/C7H15N3O/c1-6-4-10(8-11)5-7(2)9(6)3/h6-7H,4-5H2,1-3H3
-- http://localhost/compound/InChI=1S/C6H10N2O2/c1-3-4-8(7-10)5-6(2)9/h3H,1,4-5H2,2H3
-- http://localhost/compound/InChI=1S/C4H10N2O3/c1-6(5-9)2-4(8)3-7/h4,7-8H,2-3H2,1H3
-- http://localhost/compound/InChI=1S/C4H8N2O2/c7-5-6-1-3-8-4-2-6/h1-4H2
-- http://localhost/compound/InChI=1S/C9H11N3O/c13-11-12-6-2-4-9(12)8-3-1-5-10-7-8/h1,3,5,7,9H,2,4,6H2
-- http://localhost/compound/InChI=1S/C9H11N3O2/c13-10-12-6-2-4-9(12)8-3-1-5-11(14)7-8/h1,3,5,7,9H,2,4,6H2
-- http://localhost/compound/InChI=1S/C5H10N2O/c8-6-7-4-2-1-3-5-7/h1-5H2
-- http://localhost/compound/InChI=1S/C4H8N2O/c7-5-6-3-1-2-4-6/h1-4H2
-- http://localhost/compound/InChI=1S/C6H10ClN3O3/c1-5(11)4-10(9-13)6(12)8-3-2-7/h2-4H2,1H3,(H,8,12)
-- http://localhost/compound/InChI=1S/C4H7N3O3/c1-3(8)2-7(6-10)4(5)9/h2H2,1H3,(H2,5,9)
-- http://localhost/compound/InChI=1S/C9H9NS/c11-8-10-7-6-9-4-2-1-3-5-9/h1-5H,6-7H2
-- http://localhost/compound/InChI=1S/C12H12N2O3/c1-2-12(8-6-4-3-5-7-8)9(15)13-11(17)14-10(12)16/h3-7H,2H2,1H3,(H2,13,14,15,16,17)
-- http://localhost/compound/InChI=1S/C16H13N/c1-2-8-15(9-3-1)17-16-11-10-13-6-4-5-7-14(13)12-16/h1-12,17H
-- http://localhost/compound/InChI=1S/C19H24N2O2/c22-18-13-20(19(23)15-7-2-1-3-8-15)12-17-16-9-5-4-6-14(16)10-11-21(17)18/h4-6,9,15,17H,1-3,7-8,10-13H2
-- http://localhost/compound/InChI=1S/C7H6O4/c8-5-2-1-4(7(10)11)3-6(5)9/h1-3,8-9H,(H,10,11)
-- http://localhost/compound/InChI=1S/C15H10O7.2H2O/c16-7-4-10(19)12-11(5-7)22-15(14(21)13(12)20)6-1-2-8(17)9(18)3-6;;/h1-5,16-19,21H;2*1H2
-- http://localhost/compound/InChI=1S/C20H19N3.ClH/c1-13-12-16(6-11-19(13)23)20(14-2-7-17(21)8-3-14)15-4-9-18(22)10-5-15;/h2-12,21H,22-23H2,1H3;1H
-- http://localhost/compound/InChI=1S/C19H17N3.ClH/c20-16-7-1-13(2-8-16)19(14-3-9-17(21)10-4-14)15-5-11-18(22)12-6-15;/h1-12,20H,21-22H2;1H
-- http://localhost/compound/InChI=1S/C27H30O16/c1-8-17(32)20(35)22(37)26(40-8)39-7-15-18(33)21(36)23(38)27(42-15)43-25-19(34)16-13(31)5-10(28)6-14(16)41-24(25)9-2-3-11(29)12(30)4-9/h2-6,8,15,17-18,20-23,26-33,35-38H,7H2,1H3/t8-,15+,17-,18+,20+,21-,22+,23+,26+,27?/m0/s1
-- http://localhost/compound/InChI=1S/C2HCl3/c3-1-2(4)5/h1H
-- http://localhost/compound/InChI=1S/C3H7NO2/c1-2-6-3(4)5/h2H2,1H3,(H2,4,5)
-- http://localhost/compound/InChI=1S/C2H3Cl/c1-2-3/h2H,1H2
-- http://localhost/compound/InChI=1S/C6H5N2.BF4/c7-8-6-4-2-1-3-5-6;2-1(3,4)5/h1-5H;/q+1;-1
-- http://localhost/compound/InChI=1S/C6H12N4O2/c1-5-3-9(7-11)4-6(2)10(5)8-12/h5-6H,3-4H2,1-2H3
-- http://localhost/compound/InChI=1S/C5H13N3O/c1-7(2)4-5-8(3)6-9/h4-5H2,1-3H3
-- http://localhost/compound/InChI=1S/C6H12N2O2/c1-5-3-8(7-9)4-6(2)10-5/h5-6H,3-4H2,1-2H3
-- http://localhost/compound/InChI=1S/C4H6N2O3/c1-3-2-6(5-8)4(7)9-3/h3H,2H2,1H3
-- http://localhost/compound/InChI=1S/C4H8N2O3/c1-3-9-4(7)6(2)5-8/h3H2,1-2H3
-- http://localhost/compound/InChI=1S/C3H6N2O2/c6-4-5-1-2-7-3-5/h1-3H2
-- http://localhost/compound/InChI=1S/C9H11N3O2/c10-9(13)12(11-14)7-6-8-4-2-1-3-5-8/h1-5H,6-7H2,(H2,10,13)
-- http://localhost/compound/InChI=1S/C3H6N2O/c6-4-5-2-1-3-5/h1-3H2
-- http://localhost/compound/InChI=1S/BF4.Na/c2-1(3,4)5;/q-1;+1
+- http://local-ot/compound/InChI=1S/C2H4O/c1-2-3/h2H,1H3
+- http://local-ot/compound/InChI=1S/C15H13NO/c1-10(17)16-13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9H,8H2,1H3,(H,16,17)
+- http://local-ot/compound/InChI=1S/C11H8N2O5/c12-11(14)8(9-2-1-5-17-9)6-7-3-4-10(18-7)13(15)16/h1-6H,(H2,12,14)
+- http://local-ot/compound/InChI=1S/C2H4N4/c3-2-4-1-5-6-2/h1H,(H3,3,4,5,6)
+- http://local-ot/compound/InChI=1S/BrHO3.K/c2-1(3)4;/h(H,2,3,4);/q;+1/p-1
+- http://local-ot/compound/InChI=1S/Cd.2ClH/h;2*1H/q+2;;/p-2
+- http://local-ot/compound/InChI=1S/Cd.H2O4S/c;1-5(2,3)4/h;(H2,1,2,3,4)/q+2;/p-2
+- http://local-ot/compound/InChI=1S/C14H14ClN3O2S/c1-8-4-3-5-10(9(8)2)16-12-6-11(15)17-14(18-12)21-7-13(19)20/h3-6H,7H2,1-2H3,(H,19,20)(H,16,17,18)
+- http://local-ot/compound/InChI=1S/C2H5ClO/c1-4-2-3/h2H2,1H3
+- http://local-ot/compound/InChI=1S/C4H5Cl/c1-3-4(2)5/h3H,1-2H2
+- http://local-ot/compound/InChI=1S/C17H17ClO3/c1-17(2,16(19)20)21-11-12-3-5-13(6-4-12)14-7-9-15(18)10-8-14/h3-10H,11H2,1-2H3,(H,19,20)
+- http://local-ot/compound/InChI=1S/C9H6O2/c10-9-6-5-7-3-1-2-4-8(7)11-9/h1-6H
+- http://local-ot/compound/InChI=1S/C14H8Cl4/c15-11-5-1-9(2-6-11)13(14(17)18)10-3-7-12(16)8-4-10/h1-8H
+- http://local-ot/compound/InChI=1S/C14H9Cl5/c15-11-5-1-9(2-6-11)13(14(17,18)19)10-3-7-12(16)8-4-10/h1-8,13H
+- http://local-ot/compound/InChI=1S/C6H10N2O/c1-3-5-8(7-9)6-4-2/h3-4H,1-2,5-6H2
+- http://local-ot/compound/InChI=1S/C12H8Cl6O/c13-8-9(14)11(16)5-3-1-2(6-7(3)19-6)4(5)10(8,15)12(11,17)18/h2-7H,1H2
+- http://local-ot/compound/InChI=1S/C3H6ClNO/c1-5(2)3(4)6/h1-2H3
+- http://local-ot/compound/InChI=1S/C2H8N2/c1-4(2)3/h3H2,1-2H3
+- http://local-ot/compound/InChI=1S/C2H8N2.2ClH/c1-3-4-2;;/h3-4H,1-2H3;2*1H
+- http://local-ot/compound/InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3
+- http://local-ot/compound/InChI=1S/C5H11N3O3/c1-2-8(7-11)5(10)6-3-4-9/h9H,2-4H2,1H3,(H,6,10)
+- http://local-ot/compound/InChI=1S/C6H11N3O3/c1-3-9(8-12)6(11)7-4-5(2)10/h3-4H2,1-2H3,(H,7,11)
+- http://local-ot/compound/InChI=1S/CH2O/c1-2/h1H2
+- http://local-ot/compound/InChI=1S/C8H6N4O4S/c13-4-9-11-8-10-5(3-17-8)6-1-2-7(16-6)12(14)15/h1-4H,(H,9,13)(H,10,11)
+- http://local-ot/compound/InChI=1S/C5H4O2/c6-4-5-2-1-3-7-5/h1-4H
+- http://local-ot/compound/InChI=1S/C3H6O2/c4-1-3-2-5-3/h3-4H,1-2H2
+- http://local-ot/compound/InChI=1S/C17H17ClO6/c1-8-5-9(19)6-12(23-4)17(8)16(20)13-10(21-2)7-11(22-3)14(18)15(13)24-17/h6-8H,5H2,1-4H3/t8-,17?/m1/s1
+- http://local-ot/compound/InChI=1S/C6Cl6/c7-1-2(8)4(10)6(12)5(11)3(1)9
+- http://local-ot/compound/InChI=1S/H4N2/c1-2/h1-2H2
+- http://local-ot/compound/InChI=1S/H4N2.H2O4S/c1-2;1-5(2,3)4/h1-2H2;(H2,1,2,3,4)
+- http://local-ot/compound/InChI=1S/C15H13NO2/c1-10(17)16(18)13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9,18H,8H2,1H3
+- http://local-ot/compound/InChI=1S/C2H8N2O/c3-4-1-2-5/h4-5H,1-3H2
+- http://local-ot/compound/InChI=1S/C6H7N3O/c7-9-6(10)5-1-3-8-4-2-5/h1-4H,7H2,(H,9,10)
+- http://local-ot/compound/InChI=1S/C6H5NO2/c8-6(9)5-1-3-7-4-2-5/h1-4H,(H,8,9)
+- http://local-ot/compound/InChI=1S/C10H12ClNO2/c1-7(2)14-10(13)12-9-5-3-4-8(11)6-9/h3-7H,1-2H3,(H,12,13)
+- http://local-ot/compound/InChI=1S/C10H13NO2/c1-8(2)13-10(12)11-9-6-4-3-5-7-9/h3-8H,1-2H3,(H,11,12)
+- http://local-ot/compound/InChI=1S/2C2H4O2.4H2O.3Pb/c2*1-2(3)4;;;;;;;/h2*1H3,(H,3,4);4*1H2;;;/q;;;;;;3*+2/p-6
+- http://local-ot/compound/InChI=1S/C14H19N3S.ClH/c1-16(2)9-10-17(12-13-6-5-11-18-13)14-7-3-4-8-15-14;/h3-8,11H,9-10,12H2,1-2H3;1H
+- http://local-ot/compound/InChI=1S/C20H22N8O5/c1-28(9-11-8-23-17-15(24-11)16(21)26-20(22)27-17)12-4-2-10(3-5-12)18(31)25-13(19(32)33)6-7-14(29)30/h2-5,8,13H,6-7,9H2,1H3,(H,25,31)(H,29,30)(H,32,33)(H4,21,22,23,26,27)/t13-/m0/s1
+- http://local-ot/compound/InChI=1S/C2H6N2O/c1-4(3)2-5/h2H,3H2,1H3
+- http://local-ot/compound/InChI=1S/C5H8O2/c1-4(2)5(6)7-3/h1H2,2-3H3
+- http://local-ot/compound/InChI=1S/CH6N2/c1-3-2/h3H,2H2,1H3
+- http://local-ot/compound/InChI=1S/C10H13N3O2/c1-13(12-15)7-3-5-10(14)9-4-2-6-11-8-9/h2,4,6,8H,3,5,7H2,1H3
+- http://local-ot/compound/InChI=1S/C5H6N2OS/c1-3-2-4(8)7-5(9)6-3/h2H,1H3,(H2,6,7,8,9)
+- http://local-ot/compound/InChI=1S/C20H22O3/c1-20(2,19(21)22)23-16-12-10-15(11-13-16)18-9-5-7-14-6-3-4-8-17(14)18/h3-4,6,8,10-13,18H,5,7,9H2,1-2H3,(H,21,22)
+- http://local-ot/compound/InChI=1S/HNO2.Na/c2-1-3;/h(H,2,3);/q;+1/p-1
+- http://local-ot/compound/InChI=1S/C9H7N3O4S/c1-5(13)10-9-11-6(4-17-9)7-2-3-8(16-7)12(14)15/h2-4H,1H3,(H,10,11,13)
+- http://local-ot/compound/InChI=1S/C8H5N3O4S/c12-4-9-8-10-5(3-16-8)6-1-2-7(15-6)11(13)14/h1-4H,(H,9,10,12)
+- http://local-ot/compound/InChI=1S/C12H9NO2/c14-13(15)11-7-6-9-5-4-8-2-1-3-10(11)12(8)9/h1-3,6-7H,4-5H2
+- http://local-ot/compound/InChI=1S/C6H14N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h5-6,9-11H,2-4H2,1H3
+- http://local-ot/compound/InChI=1S/C6H12N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h6,9,11H,2-4H2,1H3
+- http://local-ot/compound/InChI=1S/C5H12N2O4/c8-2-1-7(6-11)3-5(10)4-9/h5,8-10H,1-4H2
+- http://local-ot/compound/InChI=1S/C5H10N2O3/c1-5(9)4-7(6-10)2-3-8/h8H,2-4H2,1H3
+- http://local-ot/compound/InChI=1S/C7H15N3O/c1-6-4-10(8-11)5-7(2)9(6)3/h6-7H,4-5H2,1-3H3
+- http://local-ot/compound/InChI=1S/C6H10N2O2/c1-3-4-8(7-10)5-6(2)9/h3H,1,4-5H2,2H3
+- http://local-ot/compound/InChI=1S/C4H10N2O3/c1-6(5-9)2-4(8)3-7/h4,7-8H,2-3H2,1H3
+- http://local-ot/compound/InChI=1S/C4H8N2O2/c7-5-6-1-3-8-4-2-6/h1-4H2
+- http://local-ot/compound/InChI=1S/C9H11N3O/c13-11-12-6-2-4-9(12)8-3-1-5-10-7-8/h1,3,5,7,9H,2,4,6H2
+- http://local-ot/compound/InChI=1S/C9H11N3O2/c13-10-12-6-2-4-9(12)8-3-1-5-11(14)7-8/h1,3,5,7,9H,2,4,6H2
+- http://local-ot/compound/InChI=1S/C5H10N2O/c8-6-7-4-2-1-3-5-7/h1-5H2
+- http://local-ot/compound/InChI=1S/C4H8N2O/c7-5-6-3-1-2-4-6/h1-4H2
+- http://local-ot/compound/InChI=1S/C6H10ClN3O3/c1-5(11)4-10(9-13)6(12)8-3-2-7/h2-4H2,1H3,(H,8,12)
+- http://local-ot/compound/InChI=1S/C4H7N3O3/c1-3(8)2-7(6-10)4(5)9/h2H2,1H3,(H2,5,9)
+- http://local-ot/compound/InChI=1S/C9H9NS/c11-8-10-7-6-9-4-2-1-3-5-9/h1-5H,6-7H2
+- http://local-ot/compound/InChI=1S/C12H12N2O3/c1-2-12(8-6-4-3-5-7-8)9(15)13-11(17)14-10(12)16/h3-7H,2H2,1H3,(H2,13,14,15,16,17)
+- http://local-ot/compound/InChI=1S/C16H13N/c1-2-8-15(9-3-1)17-16-11-10-13-6-4-5-7-14(13)12-16/h1-12,17H
+- http://local-ot/compound/InChI=1S/C19H24N2O2/c22-18-13-20(19(23)15-7-2-1-3-8-15)12-17-16-9-5-4-6-14(16)10-11-21(17)18/h4-6,9,15,17H,1-3,7-8,10-13H2
+- http://local-ot/compound/InChI=1S/C7H6O4/c8-5-2-1-4(7(10)11)3-6(5)9/h1-3,8-9H,(H,10,11)
+- http://local-ot/compound/InChI=1S/C15H10O7.2H2O/c16-7-4-10(19)12-11(5-7)22-15(14(21)13(12)20)6-1-2-8(17)9(18)3-6;;/h1-5,16-19,21H;2*1H2
+- http://local-ot/compound/InChI=1S/C20H19N3.ClH/c1-13-12-16(6-11-19(13)23)20(14-2-7-17(21)8-3-14)15-4-9-18(22)10-5-15;/h2-12,21H,22-23H2,1H3;1H
+- http://local-ot/compound/InChI=1S/C19H17N3.ClH/c20-16-7-1-13(2-8-16)19(14-3-9-17(21)10-4-14)15-5-11-18(22)12-6-15;/h1-12,20H,21-22H2;1H
+- http://local-ot/compound/InChI=1S/C27H30O16/c1-8-17(32)20(35)22(37)26(40-8)39-7-15-18(33)21(36)23(38)27(42-15)43-25-19(34)16-13(31)5-10(28)6-14(16)41-24(25)9-2-3-11(29)12(30)4-9/h2-6,8,15,17-18,20-23,26-33,35-38H,7H2,1H3/t8-,15+,17-,18+,20+,21-,22+,23+,26+,27?/m0/s1
+- http://local-ot/compound/InChI=1S/C2HCl3/c3-1-2(4)5/h1H
+- http://local-ot/compound/InChI=1S/C3H7NO2/c1-2-6-3(4)5/h2H2,1H3,(H2,4,5)
+- http://local-ot/compound/InChI=1S/C2H3Cl/c1-2-3/h2H,1H2
+- http://local-ot/compound/InChI=1S/C6H5N2.BF4/c7-8-6-4-2-1-3-5-6;2-1(3,4)5/h1-5H;/q+1;-1
+- http://local-ot/compound/InChI=1S/C6H12N4O2/c1-5-3-9(7-11)4-6(2)10(5)8-12/h5-6H,3-4H2,1-2H3
+- http://local-ot/compound/InChI=1S/C5H13N3O/c1-7(2)4-5-8(3)6-9/h4-5H2,1-3H3
+- http://local-ot/compound/InChI=1S/C6H12N2O2/c1-5-3-8(7-9)4-6(2)10-5/h5-6H,3-4H2,1-2H3
+- http://local-ot/compound/InChI=1S/C4H6N2O3/c1-3-2-6(5-8)4(7)9-3/h3H,2H2,1H3
+- http://local-ot/compound/InChI=1S/C4H8N2O3/c1-3-9-4(7)6(2)5-8/h3H2,1-2H3
+- http://local-ot/compound/InChI=1S/C3H6N2O2/c6-4-5-1-2-7-3-5/h1-3H2
+- http://local-ot/compound/InChI=1S/C9H11N3O2/c10-9(13)12(11-14)7-6-8-4-2-1-3-5-8/h1-5H,6-7H2,(H2,10,13)
+- http://local-ot/compound/InChI=1S/C3H6N2O/c6-4-5-2-1-3-5/h1-3H2
+- http://local-ot/compound/InChI=1S/BF4.Na/c2-1(3,4)5;/q-1;+1
data_entries:
- http://localhost/compound/InChI=1S/C14H8Cl4/c15-11-5-1-9(2-6-11)13(14(17)18)10-3-7-12(16)8-4-10/h1-8H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C14H8Cl4/c15-11-5-1-9(2-6-11)13(14(17)18)10-3-7-12(16)8-4-10/h1-8H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C3H6ClNO/c1-5(2)3(4)6/h1-2H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C3H6ClNO/c1-5(2)3(4)6/h1-2H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C2H8N2O/c3-4-1-2-5/h4-5H,1-3H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H8N2O/c3-4-1-2-5/h4-5H,1-3H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C4H10N2O3/c1-6(5-9)2-4(8)3-7/h4,7-8H,2-3H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H10N2O3/c1-6(5-9)2-4(8)3-7/h4,7-8H,2-3H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/CH2O/c1-2/h1H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/CH2O/c1-2/h1H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C5H12N2O4/c8-2-1-7(6-11)3-5(10)4-9/h5,8-10H,1-4H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H12N2O4/c8-2-1-7(6-11)3-5(10)4-9/h5,8-10H,1-4H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C7H15N3O/c1-6-4-10(8-11)5-7(2)9(6)3/h6-7H,4-5H2,1-3H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C7H15N3O/c1-6-4-10(8-11)5-7(2)9(6)3/h6-7H,4-5H2,1-3H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C4H8N2O2/c7-5-6-1-3-8-4-2-6/h1-4H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H8N2O2/c7-5-6-1-3-8-4-2-6/h1-4H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C16H13N/c1-2-8-15(9-3-1)17-16-11-10-13-6-4-5-7-14(13)12-16/h1-12,17H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C16H13N/c1-2-8-15(9-3-1)17-16-11-10-13-6-4-5-7-14(13)12-16/h1-12,17H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C3H6O2/c4-1-3-2-5-3/h3-4H,1-2H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C3H6O2/c4-1-3-2-5-3/h3-4H,1-2H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C4H6N2O3/c1-3-2-6(5-8)4(7)9-3/h3H,2H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H6N2O3/c1-3-2-6(5-8)4(7)9-3/h3H,2H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H5NO2/c8-6(9)5-1-3-7-4-2-5/h1-4H,(H,8,9):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H5NO2/c8-6(9)5-1-3-7-4-2-5/h1-4H,(H,8,9):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/2C2H4O2.4H2O.3Pb/c2*1-2(3)4;;;;;;;/h2*1H3,(H,3,4);4*1H2;;;/q;;;;;;3*+2/p-6:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/2C2H4O2.4H2O.3Pb/c2*1-2(3)4;;;;;;;/h2*1H3,(H,3,4);4*1H2;;;/q;;;;;;3*+2/p-6:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C17H17ClO6/c1-8-5-9(19)6-12(23-4)17(8)16(20)13-10(21-2)7-11(22-3)14(18)15(13)24-17/h6-8H,5H2,1-4H3/t8-,17?/m1/s1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C17H17ClO6/c1-8-5-9(19)6-12(23-4)17(8)16(20)13-10(21-2)7-11(22-3)14(18)15(13)24-17/h6-8H,5H2,1-4H3/t8-,17?/m1/s1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C3H6N2O2/c6-4-5-1-2-7-3-5/h1-3H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C3H6N2O2/c6-4-5-1-2-7-3-5/h1-3H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C3H7NO2/c1-2-6-3(4)5/h2H2,1H3,(H2,4,5):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C3H7NO2/c1-2-6-3(4)5/h2H2,1H3,(H2,4,5):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C5H8O2/c1-4(2)5(6)7-3/h1H2,2-3H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H8O2/c1-4(2)5(6)7-3/h1H2,2-3H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C2H6N2O/c1-4(3)2-5/h2H,3H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H6N2O/c1-4(3)2-5/h2H,3H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H12N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h6,9,11H,2-4H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H12N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h6,9,11H,2-4H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C5H4O2/c6-4-5-2-1-3-7-5/h1-4H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H4O2/c6-4-5-2-1-3-7-5/h1-4H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C4H8N2O/c7-5-6-3-1-2-4-6/h1-4H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H8N2O/c7-5-6-3-1-2-4-6/h1-4H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C9H11N3O2/c10-9(13)12(11-14)7-6-8-4-2-1-3-5-8/h1-5H,6-7H2,(H2,10,13):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C9H11N3O2/c10-9(13)12(11-14)7-6-8-4-2-1-3-5-8/h1-5H,6-7H2,(H2,10,13):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C14H14ClN3O2S/c1-8-4-3-5-10(9(8)2)16-12-6-11(15)17-14(18-12)21-7-13(19)20/h3-6H,7H2,1-2H3,(H,19,20)(H,16,17,18):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C14H14ClN3O2S/c1-8-4-3-5-10(9(8)2)16-12-6-11(15)17-14(18-12)21-7-13(19)20/h3-6H,7H2,1-2H3,(H,19,20)(H,16,17,18):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/H4N2.H2O4S/c1-2;1-5(2,3)4/h1-2H2;(H2,1,2,3,4):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/H4N2.H2O4S/c1-2;1-5(2,3)4/h1-2H2;(H2,1,2,3,4):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C5H10N2O/c8-6-7-4-2-1-3-5-7/h1-5H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H10N2O/c8-6-7-4-2-1-3-5-7/h1-5H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C10H13N3O2/c1-13(12-15)7-3-5-10(14)9-4-2-6-11-8-9/h2,4,6,8H,3,5,7H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C10H13N3O2/c1-13(12-15)7-3-5-10(14)9-4-2-6-11-8-9/h2,4,6,8H,3,5,7H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C3H6N2O/c6-4-5-2-1-3-5/h1-3H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C3H6N2O/c6-4-5-2-1-3-5/h1-3H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C4H8N2O3/c1-3-9-4(7)6(2)5-8/h3H2,1-2H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H8N2O3/c1-3-9-4(7)6(2)5-8/h3H2,1-2H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H10N2O2/c1-3-4-8(7-10)5-6(2)9/h3H,1,4-5H2,2H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H10N2O2/c1-3-4-8(7-10)5-6(2)9/h3H,1,4-5H2,2H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C14H9Cl5/c15-11-5-1-9(2-6-11)13(14(17,18)19)10-3-7-12(16)8-4-10/h1-8,13H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C14H9Cl5/c15-11-5-1-9(2-6-11)13(14(17,18)19)10-3-7-12(16)8-4-10/h1-8,13H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/BrHO3.K/c2-1(3)4;/h(H,2,3,4);/q;+1/p-1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/BrHO3.K/c2-1(3)4;/h(H,2,3,4);/q;+1/p-1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C2H5ClO/c1-4-2-3/h2H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H5ClO/c1-4-2-3/h2H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C10H12ClNO2/c1-7(2)14-10(13)12-9-5-3-4-8(11)6-9/h3-7H,1-2H3,(H,12,13):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C10H12ClNO2/c1-7(2)14-10(13)12-9-5-3-4-8(11)6-9/h3-7H,1-2H3,(H,12,13):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C8H5N3O4S/c12-4-9-8-10-5(3-16-8)6-1-2-7(15-6)11(13)14/h1-4H,(H,9,10,12):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C8H5N3O4S/c12-4-9-8-10-5(3-16-8)6-1-2-7(15-6)11(13)14/h1-4H,(H,9,10,12):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/Cd.2ClH/h;2*1H/q+2;;/p-2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/Cd.2ClH/h;2*1H/q+2;;/p-2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C20H19N3.ClH/c1-13-12-16(6-11-19(13)23)20(14-2-7-17(21)8-3-14)15-4-9-18(22)10-5-15;/h2-12,21H,22-23H2,1H3;1H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C20H19N3.ClH/c1-13-12-16(6-11-19(13)23)20(14-2-7-17(21)8-3-14)15-4-9-18(22)10-5-15;/h2-12,21H,22-23H2,1H3;1H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/BF4.Na/c2-1(3,4)5;/q-1;+1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/BF4.Na/c2-1(3,4)5;/q-1;+1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C6H5N2.BF4/c7-8-6-4-2-1-3-5-6;2-1(3,4)5/h1-5H;/q+1;-1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H5N2.BF4/c7-8-6-4-2-1-3-5-6;2-1(3,4)5/h1-5H;/q+1;-1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C2H4N4/c3-2-4-1-5-6-2/h1H,(H3,3,4,5,6):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H4N4/c3-2-4-1-5-6-2/h1H,(H3,3,4,5,6):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C9H6O2/c10-9-6-5-7-3-1-2-4-8(7)11-9/h1-6H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C9H6O2/c10-9-6-5-7-3-1-2-4-8(7)11-9/h1-6H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C2HCl3/c3-1-2(4)5/h1H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2HCl3/c3-1-2(4)5/h1H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C2H8N2/c1-4(2)3/h3H2,1-2H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H8N2/c1-4(2)3/h3H2,1-2H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H7N3O/c7-9-6(10)5-1-3-8-4-2-5/h1-4H,7H2,(H,9,10):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H7N3O/c7-9-6(10)5-1-3-8-4-2-5/h1-4H,7H2,(H,9,10):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C12H8Cl6O/c13-8-9(14)11(16)5-3-1-2(6-7(3)19-6)4(5)10(8,15)12(11,17)18/h2-7H,1H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C12H8Cl6O/c13-8-9(14)11(16)5-3-1-2(6-7(3)19-6)4(5)10(8,15)12(11,17)18/h2-7H,1H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/Cd.H2O4S/c;1-5(2,3)4/h;(H2,1,2,3,4)/q+2;/p-2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/Cd.H2O4S/c;1-5(2,3)4/h;(H2,1,2,3,4)/q+2;/p-2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C5H10N2O3/c1-5(9)4-7(6-10)2-3-8/h8H,2-4H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H10N2O3/c1-5(9)4-7(6-10)2-3-8/h8H,2-4H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C27H30O16/c1-8-17(32)20(35)22(37)26(40-8)39-7-15-18(33)21(36)23(38)27(42-15)43-25-19(34)16-13(31)5-10(28)6-14(16)41-24(25)9-2-3-11(29)12(30)4-9/h2-6,8,15,17-18,20-23,26-33,35-38H,7H2,1H3/t8-,15+,17-,18+,20+,21-,22+,23+,26+,27?/m0/s1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C27H30O16/c1-8-17(32)20(35)22(37)26(40-8)39-7-15-18(33)21(36)23(38)27(42-15)43-25-19(34)16-13(31)5-10(28)6-14(16)41-24(25)9-2-3-11(29)12(30)4-9/h2-6,8,15,17-18,20-23,26-33,35-38H,7H2,1H3/t8-,15+,17-,18+,20+,21-,22+,23+,26+,27?/m0/s1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C12H12N2O3/c1-2-12(8-6-4-3-5-7-8)9(15)13-11(17)14-10(12)16/h3-7H,2H2,1H3,(H2,13,14,15,16,17):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C12H12N2O3/c1-2-12(8-6-4-3-5-7-8)9(15)13-11(17)14-10(12)16/h3-7H,2H2,1H3,(H2,13,14,15,16,17):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C8H6N4O4S/c13-4-9-11-8-10-5(3-17-8)6-1-2-7(16-6)12(14)15/h1-4H,(H,9,13)(H,10,11):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C8H6N4O4S/c13-4-9-11-8-10-5(3-17-8)6-1-2-7(16-6)12(14)15/h1-4H,(H,9,13)(H,10,11):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C9H7N3O4S/c1-5(13)10-9-11-6(4-17-9)7-2-3-8(16-7)12(14)15/h2-4H,1H3,(H,10,11,13):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C9H7N3O4S/c1-5(13)10-9-11-6(4-17-9)7-2-3-8(16-7)12(14)15/h2-4H,1H3,(H,10,11,13):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/CH6N2/c1-3-2/h3H,2H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/CH6N2/c1-3-2/h3H,2H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C12H9NO2/c14-13(15)11-7-6-9-5-4-8-2-1-3-10(11)12(8)9/h1-3,6-7H,4-5H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C12H9NO2/c14-13(15)11-7-6-9-5-4-8-2-1-3-10(11)12(8)9/h1-3,6-7H,4-5H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C15H10O7.2H2O/c16-7-4-10(19)12-11(5-7)22-15(14(21)13(12)20)6-1-2-8(17)9(18)3-6;;/h1-5,16-19,21H;2*1H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C15H10O7.2H2O/c16-7-4-10(19)12-11(5-7)22-15(14(21)13(12)20)6-1-2-8(17)9(18)3-6;;/h1-5,16-19,21H;2*1H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C7H6O4/c8-5-2-1-4(7(10)11)3-6(5)9/h1-3,8-9H,(H,10,11):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C7H6O4/c8-5-2-1-4(7(10)11)3-6(5)9/h1-3,8-9H,(H,10,11):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C9H9NS/c11-8-10-7-6-9-4-2-1-3-5-9/h1-5H,6-7H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C9H9NS/c11-8-10-7-6-9-4-2-1-3-5-9/h1-5H,6-7H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C20H22O3/c1-20(2,19(21)22)23-16-12-10-15(11-13-16)18-9-5-7-14-6-3-4-8-17(14)18/h3-4,6,8,10-13,18H,5,7,9H2,1-2H3,(H,21,22):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C20H22O3/c1-20(2,19(21)22)23-16-12-10-15(11-13-16)18-9-5-7-14-6-3-4-8-17(14)18/h3-4,6,8,10-13,18H,5,7,9H2,1-2H3,(H,21,22):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C6H12N2O2/c1-5-3-8(7-9)4-6(2)10-5/h5-6H,3-4H2,1-2H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H12N2O2/c1-5-3-8(7-9)4-6(2)10-5/h5-6H,3-4H2,1-2H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C10H13NO2/c1-8(2)13-10(12)11-9-6-4-3-5-7-9/h3-8H,1-2H3,(H,11,12):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C10H13NO2/c1-8(2)13-10(12)11-9-6-4-3-5-7-9/h3-8H,1-2H3,(H,11,12):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C6H14N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h5-6,9-11H,2-4H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H14N2O4/c1-5(10)2-8(7-12)3-6(11)4-9/h5-6,9-11H,2-4H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C19H24N2O2/c22-18-13-20(19(23)15-7-2-1-3-8-15)12-17-16-9-5-4-6-14(16)10-11-21(17)18/h4-6,9,15,17H,1-3,7-8,10-13H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C19H24N2O2/c22-18-13-20(19(23)15-7-2-1-3-8-15)12-17-16-9-5-4-6-14(16)10-11-21(17)18/h4-6,9,15,17H,1-3,7-8,10-13H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C5H11N3O3/c1-2-8(7-11)5(10)6-3-4-9/h9H,2-4H2,1H3,(H,6,10):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H11N3O3/c1-2-8(7-11)5(10)6-3-4-9/h9H,2-4H2,1H3,(H,6,10):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C14H19N3S.ClH/c1-16(2)9-10-17(12-13-6-5-11-18-13)14-7-3-4-8-15-14;/h3-8,11H,9-10,12H2,1-2H3;1H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C14H19N3S.ClH/c1-16(2)9-10-17(12-13-6-5-11-18-13)14-7-3-4-8-15-14;/h3-8,11H,9-10,12H2,1-2H3;1H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/H4N2/c1-2/h1-2H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/H4N2/c1-2/h1-2H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C4H5Cl/c1-3-4(2)5/h3H,1-2H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H5Cl/c1-3-4(2)5/h3H,1-2H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C17H17ClO3/c1-17(2,16(19)20)21-11-12-3-5-13(6-4-12)14-7-9-15(18)10-8-14/h3-10H,11H2,1-2H3,(H,19,20):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C17H17ClO3/c1-17(2,16(19)20)21-11-12-3-5-13(6-4-12)14-7-9-15(18)10-8-14/h3-10H,11H2,1-2H3,(H,19,20):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C2H8N2.2ClH/c1-3-4-2;;/h3-4H,1-2H3;2*1H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H8N2.2ClH/c1-3-4-2;;/h3-4H,1-2H3;2*1H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H10ClN3O3/c1-5(11)4-10(9-13)6(12)8-3-2-7/h2-4H2,1H3,(H,8,12):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H10ClN3O3/c1-5(11)4-10(9-13)6(12)8-3-2-7/h2-4H2,1H3,(H,8,12):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H11N3O3/c1-3-9(8-12)6(11)7-4-5(2)10/h3-4H2,1-2H3,(H,7,11):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H11N3O3/c1-3-9(8-12)6(11)7-4-5(2)10/h3-4H2,1-2H3,(H,7,11):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C11H8N2O5/c12-11(14)8(9-2-1-5-17-9)6-7-3-4-10(18-7)13(15)16/h1-6H,(H2,12,14):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C11H8N2O5/c12-11(14)8(9-2-1-5-17-9)6-7-3-4-10(18-7)13(15)16/h1-6H,(H2,12,14):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C5H13N3O/c1-7(2)4-5-8(3)6-9/h4-5H2,1-3H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H13N3O/c1-7(2)4-5-8(3)6-9/h4-5H2,1-3H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C15H13NO/c1-10(17)16-13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9H,8H2,1H3,(H,16,17):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C15H13NO/c1-10(17)16-13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9H,8H2,1H3,(H,16,17):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C5H6N2OS/c1-3-2-4(8)7-5(9)6-3/h2H,1H3,(H2,6,7,8,9):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C5H6N2OS/c1-3-2-4(8)7-5(9)6-3/h2H,1H3,(H2,6,7,8,9):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C9H11N3O/c13-11-12-6-2-4-9(12)8-3-1-5-10-7-8/h1,3,5,7,9H,2,4,6H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C9H11N3O/c13-11-12-6-2-4-9(12)8-3-1-5-10-7-8/h1,3,5,7,9H,2,4,6H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H12N4O2/c1-5-3-9(7-11)4-6(2)10(5)8-12/h5-6H,3-4H2,1-2H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H12N4O2/c1-5-3-9(7-11)4-6(2)10(5)8-12/h5-6H,3-4H2,1-2H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C19H17N3.ClH/c20-16-7-1-13(2-8-16)19(14-3-9-17(21)10-4-14)15-5-11-18(22)12-6-15;/h1-12,20H,21-22H2;1H:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C19H17N3.ClH/c20-16-7-1-13(2-8-16)19(14-3-9-17(21)10-4-14)15-5-11-18(22)12-6-15;/h1-12,20H,21-22H2;1H:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/HNO2.Na/c2-1-3;/h(H,2,3);/q;+1/p-1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/HNO2.Na/c2-1-3;/h(H,2,3);/q;+1/p-1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C6Cl6/c7-1-2(8)4(10)6(12)5(11)3(1)9:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6Cl6/c7-1-2(8)4(10)6(12)5(11)3(1)9:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C2H3Cl/c1-2-3/h2H,1H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H3Cl/c1-2-3/h2H,1H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C6H10N2O/c1-3-5-8(7-9)6-4-2/h3-4H,1-2,5-6H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C6H10N2O/c1-3-5-8(7-9)6-4-2/h3-4H,1-2,5-6H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C9H11N3O2/c13-10-12-6-2-4-9(12)8-3-1-5-11(14)7-8/h1,3,5,7,9H,2,4,6H2:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C9H11N3O2/c13-10-12-6-2-4-9(12)8-3-1-5-11(14)7-8/h1,3,5,7,9H,2,4,6H2:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C15H13NO2/c1-10(17)16(18)13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9,18H,8H2,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C15H13NO2/c1-10(17)16(18)13-6-7-15-12(9-13)8-11-4-2-3-5-14(11)15/h2-7,9,18H,8H2,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C20H22N8O5/c1-28(9-11-8-23-17-15(24-11)16(21)26-20(22)27-17)12-4-2-10(3-5-12)18(31)25-13(19(32)33)6-7-14(29)30/h2-5,8,13H,6-7,9H2,1H3,(H,25,31)(H,29,30)(H,32,33)(H4,21,22,23,26,27)/t13-/m0/s1:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C20H22N8O5/c1-28(9-11-8-23-17-15(24-11)16(21)26-20(22)27-17)12-4-2-10(3-5-12)18(31)25-13(19(32)33)6-7-14(29)30/h2-5,8,13H,6-7,9H2,1H3,(H,25,31)(H,29,30)(H,32,33)(H4,21,22,23,26,27)/t13-/m0/s1:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- false
- http://localhost/compound/InChI=1S/C4H7N3O3/c1-3(8)2-7(6-10)4(5)9/h2H2,1H3,(H2,5,9):
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C4H7N3O3/c1-3(8)2-7(6-10)4(5)9/h2H2,1H3,(H2,5,9):
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
- http://localhost/compound/InChI=1S/C2H4O/c1-2-3/h2H,1H3:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/compound/InChI=1S/C2H4O/c1-2-3/h2H,1H3:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
- true
features:
- http://localhost/dataset/1/feature/hamster_carcinogenicity:
+ http://local-ot/dataset/1/feature/hamster_carcinogenicity:
http://www.opentox.org/api/1.1#hasSource: hamster_carcinogenicity.csv
http://purl.org/dc/elements/1.1/title: hamster_carcinogenicity
metadata:
http://www.opentox.org/api/1.1#hasSource: hamster_carcinogenicity.csv
http://purl.org/dc/elements/1.1/title: hamster_carcinogenicity
- http://www.w3.org/2001/XMLSchema#anyUri: http://localhost/dataset/1
-uri: http://localhost/dataset/1
+ http://www.w3.org/2001/XMLSchema#anyUri: http://local-ot/dataset/1
+uri: http://local-ot/dataset/1
diff --git a/example.rb b/example.rb
index 1b4ee98..3cced72 100755
--- a/example.rb
+++ b/example.rb
@@ -6,9 +6,9 @@ class Example
@@file=File.new("data/hamster_carcinogenicity.yaml","r")
@@file_type="text/x-yaml"
@@model=File.join CONFIG[:services]["opentox-model"],"1"
- #@@feature= URI.encode("http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)")
+ #@@feature= URI.encode("http://local-ot/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)")
@@feature= File.join CONFIG[:services]["opentox-dataset"],"1/feature/hamster_carcinogenicity"
- #@@predicted_feature= URI.encode("http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)_lazar_classification")
+ #@@predicted_feature= URI.encode("http://local-ot/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)_lazar_classification")
@@alg = File.join CONFIG[:services]["opentox-algorithm"],"lazar"
@@alg_params = "feature_generation_uri="+File.join(CONFIG[:services]["opentox-algorithm"],"fminer/bbrc")
@@data=File.join CONFIG[:services]["opentox-dataset"],"1"
@@ -54,6 +54,10 @@ class Example
# creates the resources that are requested by the examples
def self.prepare_example_resources
+
+ #TODO
+ subjectid = nil
+
task = OpenTox::Task.create("prepare examples", "n/a") do |task|
@@summary = ""
#delete validations
@@ -103,12 +107,12 @@ class Example
log "create validation report"
rep = Reports::ReportService.instance(File.join(CONFIG[:services]["opentox-validation"],"report"))
- rep.delete_all_reports("validation")
+ rep.delete_all_reports("validation", subjectid)
rep.create_report("validation",v.validation_uri)
task.progress(80)
log "create crossvalidation report"
- rep.delete_all_reports("crossvalidation")
+ rep.delete_all_reports("crossvalidation", subjectid)
rep.create_report("crossvalidation",cv.crossvalidation_uri)
task.progress(90)
diff --git a/lib/active_record_setup.rb b/lib/active_record_setup.rb
index 404bfec..b43e692 100755
--- a/lib/active_record_setup.rb
+++ b/lib/active_record_setup.rb
@@ -33,11 +33,11 @@ class ActiveRecord::Base
key = key+"s"
unless self.column_names.include?(key)
err = "no attribute found: '"+k.to_s+"'"
- if $sinatra
- $sinatra.halt 400,err
- else
+# if $sinatra
+# $sinatra.halt 400,err
+# else
raise err
- end
+# end
end
end
end
diff --git a/lib/format_util.rb b/lib/format_util.rb
index c1f5e7c..3d3a3e6 100644
--- a/lib/format_util.rb
+++ b/lib/format_util.rb
@@ -4,6 +4,7 @@ class String
# :prediction_feature -> predictionFeature
# :test_dataset_uri -> testDataset
+ # :validation_uris -> validation
def to_rdf_format
s = gsub(/_uri(s|)$/,"")
s.gsub(/_./) do |m|
@@ -18,6 +19,18 @@ class String
end
end
+ DC_KEYS = [ "title", "creator", "date", "format" ]
+ RDF_KEYS = [ "type" ]
+
+ def to_owl_uri
+ if DC_KEYS.include?(self)
+ return DC.send(self)
+ elsif RDF_KEYS.include?(self)
+ return RDF.send(self)
+ else
+ return OT.send(self)
+ end
+ end
end
class Hash
@@ -36,5 +49,20 @@ class Hash
end
return res
end
+
+ def keys_to_owl_uris
+ res = {}
+ keys.each do |k|
+ v = self[k]
+ if v.is_a?(Hash)
+ v = v.keys_to_owl_uris
+ elsif v.is_a?(Array)
+ v = v.collect{ |vv| vv.is_a?(Hash) ? vv.keys_to_owl_uris : vv }
+ end
+ res[k.to_s.to_owl_uri] = v
+ end
+ return res
+ end
+
end
diff --git a/lib/validation_db.rb b/lib/validation_db.rb
index 83b7e2f..4b852f9 100755
--- a/lib/validation_db.rb
+++ b/lib/validation_db.rb
@@ -80,16 +80,26 @@ module Lib
property :regression_statistics, Object
property :finished, Boolean, :default => false
+ attr_accessor :subjectid
+
+ after :save, :check_policy
+ private
+ def check_policy
+ OpenTox::Authorization.check_policy(validation_uri, subjectid)
+ end
+
+ public
def date
created_at
end
def validation_uri
- $sinatra.url_for("/"+self.id.to_s, :full)
+ raise "no id" if self.id==nil
+ $url_provider.url_for("/"+self.id.to_s, :full)
end
def crossvalidation_uri
- $sinatra.url_for("/crossvalidation/"+self.crossvalidation_id.to_s, :full) if self.crossvalidation_id
+ $url_provider.url_for("/crossvalidation/"+self.crossvalidation_id.to_s, :full) if self.crossvalidation_id
end
def self.classification_property?( property )
@@ -120,12 +130,22 @@ module Lib
property :finished, Boolean, :default => false
property :stratified, Boolean, :default => false
+ attr_accessor :subjectid
+
+ after :save, :check_policy
+ private
+ def check_policy
+ OpenTox::Authorization.check_policy(crossvalidation_uri, subjectid)
+ end
+
+ public
def date
created_at
end
def crossvalidation_uri
- $sinatra.url_for("/crossvalidation/"+self.id.to_s, :full) if self.id
+ raise "no id" if self.id==nil
+ $url_provider.url_for("/crossvalidation/"+self.id.to_s, :full) if self.id
end
# convenience method to list all crossvalidations that are unique
diff --git a/reach_reports/reach_application.rb b/reach_reports/reach_application.rb
index 4187c1b..fd77078 100755
--- a/reach_reports/reach_application.rb
+++ b/reach_reports/reach_application.rb
@@ -20,8 +20,8 @@ get '/reach_report' do
if request.env['HTTP_ACCEPT'] =~ /text\/html/
content_type "text/html"
related_links =
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Validation reporting: "+$sinatra.url_for("/report",:full)
+ "All validations: "+url_for("/",:full)+"\n"+
+ "Validation reporting: "+url_for("/report",:full)
description =
"A list of all suported REACH reporting types."
OpenTox.text_to_html uri_list,related_links,description
@@ -37,7 +37,7 @@ get '/reach_report/:type' do
if request.env['HTTP_ACCEPT'] =~ /text\/html/
content_type "text/html"
related_links =
- "All REACH reporting types: "+$sinatra.url_for("/reach_report",:full)
+ "All REACH reporting types: "+url_for("/reach_report",:full)
description =
"A list of "+type+" reports."
post_params = ""
@@ -95,7 +95,7 @@ get '/reach_report/:type/:id' do
content_type "text/html"
related_links =
"Open report in QMRF editor: "+rep.report_uri+"/editor"+"\n"+
- "All "+type+" reports: "+$sinatra.url_for("/reach_report/"+type,:full)
+ "All "+type+" reports: "+url_for("/reach_report/"+type,:full)
description =
"A QMRF report."
OpenTox.text_to_html rep.to_yaml,related_links,description
diff --git a/reach_reports/reach_persistance.rb b/reach_reports/reach_persistance.rb
index a36e05f..ec45ba4 100755
--- a/reach_reports/reach_persistance.rb
+++ b/reach_reports/reach_persistance.rb
@@ -400,7 +400,7 @@ module ReachReports
def self.get_uri( report )
raise "internal error, id not set "+to_yaml if report.id==nil
- return $sinatra.url_for("/"+File.join(report.type,report.id.to_s), :full).to_s
+ return $url_provider.url_for("/"+File.join(report.type,report.id.to_s), :full).to_s
end
@@ -1006,7 +1006,7 @@ module ReachReports
end
def report_uri
- return $sinatra.url_for("/reach_report/QMRF/"+@id.to_s, :full).to_s
+ return $url_provider.url_for("/reach_report/QMRF/"+@id.to_s, :full).to_s
end
def self.from_xml(report, xml_data)
diff --git a/reach_reports/reach_service.rb b/reach_reports/reach_service.rb
index 808d08a..5e11dc1 100755
--- a/reach_reports/reach_service.rb
+++ b/reach_reports/reach_service.rb
@@ -27,7 +27,7 @@ module ReachReports
when /(?i)QMRF/
if params[:model_uri]
task = OpenTox::Task.create( "Create "+type+" report",
- $sinatra.url_for("/reach_report/"+type, :full) ) do |task| #, params
+ $url_provider.url_for("/reach_report/"+type, :full) ) do |task| #, params
report = ReachReports::QmrfReport.new :model_uri => params[:model_uri]
build_qmrf_report(report, task)
@@ -39,17 +39,17 @@ module ReachReports
ReachReports::QmrfReport.from_xml(report,input)
result_uri = report.report_uri
else
- $sinatra.halt 400, "illegal parameters for qmrf-report creation, either\n"+
+ raise OpenTox::BadRequestError.new "illegal parameters for qmrf-report creation, either\n"+
"* give 'model_uri' as param\n"+
"* provide xml file\n"+
"params given: "+params.inspect
end
when /(?i)QPRF/
- $sinatra.halt 400,"qprf report creation not yet implemented"
+ raise OpenTox::BadRequestError.new "qprf report creation not yet implemented"
if params[:compound_uri]
#report = ReachReports::QprfReport.new :compound_uri => params[:compound_uri]
else
- $sinatra.halt 400, "illegal parameters for qprf-report, use either\n"+
+ raise OpenTox::BadRequestError.new "illegal parameters for qprf-report, use either\n"+
"* compound-uri\n"+
"params given: "+params.inspect
end
@@ -294,7 +294,7 @@ module ReachReports
when /(?i)QPRF/
report = ReachReports::QprfReport.get(id)
end
- $sinatra.halt 404, type+" report with id '#{id}' not found." unless report
+ raise OpenTox::NotFoundError.new type+" report with id '#{id}' not found." unless report
return report
end
end
diff --git a/reach_reports/reach_test.rb b/reach_reports/reach_test.rb
index 13625e5..4f7113b 100755
--- a/reach_reports/reach_test.rb
+++ b/reach_reports/reach_test.rb
@@ -11,10 +11,10 @@ LOGGER = OTLogger.new(STDOUT)
LOGGER.datetime_format = "%Y-%m-%d %H:%M:%S "
LOGGER.formatter = Logger::Formatter.new
-#Rack::Test::DEFAULT_HOST = "localhost/validation"
+#Rack::Test::DEFAULT_HOST = "local-ot/validation"
module Sinatra
module UrlForHelper
- BASE = "http://localhost/validation"
+ BASE = "http://local-ot/validation"
def url_for url_fragment, mode=:path_only
case mode
when :path_only
@@ -109,19 +109,19 @@ class ReachTest < Test::Unit::TestCase
# raise "File not found: "+file.path.to_s unless File.exist?(file.path)
# data = File.read(file.path)
# #puts "data found "+data.to_s[0..1000]
-# puts OpenTox::RestClientWrapper.post("http://localhost/validation/reach_report/qmrf/20",{:content_type => "application/qmrf-xml"},data).to_s.chomp
+# puts OpenTox::RestClientWrapper.post("http://local-ot/validation/reach_report/qmrf/20",{:content_type => "application/qmrf-xml"},data).to_s.chomp
# post "/reach_report/qmrf/8"
# puts last_response.body
#model_uri = "http://ambit.uni-plovdiv.bg:8080/ambit2/model/173393"
- model_uri = "http://localhost/model/1"
- #http://localhost/majority/class/model/15
- #model_uri = "http://localhost/majority/class/model/15"
- # model_uri = "http://localhost/majority/class/model/91"
+ model_uri = "http://local-ot/model/1"
+ #http://local-ot/majority/class/model/15
+ #model_uri = "http://local-ot/majority/class/model/15"
+ # model_uri = "http://local-ot/majority/class/model/91"
#model_uri = "http://apps.ideaconsult.net:8080/ambit2/model/2"
- post '/reach_report/qmrf',:model_uri=>model_uri #http://localhost/model/1"
- ##post '/reach_report/qprf',:compound_uri=>"http://localhost/compound/XYZ"
+ post '/reach_report/qmrf',:model_uri=>model_uri #http://local-ot/model/1"
+ ##post '/reach_report/qprf',:compound_uri=>"http://local-ot/compound/XYZ"
uri = last_response.body
puts "task: "+uri.to_s
uri = Lib::TestUtil.wait_for_task(uri)
diff --git a/report/report_application.rb b/report/report_application.rb
index 6d6353f..b02b780 100755
--- a/report/report_application.rb
+++ b/report/report_application.rb
@@ -46,7 +46,7 @@ get '/report/?' do
case request.env['HTTP_ACCEPT'].to_s
when /text\/html/
related_links =
- "All validations: "+$sinatra.url_for("/",:full)
+ "All validations: "+url_for("/",:full)
description =
"A list of all report types."
content_type "text/html"
@@ -63,9 +63,9 @@ get '/report/:report_type' do
case request.env['HTTP_ACCEPT'].to_s
when /text\/html/
related_links =
- "Available report types: "+$sinatra.url_for("/report",:full)+"\n"+
- "Single validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Crossvalidations: "+$sinatra.url_for("/crossvalidation",:full)
+ "Available report types: "+url_for("/report",:full)+"\n"+
+ "Single validations: "+url_for("/",:full)+"\n"+
+ "Crossvalidations: "+url_for("/crossvalidation",:full)
description =
"A list of all "+params[:report_type]+" reports. To create a report, use the POST method."
post_params = [[:validation_uris]]
@@ -118,14 +118,14 @@ end
delete '/report/:type/:id' do
perform do |rs|
content_type "text/plain"
- rs.delete_report(params[:type],params[:id])
+ rs.delete_report(params[:type],params[:id],@subjectid)
end
end
post '/report/:type' do
task = OpenTox::Task.create("Create report",url_for("/report/"+params[:type], :full)) do |task| #,params
perform do |rs|
- rs.create_report(params[:type],params[:validation_uris]?params[:validation_uris].split(/\n|,/):nil,task)
+ rs.create_report(params[:type],params[:validation_uris]?params[:validation_uris].split(/\n|,/):nil,@subjectid,task)
end
end
content_type "text/uri-list"
diff --git a/report/report_persistance.rb b/report/report_persistance.rb
index d24c792..613e652 100755
--- a/report/report_persistance.rb
+++ b/report/report_persistance.rb
@@ -52,7 +52,7 @@ class Reports::ReportPersistance
# call-seq:
# delete_report(type, id) => boolean
#
- def delete_report(type, id)
+ def delete_report(type, id, subjectid=nil)
raise "not implemented"
end
@@ -104,7 +104,7 @@ class Reports::FileReportPersistance < Reports::ReportPersistance
return file_path
end
- def delete_report(type, id)
+ def delete_report(type, id, subjectid=nil)
report_dir = report_directory(type, id)
raise_report_not_found(type, id) unless File.directory?(report_dir)
@@ -192,7 +192,6 @@ module Reports
include DataMapper::Resource
property :id, Serial
- property :report_uri, String, :length => 255
property :report_type, String, :length => 255
property :created_at, DateTime
property :validation_uris, Object
@@ -200,10 +199,24 @@ module Reports
property :model_uris, Object
property :algorithm_uris, Object
+ attr_accessor :subjectid
+
+ after :save, :check_policy
+ private
+ def check_policy
+ OpenTox::Authorization.check_policy(report_uri, subjectid)
+ end
+
+ public
def date
created_at
end
+ def report_uri
+ raise "no id" if self.id==nil
+ Reports::ReportService.instance.get_uri(self.report_type, self.id)
+ end
+
def get_content_as_hash
map = {}
[ :date, :report_type, :validation_uris, :crossvalidation_uris,
@@ -214,25 +227,24 @@ module Reports
end
def to_yaml
- get_content_as_hash.to_yaml
+ get_content_as_hash.keys_to_rdf_format.keys_to_owl_uris.to_yaml
end
def to_rdf
- owl = OpenTox::Owl.create("ValidationReport",report_uri)
- owl.set_data(get_content_as_hash.keys_to_rdf_format)
- owl.rdf
+ s = OpenTox::Serializer::Owl.new
+ s.add_val(report_uri,OT.Report,get_content_as_hash.keys_to_rdf_format.keys_to_owl_uris)
+ s.to_rdfxml
end
end
class ExtendedFileReportPersistance < FileReportPersistance
- def new_report(report_content, type, meta_data, uri_provider)
+ def new_report(report_content, type, meta_data, uri_provider, subjectid=nil)
raise "report meta data missing" unless meta_data
report = ReportData.new(meta_data)
- report.save #to set id
-# report.attributes = { :report_type => type, :report_uri => uri_provider.get_uri(type, report.id) }
-# report.save
- report.update :report_type => type, :report_uri => uri_provider.get_uri(type, report.id)
+ report.subjectid = subjectid
+ report.report_type = type
+ report.save
new_report_with_id(report_content, type, report.id)
end
@@ -275,7 +287,7 @@ module Reports
end
end
- def delete_report(type, id)
+ def delete_report(type, id, subjectid=nil)
# begin
# report = ReportData.find(:first, :conditions => {:id => id, :report_type => type})
# rescue ActiveRecord::RecordNotFound
@@ -285,6 +297,14 @@ module Reports
report = ReportData.first({:id => id, :report_type => type})
raise Reports::NotFound.new("Report with id='"+id.to_s+"' and type='"+type.to_s+"' not found.") unless report
report.destroy
+ if (subjectid)
+ begin
+ res = OpenTox::Authorization.delete_policies_from_uri(report.report_uri, subjectid)
+ LOGGER.debug "Deleted validation policy: #{res}"
+ rescue
+ LOGGER.warn "Policy delete error for validation: #{report.report_uri}"
+ end
+ end
super
end
end
diff --git a/report/report_service.rb b/report/report_service.rb
index 5221b6d..dd1f6b3 100644
--- a/report/report_service.rb
+++ b/report/report_service.rb
@@ -60,7 +60,7 @@ module Reports
# call-seq:
# create_report(type, validation_uris) => string
#
- def create_report(type, validation_uris, task=nil)
+ def create_report(type, validation_uris, subjectid=nil, task=nil)
LOGGER.info "create report of type '"+type.to_s+"'"
check_report_type(type)
@@ -79,7 +79,7 @@ module Reports
LOGGER.debug "report created"
#step 3: persist report if creation not failed
- id = @@persistance.new_report(report_content, type, create_meta_data(type, validation_set, validation_uris), self)
+ id = @@persistance.new_report(report_content, type, create_meta_data(type, validation_set, validation_uris), self, subjectid)
LOGGER.debug "report persisted with id: '"+id.to_s+"'"
task.progress(100) if task
@@ -118,19 +118,19 @@ module Reports
# call-seq:
# delete_report( type, id )
#
- def delete_report( type, id )
+ def delete_report( type, id, subjectid=nil )
LOGGER.info "delete report '"+id.to_s+"' of type '"+type.to_s+"'"
check_report_type(type)
- @@persistance.delete_report(type, id)
+ @@persistance.delete_report(type, id, subjectid)
end
# no api-access for this method
- def delete_all_reports( type )
+ def delete_all_reports( type, subjectid=nil )
LOGGER.info "deleting all reports of type '"+type.to_s+"'"
check_report_type(type)
- @@persistance.list_reports(type).each{ |id| @@persistance.delete_report(type, id) }
+ @@persistance.list_reports(type).each{ |id| @@persistance.delete_report(type, id, subjectid) }
end
def parse_type( report_uri )
diff --git a/report/report_test.rb b/report/report_test.rb
index f579802..1f3e524 100755
--- a/report/report_test.rb
+++ b/report/report_test.rb
@@ -20,10 +20,10 @@ class Reports::ApplicationTest < Test::Unit::TestCase
# file = File.new("qmrf-report.xml")
# raise "File not found: "+file.path.to_s unless File.exist?(file.path)
# data = File.read(file.path)
-# puts OpenTox::RestClientWrapper.post("http://localhost/validation/report/qmrf/1",{:content_type => "application/qmrf-xml"},data).to_s.chomp
+# puts OpenTox::RestClientWrapper.post("http://local-ot/validation/report/qmrf/1",{:content_type => "application/qmrf-xml"},data).to_s.chomp
#get "/report/qmrf/1",nil,'HTTP_ACCEPT' => "application/qmrf-xml"#"application/rdf+xml"#"application/x-yaml"
-# get "/report/validation" # ?model=http://localhost/model/1" #,nil,'HTTP_ACCEPT' => "application/rdf+xml"#"application/x-yaml"
+# get "/report/validation" # ?model=http://local-ot/model/1" #,nil,'HTTP_ACCEPT' => "application/rdf+xml"#"application/x-yaml"
# puts last_response.body.to_s
#Reports::XMLReport.generate_demo_xml_report.write_to
@@ -33,9 +33,16 @@ class Reports::ApplicationTest < Test::Unit::TestCase
#puts uri
#get uri
- get '/report/crossvalidation',:model=>"http://localhost/majority/class/model/101"
- puts last_response.body.to_s
+ #get '/report/crossvalidation',:model=>"http://local-ot/majority/class/model/101"
+ #puts last_response.body.to_s
+ get '/report/validation/2',nil,'HTTP_ACCEPT' => "application/x-yaml"
+ puts last_response.body.to_s
+
+ get '/report/validation/2',nil,'HTTP_ACCEPT' => "application/rdf+xml"
+ puts last_response.body.to_s
+
+
#get '/report/validation/117',nil,'HTTP_ACCEPT' => "text/html"
#post '/report/validation/1/format_html',:css_style_sheet=>"http://apps.ideaconsult.net:8180/ToxPredict/style/global.css"
@@ -45,7 +52,7 @@ class Reports::ApplicationTest < Test::Unit::TestCase
#post 'http://ot.validation.de/report/crossvalidation',:validation_uris=>"http://ot.validation.de/crossvalidation/1"
#uri = last_response.body.to_s
-# val_uris = ["http://localhost/validation/64"]#,"http://localhost/validation/65" ]
+# val_uris = ["http://local-ot/validation/64"]#,"http://local-ot/validation/65" ]
#
# post '/report/validation',:validation_uris=>val_uris.join("\n")
# uri = wait_for_task(last_response.body.to_s)
@@ -129,7 +136,7 @@ end
# WS_CLASS_ALG=File.join(CONFIG[:services]["opentox-algorithm"],"lazar")
# WS_FEATURE_ALG=File.join(CONFIG[:services]["opentox-algorithm"],"fminer")
#
-# #WS_CLASS_ALG_2="localhost:4008/algorithm"
+# #WS_CLASS_ALG_2="local-ot:4008/algorithm"
# #WS_FEATURE_ALG_2=nil
#
# def test_service_ot_webservice
@@ -175,13 +182,13 @@ end
# #val_uri = create_cross_validation(data_uri, WS_CLASS_ALG_2, WS_FEATURE_ALG_2)
# #val_uri = create_cross_validation(data_uri)
# val_uri = File.join(WS_VAL,"crossvalidation/1")
-# #val_uri2 = "http://localhost:4007/crossvalidation/14"
+# #val_uri2 = "http://local-ot:4007/crossvalidation/14"
## # add_resource val_uri
# create_report(rep, val_uri, "crossvalidation")
#
## #val_uri2 = create_cross_validation(data_uri, WS_CLASS_ALG_2, WS_FEATURE_ALG_2)
-## #val_uri = ["http://localhost:4007/crossvalidation/6", "http://localhost:4007/crossvalidation/8"]
-# #val_uri = ["http://localhost:4007/crossvalidation/7", "http://localhost:4007/crossvalidation/8"]
+## #val_uri = ["http://local-ot:4007/crossvalidation/6", "http://local-ot:4007/crossvalidation/8"]
+# #val_uri = ["http://local-ot:4007/crossvalidation/7", "http://local-ot:4007/crossvalidation/8"]
## #add_resource val_uri
# #create_report(rep, val_uri, "algorithm_comparison")
#
diff --git a/report/xml_report.rb b/report/xml_report.rb
index 46f2a67..5f2709e 100755
--- a/report/xml_report.rb
+++ b/report/xml_report.rb
@@ -22,8 +22,8 @@ module Reports
include REXML
def self.dtd_directory
- if $sinatra
- $sinatra.url_for('/'+ENV['DOCBOOK_DIRECTORY']+'/'+ENV['REPORT_DTD'], :full)
+ if $url_provider
+ $url_provider.url_for('/'+ENV['DOCBOOK_DIRECTORY']+'/'+ENV['REPORT_DTD'], :full)
else
f = File.expand_path(File.join(ENV['DOCBOOK_DIRECTORY'],ENV['REPORT_DTD']))
raise "cannot find dtd" unless File.exist?(f)
diff --git a/test/test_examples.rb b/test/test_examples.rb
index 63fb505..45d7035 100755
--- a/test/test_examples.rb
+++ b/test/test_examples.rb
@@ -110,9 +110,11 @@ module ValidationExamples
class HamsterSplit < SplitTestValidation
def initialize
- @dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
- #@prediction_feature = "http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
- @prediction_feature = "http://localhost/dataset/1/feature/hamster_carcinogenicity"
+ #@dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
+ @dataset_file = File.new("data/hamster_carcinogenicity.csv","r")
+
+ #@prediction_feature = "http://local-ot/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
+ #@prediction_feature = "http://local-ot/dataset/1/feature/hamster_carcinogenicity"
end
end
@@ -135,9 +137,11 @@ module ValidationExamples
class HamsterBootstrapping < BootstrappingValidation
def initialize
- @dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
- #@prediction_feature = "http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
- @prediction_feature = "http://localhost/dataset/1/feature/hamster_carcinogenicity"
+ #@dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
+ @dataset_file = File.new("data/hamster_carcinogenicity.csv","r")
+
+ #@prediction_feature = "http://local-ot/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
+ #@prediction_feature = "http://local-ot/dataset/1/feature/hamster_carcinogenicity"
end
end
@@ -160,11 +164,17 @@ module ValidationExamples
class HamsterTrainingTest < TrainingTestValidation
def initialize
- @test_target_dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
- @training_dataset_file = File.new("data/hamster_carcinogenicity.train.yaml","r")
- @test_dataset_file = File.new("data/hamster_carcinogenicity.test.yaml","r")
- #@prediction_feature = "http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
- @prediction_feature = "http://localhost/dataset/1/feature/hamster_carcinogenicity"
+# @test_target_dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
+# @training_dataset_file = File.new("data/hamster_carcinogenicity.train.yaml","r")
+# @test_dataset_file = File.new("data/hamster_carcinogenicity.test.yaml","r")
+
+ @test_target_dataset_file = File.new("data/hamster_carcinogenicity.csv","r")
+ @training_dataset_file = File.new("data/hamster_carcinogenicity.train.csv","r")
+ @test_dataset_file = File.new("data/hamster_carcinogenicity.test.csv","r")
+
+
+ #@prediction_feature = "http://local-ot/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
+ #@prediction_feature = "http://local-ot/dataset/1/feature/hamster_carcinogenicity"
end
end
@@ -187,9 +197,11 @@ module ValidationExamples
class HamsterCrossvalidation < CrossValidation
def initialize
- @dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
- #@prediction_feature = "http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
- @prediction_feature = "http://localhost/dataset/1/feature/hamster_carcinogenicity"
+ #@dataset_file = File.new("data/hamster_carcinogenicity.yaml","r")
+ @dataset_file = File.new("data/hamster_carcinogenicity.csv","r")
+
+ #@prediction_feature = "http://local-ot/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)"
+ #@prediction_feature = "http://local-ot/dataset/1/feature/hamster_carcinogenicity"
@num_folds = 10
end
end
diff --git a/test/test_examples_util.rb b/test/test_examples_util.rb
index b9a1c99..9f11fe7 100755
--- a/test/test_examples_util.rb
+++ b/test/test_examples_util.rb
@@ -15,12 +15,12 @@ module ValidationExamples
#data_uri = OpenTox::RestClientWrapper.post(dataset_service,{:content_type => file_type},data).to_s.chomp
#@@dataset_uris[file.path.to_s] = data_uri
#LOGGER.debug "uploaded dataset: "+data_uri
- d = OpenTox::Dataset.create
+ d = OpenTox::Dataset.create(CONFIG[:services]["opentox-dataset"], SUBJECTID)
d.load_yaml(data)
- d.save
+ d.save( SUBJECTID )
@@dataset_uris[file.path.to_s] = d.uri
elsif (file.path =~ /csv$/)
- d = OpenTox::Dataset.create_from_csv_file(file.path)
+ d = OpenTox::Dataset.create_from_csv_file(file.path, SUBJECTID)
raise "num features not 1 (="+d.features.keys.size.to_s+"), what to predict??" if d.features.keys.size != 1
@@prediction_features[file.path.to_s] = d.features.keys[0]
@@dataset_uris[file.path.to_s] = d.uri
@@ -56,6 +56,7 @@ module ValidationExamples
def self.validation_post(uri, params)
+ params[:subjectid] = SUBJECTID if SUBJECTID and params[:subjectid]==nil
if $test_case
$test_case.post uri,params
return wait($test_case.last_response.body)
@@ -77,10 +78,10 @@ module ValidationExamples
def self.validation_delete(uri, accept_header='application/rdf+xml')
if $test_case
- $test_case.delete uri,nil,'HTTP_ACCEPT' => accept_header
+ $test_case.delete uri,{:subjectid => SUBJECTID},'HTTP_ACCEPT' => accept_header
return wait($test_case.last_response.body)
else
- return OpenTox::RestClientWrapper.delete(File.join(CONFIG[:services]["opentox-validation"],uri),{:accept => accept_header})
+ return OpenTox::RestClientWrapper.delete(File.join(CONFIG[:services]["opentox-validation"],uri),{:accept => accept_header,:subjectid => SUBJECTID})
end
end
@@ -242,7 +243,10 @@ module ValidationExamples
uri = a[0]
file = a[1]
if send(uri)==nil and send(file)!=nil
- send("#{uri.to_s}=".to_sym, Util.upload_dataset(send(file)))
+ dataset_uri = Util.upload_dataset(send(file))
+ send("#{uri.to_s}=".to_sym, dataset_uri)
+ @uploaded_datasets = [] unless @uploaded_datasets
+ @uploaded_datasets << dataset_uri
end
end
@@ -273,6 +277,14 @@ module ValidationExamples
rescue => ex
puts "Could not delete report:' "+@report_uri+" "+ex.message
end
+ @uploaded_datasets.each do |d|
+ begin
+ puts "deleting dataset "+d
+ OpenTox::RestClientWrapper.delete(d,{:subjectid => SUBJECTID})
+ rescue => ex
+ puts "Could not delete dataset:' "+d+" "+ex.message
+ end
+ end
end
def report
diff --git a/validation/validation_application.rb b/validation/validation_application.rb
index 9c6c60c..5d521a8 100755
--- a/validation/validation_application.rb
+++ b/validation/validation_application.rb
@@ -5,7 +5,6 @@ end
require 'lib/merge.rb'
#require 'lib/active_record_setup.rb'
-
require 'validation/validation_service.rb'
get '/crossvalidation/?' do
@@ -14,8 +13,8 @@ get '/crossvalidation/?' do
#uri_list = Validation::Crossvalidation.find_like(params).collect{ |cv| cv.crossvalidation_uri }.join("\n")+"\n"
if request.env['HTTP_ACCEPT'] =~ /text\/html/
related_links =
- "Single validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Crossvalidation reports: "+$sinatra.url_for("/report/crossvalidation",:full)
+ "Single validations: "+url_for("/",:full)+"\n"+
+ "Crossvalidation reports: "+url_for("/report/crossvalidation",:full)
description =
"A list of all crossvalidations.\n"+
"Use the POST method to perform a crossvalidation."
@@ -41,6 +40,7 @@ post '/crossvalidation/?' do
:algorithm_uri => params[:algorithm_uri] }
[ :num_folds, :random_seed, :stratified ].each{ |sym| cv_params[sym] = params[sym] if params[sym] }
cv = Validation::Crossvalidation.new cv_params
+ cv.subjectid = @subjectid
cv.perform_cv( params[:prediction_feature], params[:algorithm_params], task )
cv.crossvalidation_uri
end
@@ -61,6 +61,7 @@ post '/crossvalidation/cleanup/?' do
LOGGER.debug "delete cv with id:"+cv.id.to_s+", finished is false"
deleted << cv.crossvalidation_uri
#Validation::Crossvalidation.delete(cv.id)
+ cv.subjectid = @subjectid
cv.delete
#end
end
@@ -92,11 +93,11 @@ get '/crossvalidation/:id' do
crossvalidation.to_rdf
when /text\/html/
related_links =
- "Search for corresponding cv report: "+$sinatra.url_for("/report/crossvalidation?crossvalidation="+crossvalidation.crossvalidation_uri,:full)+"\n"+
- "Statistics for this crossvalidation: "+$sinatra.url_for("/crossvalidation/"+params[:id]+"/statistics",:full)+"\n"+
- "Predictions of this crossvalidation: "+$sinatra.url_for("/crossvalidation/"+params[:id]+"/predictions",:full)+"\n"+
- "All crossvalidations: "+$sinatra.url_for("/crossvalidation",:full)+"\n"+
- "All crossvalidation reports: "+$sinatra.url_for("/report/crossvalidation",:full)
+ "Search for corresponding cv report: "+url_for("/report/crossvalidation?crossvalidation="+crossvalidation.crossvalidation_uri,:full)+"\n"+
+ "Statistics for this crossvalidation: "+url_for("/crossvalidation/"+params[:id]+"/statistics",:full)+"\n"+
+ "Predictions of this crossvalidation: "+url_for("/crossvalidation/"+params[:id]+"/predictions",:full)+"\n"+
+ "All crossvalidations: "+url_for("/crossvalidation",:full)+"\n"+
+ "All crossvalidation reports: "+url_for("/report/crossvalidation",:full)
description =
"A crossvalidation resource."
content_type "text/html"
@@ -134,7 +135,7 @@ get '/crossvalidation/:id/statistics' do
case request.env['HTTP_ACCEPT'].to_s
when /text\/html/
related_links =
- "The corresponding crossvalidation resource: "+$sinatra.url_for("/crossvalidation/"+params[:id],:full)
+ "The corresponding crossvalidation resource: "+url_for("/crossvalidation/"+params[:id],:full)
description =
"The averaged statistics for the crossvalidation."
content_type "text/html"
@@ -156,6 +157,7 @@ delete '/crossvalidation/:id/?' do
# Validation::Crossvalidation.delete(params[:id])
cv = Validation::Crossvalidation.get(params[:id])
+ cv.subjectid = @subjectid
halt 404,"Crossvalidation '#{params[:id]}' not found." unless cv
cv.delete
end
@@ -192,8 +194,8 @@ get '/crossvalidation/:id/predictions' do
description =
"The crossvalidation predictions as (yaml-)array."
related_links =
- "All crossvalidations: "+$sinatra.url_for("/crossvalidation",:full)+"\n"+
- "Correspoding crossvalidation: "+$sinatra.url_for("/crossvalidation/"+params[:id],:full)
+ "All crossvalidations: "+url_for("/crossvalidation",:full)+"\n"+
+ "Correspoding crossvalidation: "+url_for("/crossvalidation/"+params[:id],:full)
OpenTox.text_to_html p, related_links, description
else
content_type "text/x-yaml"
@@ -210,14 +212,14 @@ get '/?' do
if request.env['HTTP_ACCEPT'] =~ /text\/html/
related_links =
"To perform a validation:\n"+
- "* "+$sinatra.url_for("/test_set_validation",:full)+"\n"+
- "* "+$sinatra.url_for("/training_test_validation",:full)+"\n"+
- "* "+$sinatra.url_for("/bootstrapping",:full)+"\n"+
- "* "+$sinatra.url_for("/training_test_split",:full)+"\n"+
- "* "+$sinatra.url_for("/crossvalidation",:full)+"\n"+
- "Validation reporting: "+$sinatra.url_for("/report",:full)+"\n"+
- "REACH relevant reporting: "+$sinatra.url_for("/reach_report",:full)+"\n"+
- "Examples for using this service: "+$sinatra.url_for("/examples",:full)+"\n"
+ "* "+url_for("/test_set_validation",:full)+"\n"+
+ "* "+url_for("/training_test_validation",:full)+"\n"+
+ "* "+url_for("/bootstrapping",:full)+"\n"+
+ "* "+url_for("/training_test_split",:full)+"\n"+
+ "* "+url_for("/crossvalidation",:full)+"\n"+
+ "Validation reporting: "+url_for("/report",:full)+"\n"+
+ "REACH relevant reporting: "+url_for("/reach_report",:full)+"\n"+
+ "Examples for using this service: "+url_for("/examples",:full)+"\n"
description =
"A validation web service for the OpenTox project ( http://opentox.org ).\n"+
"In the root directory (this is where you are now), a list of all validation resources is returned."
@@ -243,6 +245,7 @@ post '/test_set_validation' do
:test_dataset_uri => params[:test_dataset_uri],
:test_target_dataset_uri => params[:test_target_dataset_uri],
:prediction_feature => params[:prediction_feature]
+ v.subjectid = @subjectid
v.validate_model( task )
v.validation_uri
end
@@ -261,8 +264,8 @@ get '/test_set_validation' do
if request.env['HTTP_ACCEPT'] =~ /text\/html/
related_links =
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Validation reports: "+$sinatra.url_for("/report/validation",:full)
+ "All validations: "+url_for("/",:full)+"\n"+
+ "Validation reports: "+url_for("/report/validation",:full)
description =
"A list of all test-set-validations.\n"+
"To perform a test-set-validation use the POST method."
@@ -285,6 +288,7 @@ post '/training_test_validation/?' do
:test_dataset_uri => params[:test_dataset_uri],
:test_target_dataset_uri => params[:test_target_dataset_uri],
:prediction_feature => params[:prediction_feature]
+ v.subjectid = @subjectid
v.validate_algorithm( params[:algorithm_params], task )
v.validation_uri
end
@@ -302,8 +306,8 @@ get '/training_test_validation' do
uri_list = Validation::Validation.all( :validation_type => "training_test_validation" ).collect{ |v| v.validation_uri }.join("\n")+"\n"
if request.env['HTTP_ACCEPT'] =~ /text\/html/
related_links =
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Validation reports: "+$sinatra.url_for("/report/validation",:full)
+ "All validations: "+url_for("/",:full)+"\n"+
+ "Validation reports: "+url_for("/report/validation",:full)
description =
"A list of all training-test-validations.\n"+
"To perform a training-test-validation use the POST method."
@@ -330,13 +334,13 @@ post '/bootstrapping' do
halt 400, "prediction_feature missing" unless params[:prediction_feature]
params.merge!( Validation::Util.bootstrapping( params[:dataset_uri],
- params[:prediction_feature], params[:random_seed], OpenTox::SubTask.create(task,0,33)) )
+ params[:prediction_feature], @subjectid,
+ params[:random_seed], OpenTox::SubTask.create(task,0,33)) )
v = Validation::Validation.new :validation_type => "bootstrapping",
- :training_dataset_uri => params[:training_dataset_uri],
- :test_dataset_uri => params[:test_dataset_uri],
:test_target_dataset_uri => params[:dataset_uri],
:prediction_feature => params[:prediction_feature],
:algorithm_uri => params[:algorithm_uri]
+ v.subjectid = @subjectid
v.validate_algorithm( params[:algorithm_params], OpenTox::SubTask.create(task,33,100))
v.validation_uri
end
@@ -349,8 +353,8 @@ get '/bootstrapping' do
uri_list = Validation::Validation.all( :validation_type => "bootstrapping" ).collect{ |v| v.validation_uri }.join("\n")+"\n"
if request.env['HTTP_ACCEPT'] =~ /text\/html/
related_links =
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Validation reports: "+$sinatra.url_for("/report/validation",:full)
+ "All validations: "+url_for("/",:full)+"\n"+
+ "Validation reports: "+url_for("/report/validation",:full)
description =
"A list of all bootstrapping-validations.\n"+
"To perform a bootstrapping-validation use the POST method."
@@ -377,13 +381,14 @@ post '/training_test_split' do
halt 400, "prediction_feature missing" unless params[:prediction_feature]
params.merge!( Validation::Util.train_test_dataset_split(params[:dataset_uri], params[:prediction_feature],
- params[:split_ratio], params[:random_seed], OpenTox::SubTask.create(task,0,33)))
+ @subjectid, params[:split_ratio], params[:random_seed], OpenTox::SubTask.create(task,0,33)))
v = Validation::Validation.new :validation_type => "training_test_split",
:training_dataset_uri => params[:training_dataset_uri],
:test_dataset_uri => params[:test_dataset_uri],
:test_target_dataset_uri => params[:dataset_uri],
:prediction_feature => params[:prediction_feature],
:algorithm_uri => params[:algorithm_uri]
+ v.subjectid = @subjectid
v.validate_algorithm( params[:algorithm_params], OpenTox::SubTask.create(task,33,100))
v.validation_uri
end
@@ -399,8 +404,8 @@ get '/training_test_split' do
uri_list = Validation::Validation.all( :validation_type => "training_test_split" ).collect{ |v| v.validation_uri }.join("\n")+"\n"
if request.env['HTTP_ACCEPT'] =~ /text\/html/
related_links =
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Validation reports: "+$sinatra.url_for("/report/validation",:full)
+ "All validations: "+url_for("/",:full)+"\n"+
+ "Validation reports: "+url_for("/report/validation",:full)
description =
"A list of all training-test-split-validations.\n"+
"To perform a training-test-split-validation use the POST method."
@@ -427,6 +432,7 @@ post '/cleanup/?' do
LOGGER.debug "delete val with id:"+val.id.to_s+", finished is false"
deleted << val.validation_uri
#Validation::Validation.delete(val.id)
+ val.subjectid = @subjectid
val.delete
end
LOGGER.info "validation cleanup, deleted "+deleted.size.to_s+" validations"
@@ -452,6 +458,7 @@ post '/validate_datasets' do
if params[:model_uri]
v = Validation::Validation.new params
+ v.subjectid = @subjectid
v.compute_validation_stats_with_model(nil,false,task)
else
halt 400, "please specify 'model_uri' or 'prediction_feature'" unless params[:prediction_feature]
@@ -462,7 +469,8 @@ post '/validate_datasets' do
predicted_feature = params.delete("predicted_feature")
feature_type = "classification" if params.delete("classification")!=nil
feature_type = "regression" if params.delete("regression")!=nil
- v = Validation::Validation.new params
+ v = Validation::Validation.new params
+ v.subjectid = @subjectid
v.compute_validation_stats(feature_type,predicted_feature,nil,nil,false,task)
end
v.validation_uri
@@ -486,8 +494,8 @@ get '/:id/predictions' do
description =
"The validation predictions as (yaml-)array."
related_links =
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "Correspoding validation: "+$sinatra.url_for("/"+params[:id],:full)
+ "All validations: "+url_for("/",:full)+"\n"+
+ "Correspoding validation: "+url_for("/"+params[:id],:full)
OpenTox.text_to_html p.to_array.to_yaml, related_links, description
else
content_type "text/x-yaml"
@@ -529,10 +537,10 @@ get '/:id' do
description =
"A validation resource."
related_links =
- "Search for corresponding report: "+$sinatra.url_for("/report/validation?validation="+validation.validation_uri,:full)+"\n"+
- "Get validation predictions: "+$sinatra.url_for("/"+params[:id]+"/predictions",:full)+"\n"+
- "All validations: "+$sinatra.url_for("/",:full)+"\n"+
- "All validation reports: "+$sinatra.url_for("/report/validation",:full)
+ "Search for corresponding report: "+url_for("/report/validation?validation="+validation.validation_uri,:full)+"\n"+
+ "Get validation predictions: "+url_for("/"+params[:id]+"/predictions",:full)+"\n"+
+ "All validations: "+url_for("/",:full)+"\n"+
+ "All validation reports: "+url_for("/report/validation",:full)
OpenTox.text_to_html validation.to_yaml,related_links,description
when /application\/x-yaml|\*\/\*/
content_type "application/x-yaml"
@@ -550,6 +558,7 @@ delete '/:id' do
# halt 404, "Validation '#{params[:id]}' not found."
# end
validation = Validation::Validation.get(params[:id])
+ validation.subjectid = @subjectid
halt 404, "Validation '#{params[:id]}' not found." unless validation
content_type "text/plain"
validation.delete
diff --git a/validation/validation_format.rb b/validation/validation_format.rb
index 7c6396a..4f46100 100755
--- a/validation/validation_format.rb
+++ b/validation/validation_format.rb
@@ -17,7 +17,7 @@ module Validation
h[p] = self.send(p)
end
if crossvalidation_id!=nil
- cv = {}
+ cv = {:type => OT.CrossvalidationInfo}
#skip crossvalidation_id
cv[:crossvalidation_fold] = self.crossvalidation_fold
cv[:crossvalidation_uri] = self.crossvalidation_uri
@@ -25,15 +25,15 @@ module Validation
end
if classification_statistics
raise "classification_statistics is no has: "+classification_statistics.class.to_s unless classification_statistics.is_a?(Hash)
- clazz = {}
+ clazz = { :type => OT.ClassificationStatistics }
Lib::VAL_CLASS_PROPS_SINGLE.each{ |p| clazz[p] = classification_statistics[p] }
# transpose results per class
class_values = {}
Lib::VAL_CLASS_PROPS_PER_CLASS.each do |p|
- $sinatra.halt 500, "missing classification statitstics: "+p.to_s+" "+classification_statistics.inspect if classification_statistics[p]==nil
+ raise "missing classification statitstics: "+p.to_s+" "+classification_statistics.inspect if classification_statistics[p]==nil
classification_statistics[p].each do |class_value, property_value|
- class_values[class_value] = {:class_value => class_value} unless class_values.has_key?(class_value)
+ class_values[class_value] = {:class_value => class_value, :type => OT.ClassValueStatistics} unless class_values.has_key?(class_value)
map = class_values[class_value]
map[p] = property_value
end
@@ -42,20 +42,20 @@ module Validation
#converting confusion matrix
cells = []
- $sinatra.halt 500,"confusion matrix missing" unless classification_statistics[:confusion_matrix]!=nil
+ raise "confusion matrix missing" unless classification_statistics[:confusion_matrix]!=nil
classification_statistics[:confusion_matrix].each do |k,v|
- cell = {}
+ cell = { :type => OT.ConfusionMatrixCell }
# key in confusion matrix is map with predicted and actual attribute
k.each{ |kk,vv| cell[kk] = vv }
cell[:confusion_matrix_value] = v
cells.push cell
end
- cm = { :confusion_matrix_cell => cells }
+ cm = { :confusion_matrix_cell => cells, :type => OT.ConfusionMatrix }
clazz[:confusion_matrix] = cm
h[:classification_statistics] = clazz
elsif regression_statistics
- regr = {}
+ regr = {:type => OT.RegressionStatistics }
Lib::VAL_REGR_PROPS.each{ |p| regr[p] = regression_statistics[p]}
h[:regression_statistics] = regr
end
@@ -63,13 +63,13 @@ module Validation
end
def to_rdf
- owl = OpenTox::Owl.create("Validation",validation_uri)
- owl.set_data(get_content_as_hash.keys_to_rdf_format)
- owl.rdf
+ s = OpenTox::Serializer::Owl.new
+ s.add_val(validation_uri,OT.Validation,get_content_as_hash.keys_to_rdf_format.keys_to_owl_uris)
+ s.to_rdfxml
end
def to_yaml
- get_content_as_hash.to_yaml
+ get_content_as_hash.keys_to_rdf_format.keys_to_owl_uris.to_yaml
end
end
@@ -92,13 +92,13 @@ module Validation
end
def to_rdf
- owl = OpenTox::Owl.create("'Crossvalidation",crossvalidation_uri)
- owl.set_data(get_content_as_hash.keys_to_rdf_format)
- owl.rdf
+ s = OpenTox::Serializer::Owl.new
+ s.add_val(crossvalidation_uri,OT.Crossvalidation,get_content_as_hash.keys_to_rdf_format.keys_to_owl_uris)
+ s.to_rdfxml
end
def to_yaml
- get_content_as_hash.to_yaml
+ get_content_as_hash.keys_to_rdf_format.keys_to_owl_uris.to_yaml
end
end
end
diff --git a/validation/validation_service.rb b/validation/validation_service.rb
index da5822e..eb9ecff 100755
--- a/validation/validation_service.rb
+++ b/validation/validation_service.rb
@@ -29,12 +29,12 @@ class Array
end
module Validation
-
+
class Validation < Lib::Validation
# constructs a validation object, Rsets id und uri
#def initialize( params={} )
- #$sinatra.halt 500,"do not set id manually" if params[:id]
+ #raise "do not set id manually" if params[:id]
#params[:finished] = false
#super params
#self.save!
@@ -43,32 +43,57 @@ module Validation
# deletes a validation
# PENDING: model and referenced datasets are deleted as well, keep it that way?
- def delete
-
- #model = OpenTox::Model::PredictionModel.find(self.model_uri) if self.model_uri
- #model.destroy if model
-
- #[@test_dataset_uri, @training_dataset_uri, @prediction_dataset_uri].each do |d|
- #dataset = OpenTox::Dataset.find(d) if d
- #dataset.delete if dataset
- #end
-
- #Validation::Validation.delete(self.id)
+ def delete( delete_all=true )
+ if (delete_all)
+ to_delete = [:model_uri, :training_dataset_uri, :test_dataset_uri, :test_target_dataset_uri, :prediction_dataset_uri ]
+ case self.validation_type
+ when /test_set_validation/
+ to_delete -= [ :model_uri, :training_dataset_uri, :test_dataset_uri, :test_target_dataset_uri ]
+ when /bootstrapping/
+ to_delete -= [ :test_target_dataset_uri ]
+ when /training_test_validation/
+ to_delete -= [ :training_dataset_uri, :test_dataset_uri, :test_target_dataset_uri ]
+ when /training_test_split/
+ to_delete -= [ :test_target_dataset_uri ]
+ when /validate_dataset/
+ to_delete = []
+ when /crossvalidation/
+ to_delete -= [ :test_target_dataset_uri ]
+ else
+ raise "unknown dataset type"
+ end
+ to_delete.each do |attr|
+ uri = self.send(attr)
+ LOGGER.debug "also deleting "+attr.to_s+" : "+uri.to_s if uri
+ begin
+ OpenTox::RestClientWrapper.delete(uri, :subjectid => subjectid) if uri
+ rescue => ex
+ LOGGER.warn "could not delete "+uri.to_s+" : "+ex.message.to_s
+ end
+ end
+ end
self.destroy
+ if (subjectid)
+ begin
+ res = OpenTox::Authorization.delete_policies_from_uri(validation_uri, subjectid)
+ LOGGER.debug "Deleted validation policy: #{res}"
+ rescue
+ LOGGER.warn "Policy delete error for validation: #{validation_uri}"
+ end
+ end
"Successfully deleted validation "+self.id.to_s+"."
end
# validates an algorithm by building a model and validating this model
def validate_algorithm( algorithm_params=nil, task=nil )
-
- $sinatra.halt 500,"validation_type missing" unless self.validation_type
- $sinatra.halt 404, "no algorithm uri: '"+self.algorithm_uri.to_s+"'" if self.algorithm_uri==nil or self.algorithm_uri.to_s.size<1
+ raise "validation_type missing" unless self.validation_type
+ raise OpenTox::BadRequestError.new "no algorithm uri: '"+self.algorithm_uri.to_s+"'" if self.algorithm_uri==nil or self.algorithm_uri.to_s.size<1
params = { :dataset_uri => self.training_dataset_uri, :prediction_feature => self.prediction_feature }
if (algorithm_params!=nil)
algorithm_params.split(";").each do |alg_params|
alg_param = alg_params.split("=")
- $sinatra.halt 404, "invalid algorithm param: '"+alg_params.to_s+"'" unless alg_param.size==2 or alg_param[0].to_s.size<1 or alg_param[1].to_s.size<1
+ raise OpenTox::BadRequestError.new "invalid algorithm param: '"+alg_params.to_s+"'" unless alg_param.size==2 or alg_param[0].to_s.size<1 or alg_param[1].to_s.size<1
LOGGER.warn "algorihtm param contains empty space, encode? "+alg_param[1].to_s if alg_param[1] =~ /\s/
params[alg_param[0].to_sym] = alg_param[1]
end
@@ -76,19 +101,20 @@ module Validation
LOGGER.debug "building model '"+algorithm_uri.to_s+"' "+params.inspect
algorithm = OpenTox::Algorithm::Generic.new(algorithm_uri)
+ params[:subjectid] = subjectid
self.model_uri = algorithm.run(params, OpenTox::SubTask.create(task, 0, 33))
#model = OpenTox::Model::PredictionModel.build(algorithm_uri, params,
# OpenTox::SubTask.create(task, 0, 33) )
- $sinatra.halt 500,"model building failed" unless model_uri
+ raise "model building failed" unless model_uri
#self.attributes = { :model_uri => model_uri }
#self.save!
# self.save if self.new?
# self.update :model_uri => model_uri
- #$sinatra.halt 500,"error after building model: model.dependent_variable != validation.prediciton_feature ("+
+ #raise "error after building model: model.dependent_variable != validation.prediciton_feature ("+
# model.dependentVariables.to_s+" != "+self.prediction_feature+")" if self.prediction_feature!=model.dependentVariables
validate_model OpenTox::SubTask.create(task, 33, 100)
@@ -98,13 +124,13 @@ module Validation
# PENDING: a new dataset is created to store the predictions, this should be optional: delete predictions afterwards yes/no
def validate_model( task=nil )
- $sinatra.halt 500,"validation_type missing" unless self.validation_type
+ raise "validation_type missing" unless self.validation_type
LOGGER.debug "validating model '"+self.model_uri+"'"
#model = OpenTox::Model::PredictionModel.find(self.model_uri)
- #$sinatra.halt 400, "model not found: "+self.model_uri.to_s unless model
+ #raise OpenTox::NotFoundError.new "model not found: "+self.model_uri.to_s unless model
model = OpenTox::Model::Generic.find(self.model_uri)
- $sinatra.halt 400, "model not found: "+self.model_uri.to_s unless model
+ raise OpenTox::NotFoundError.new "model not found: "+self.model_uri.to_s unless model
unless self.algorithm_uri
# self.attributes = { :algorithm_uri => model.algorithm }
@@ -115,10 +141,10 @@ module Validation
dependentVariables = model.metadata[OT.dependentVariables]
if self.prediction_feature
- $sinatra.halt 400, "error validating model: model.dependent_variable != validation.prediction_feature ("+
+ raise OpenTox::NotFoundError.new "error validating model: model.dependent_variable != validation.prediction_feature ("+
dependentVariables.to_s+" != "+self.prediction_feature+"), model-metadata is "+model.metadata.inspect if self.prediction_feature!=dependentVariables
else
- $sinatra.halt 400, "model has no dependentVariables specified, please give prediction feature for model validation" unless dependentVariables
+ raise OpenTox::NotFoundError.new "model has no dependentVariables specified, please give prediction feature for model validation" unless dependentVariables
#self.attributes = { :prediction_feature => model.dependentVariables }
#self.save!
#self.update :prediction_feature => model.dependentVariables
@@ -128,7 +154,9 @@ module Validation
prediction_dataset_uri = ""
benchmark = Benchmark.measure do
#prediction_dataset_uri = model.predict_dataset(self.test_dataset_uri, OpenTox::SubTask.create(task, 0, 50))
- prediction_dataset_uri = model.run( {:dataset_uri => self.test_dataset_uri}, OpenTox::SubTask.create(task, 0, 50))
+ prediction_dataset_uri = model.run(
+ {:dataset_uri => self.test_dataset_uri, :subjectid => self.subjectid},
+ OpenTox::SubTask.create(task, 0, 50))
end
# self.attributes = { :prediction_dataset_uri => prediction_dataset_uri,
# :real_runtime => benchmark.real }
@@ -144,9 +172,9 @@ module Validation
def compute_validation_stats_with_model( model=nil, dry_run=false, task=nil )
#model = OpenTox::Model::PredictionModel.find(self.model_uri) if model==nil and self.model_uri
- #$sinatra.halt 400, "model not found: "+self.model_uri.to_s unless model
+ #raise OpenTox::NotFoundError.new "model not found: "+self.model_uri.to_s unless model
model = OpenTox::Model::Generic.find(self.model_uri) if model==nil and self.model_uri
- $sinatra.halt 400, "model not found: "+self.model_uri.to_s unless model
+ raise OpenTox::NotFoundError.new "model not found: "+self.model_uri.to_s unless model
dependentVariables = model.metadata[OT.dependentVariables]
prediction_feature = self.prediction_feature ? nil : dependentVariables
@@ -209,7 +237,7 @@ module Validation
# constructs a crossvalidation, id and uri are set
#def initialize( params={} )
#
- # $sinatra.halt 500,"do not set id manually" if params[:id]
+ # raise "do not set id manually" if params[:id]
# params[:num_folds] = 10 if params[:num_folds]==nil
# params[:random_seed] = 1 if params[:random_seed]==nil
# params[:stratified] = false if params[:stratified]==nil
@@ -227,8 +255,19 @@ module Validation
# deletes a crossvalidation, all validations are deleted as well
def delete
- Validation.all(:crossvalidation_id => self.id).each{ |v| v.destroy }
- destroy
+ Validation.all(:crossvalidation_id => self.id).each do |v|
+ v.subjectid = self.subjectid
+ v.delete
+ end
+ self.destroy
+ if (subjectid)
+ begin
+ res = OpenTox::Authorization.delete_policies_from_uri(crossvalidation_uri, subjectid)
+ LOGGER.debug "Deleted crossvalidation policy: #{res}"
+ rescue
+ LOGGER.warn "Policy delete error for crossvalidation: #{crossvalidation_uri}"
+ end
+ end
"Successfully deleted crossvalidation "+self.id.to_s+"."
end
@@ -247,6 +286,7 @@ module Validation
task_step = 100 / self.num_folds.to_f;
@tmp_validations.each do | val |
validation = Validation.new val
+ validation.subjectid = self.subjectid
validation.validate_algorithm( algorithm_params,
OpenTox::SubTask.create(task, i * task_step, ( i + 1 ) * task_step) )
raise "validation '"+validation.validation_uri+"' for crossvaldation could not be finished" unless
@@ -296,10 +336,10 @@ module Validation
# stores uris in validation objects
def create_new_cv_datasets( prediction_feature, task = nil )
- $sinatra.halt(500,"random seed not set "+self.inspect) unless self.random_seed
+ raise "random seed not set "+self.inspect unless self.random_seed
LOGGER.debug "creating datasets for crossvalidation"
orig_dataset = OpenTox::Dataset.find(self.dataset_uri)
- $sinatra.halt 400, "Dataset not found: "+self.dataset_uri.to_s unless orig_dataset
+ raise OpenTox::NotFoundError.new "Dataset not found: "+self.dataset_uri.to_s unless orig_dataset
shuffled_compounds = orig_dataset.compounds.shuffle( self.random_seed )
@@ -354,7 +394,7 @@ module Validation
'_f'+n.to_s+'of'+self.num_folds.to_s+
'_r'+self.random_seed.to_s+
'_s'+self.stratified.to_s
- source = $sinatra.url_for('/crossvalidation',:full)
+ source = $url_provider.url_for('/crossvalidation',:full)
test_compounds = []
train_compounds = []
@@ -369,18 +409,18 @@ module Validation
end
end
- $sinatra.halt 500,"internal error, num test compounds not correct" unless (shuffled_compounds.size/self.num_folds - test_compounds.size).abs <= 1
- $sinatra.halt 500,"internal error, num train compounds not correct" unless shuffled_compounds.size - test_compounds.size == train_compounds.size
+ raise "internal error, num test compounds not correct" unless (shuffled_compounds.size/self.num_folds - test_compounds.size).abs <= 1
+ raise "internal error, num train compounds not correct" unless shuffled_compounds.size - test_compounds.size == train_compounds.size
LOGGER.debug "training set: "+datasetname+"_train, compounds: "+train_compounds.size.to_s
#train_dataset_uri = orig_dataset.create_new_dataset( train_compounds, orig_dataset.features, datasetname + '_train', source )
train_dataset_uri = orig_dataset.split( train_compounds, orig_dataset.features.keys,
- { DC.title => datasetname + '_train', DC.creator => source } ).uri
+ { DC.title => datasetname + '_train', DC.creator => source }, self.subjectid ).uri
LOGGER.debug "test set: "+datasetname+"_test, compounds: "+test_compounds.size.to_s
#test_dataset_uri = orig_dataset.create_new_dataset( test_compounds, test_features, datasetname + '_test', source )
test_dataset_uri = orig_dataset.split( test_compounds, test_features,
- { DC.title => datasetname + '_test', DC.creator => source } ).uri
+ { DC.title => datasetname + '_test', DC.creator => source }, self.subjectid ).uri
#make sure self.id is set
self.save if self.new?
@@ -404,15 +444,15 @@ module Validation
# splits a dataset into test and training dataset via bootstrapping
# (training dataset-size is n, sampling from orig dataset with replacement)
# returns map with training_dataset_uri and test_dataset_uri
- def self.bootstrapping( orig_dataset_uri, prediction_feature, random_seed=nil, task=nil )
+ def self.bootstrapping( orig_dataset_uri, prediction_feature, subjectid, random_seed=nil, task=nil )
random_seed=1 unless random_seed
orig_dataset = OpenTox::Dataset.find orig_dataset_uri
orig_dataset.load_all
- $sinatra.halt 400, "Dataset not found: "+orig_dataset_uri.to_s unless orig_dataset
+ raise OpenTox::NotFoundError.new "Dataset not found: "+orig_dataset_uri.to_s unless orig_dataset
if prediction_feature
- $sinatra.halt 400, "Prediction feature '"+prediction_feature.to_s+
+ raise OpenTox::NotFoundError.new "Prediction feature '"+prediction_feature.to_s+
"' not found in dataset, features are: \n"+
orig_dataset.features.inspect unless orig_dataset.features.include?(prediction_feature)
else
@@ -420,10 +460,10 @@ module Validation
end
compounds = orig_dataset.compounds
- $sinatra.halt 400, "Cannot split datset, num compounds in dataset < 2 ("+compounds.size.to_s+")" if compounds.size<2
+ raise OpenTox::NotFoundError.new "Cannot split datset, num compounds in dataset < 2 ("+compounds.size.to_s+")" if compounds.size<2
compounds.each do |c|
- $sinatra.halt 400, "Bootstrapping not yet implemented for duplicate compounds" if
+ raise OpenTox::NotFoundError.new "Bootstrapping not yet implemented for duplicate compounds" if
orig_dataset.data_entries[c][prediction_feature].size > 1
end
@@ -457,7 +497,8 @@ module Validation
result[:training_dataset_uri] = orig_dataset.split( training_compounds,
orig_dataset.features.keys,
{ DC.title => "Bootstrapping training dataset of "+orig_dataset.title.to_s,
- DC.creator => $sinatra.url_for('/bootstrapping',:full) }).uri
+ DC.creator => $url_provider.url_for('/bootstrapping',:full) },
+ subjectid ).uri
task.progress(66) if task
# result[:test_dataset_uri] = orig_dataset.create_new_dataset( test_compounds,
@@ -467,19 +508,20 @@ module Validation
result[:test_dataset_uri] = orig_dataset.split( test_compounds,
orig_dataset.features.keys.dclone - [prediction_feature],
{ DC.title => "Bootstrapping test dataset of "+orig_dataset.title.to_s,
- DC.creator => $sinatra.url_for('/bootstrapping',:full) }).uri
+ DC.creator => $url_provider.url_for('/bootstrapping',:full)} ,
+ subjectid ).uri
task.progress(100) if task
if ENV['RACK_ENV'] =~ /test|debug/
training_dataset = OpenTox::Dataset.find result[:training_dataset_uri]
- $sinatra.halt 400, "Training dataset not found: '"+result[:training_dataset_uri].to_s+"'" unless training_dataset
+ raise OpenTox::NotFoundError.new "Training dataset not found: '"+result[:training_dataset_uri].to_s+"'" unless training_dataset
training_dataset.load_all
value_count = 0
training_dataset.compounds.each do |c|
value_count += training_dataset.data_entries[c][prediction_feature].size
end
- $sinatra.halt 500, "training compounds error" unless value_count==training_compounds.size
- $sinatra.halt 400, "Test dataset not found: '"+result[:test_dataset_uri].to_s+"'" unless OpenTox::Dataset.find result[:test_dataset_uri]
+ raise "training compounds error" unless value_count==training_compounds.size
+ raise OpenTox::NotFoundError.new "Test dataset not found: '"+result[:test_dataset_uri].to_s+"'" unless OpenTox::Dataset.find result[:test_dataset_uri]
end
LOGGER.debug "bootstrapping done, training dataset: '"+result[:training_dataset_uri].to_s+"', test dataset: '"+result[:test_dataset_uri].to_s+"'"
@@ -488,18 +530,18 @@ module Validation
# splits a dataset into test and training dataset
# returns map with training_dataset_uri and test_dataset_uri
- def self.train_test_dataset_split( orig_dataset_uri, prediction_feature, split_ratio=nil, random_seed=nil, task=nil )
+ def self.train_test_dataset_split( orig_dataset_uri, prediction_feature, subjectid, split_ratio=nil, random_seed=nil, task=nil )
split_ratio=0.67 unless split_ratio
random_seed=1 unless random_seed
orig_dataset = OpenTox::Dataset.find orig_dataset_uri
orig_dataset.load_all
- $sinatra.halt 400, "Dataset not found: "+orig_dataset_uri.to_s unless orig_dataset
- $sinatra.halt 400, "Split ratio invalid: "+split_ratio.to_s unless split_ratio and split_ratio=split_ratio.to_f
- $sinatra.halt 400, "Split ratio not >0 and <1 :"+split_ratio.to_s unless split_ratio>0 && split_ratio<1
+ raise OpenTox::NotFoundError.new "Dataset not found: "+orig_dataset_uri.to_s unless orig_dataset
+ raise OpenTox::NotFoundError.new "Split ratio invalid: "+split_ratio.to_s unless split_ratio and split_ratio=split_ratio.to_f
+ raise OpenTox::NotFoundError.new "Split ratio not >0 and <1 :"+split_ratio.to_s unless split_ratio>0 && split_ratio<1
if prediction_feature
- $sinatra.halt 400, "Prediction feature '"+prediction_feature.to_s+
+ raise OpenTox::NotFoundError.new "Prediction feature '"+prediction_feature.to_s+
"' not found in dataset, features are: \n"+
orig_dataset.features.keys.inspect unless orig_dataset.features.include?(prediction_feature)
else
@@ -507,7 +549,7 @@ module Validation
end
compounds = orig_dataset.compounds
- $sinatra.halt 400, "Cannot split datset, num compounds in dataset < 2 ("+compounds.size.to_s+")" if compounds.size<2
+ raise OpenTox::BadRequestError.new "Cannot split datset, num compounds in dataset < 2 ("+compounds.size.to_s+")" if compounds.size<2
split = (compounds.size*split_ratio).to_i
split = [split,1].max
split = [split,compounds.size-2].min
@@ -532,7 +574,8 @@ module Validation
result[:training_dataset_uri] = orig_dataset.split( compounds[0..split],
orig_dataset.features.keys,
{ DC.title => "Training dataset split of "+orig_dataset.title.to_s,
- DC.creator => $sinatra.url_for('/training_test_split',:full) } ).uri
+ DC.creator => $url_provider.url_for('/training_test_split',:full) },
+ subjectid ).uri
task.progress(66) if task
# d = OpenTox::Dataset.find(result[:training_dataset_uri])
@@ -549,15 +592,16 @@ module Validation
result[:test_dataset_uri] = orig_dataset.split( compounds[(split+1)..-1],
orig_dataset.features.keys.dclone - [prediction_feature],
{ DC.title => "Test dataset split of "+orig_dataset.title.to_s,
- DC.creator => $sinatra.url_for('/training_test_split',:full) } ).uri
+ DC.creator => $url_provider.url_for('/training_test_split',:full) },
+ subjectid ).uri
task.progress(100) if task
if ENV['RACK_ENV'] =~ /test|debug/
- $sinatra.halt 400, "Training dataset not found: '"+result[:training_dataset_uri].to_s+"'" unless OpenTox::Dataset.find result[:training_dataset_uri]
+ raise OpenTox::NotFoundError.new "Training dataset not found: '"+result[:training_dataset_uri].to_s+"'" unless OpenTox::Dataset.find result[:training_dataset_uri]
test_data = OpenTox::Dataset.find result[:test_dataset_uri]
- $sinatra.halt 400, "Test dataset not found: '"+result[:test_dataset_uri].to_s+"'" unless test_data
+ raise OpenTox::NotFoundError.new "Test dataset not found: '"+result[:test_dataset_uri].to_s+"'" unless test_data
test_data.load_compounds
- $sinatra.halt 400, "Test dataset num coumpounds != "+(compounds.size-split-1).to_s+", instead: "+
+ raise "Test dataset num coumpounds != "+(compounds.size-split-1).to_s+", instead: "+
test_data.compounds.size.to_s+"\n"+test_data.to_yaml unless test_data.compounds.size==(compounds.size-1-split)
end
diff --git a/validation/validation_test.rb b/validation/validation_test.rb
index 3139b29..f7c94ee 100755
--- a/validation/validation_test.rb
+++ b/validation/validation_test.rb
@@ -1,3 +1,11 @@
+
+require "rubygems"
+require "sinatra"
+before {
+ request.env['HTTP_HOST']="local-ot/validation"
+ request.env["REQUEST_URI"]=request.env["PATH_INFO"]
+}
+
require "uri"
require "yaml"
ENV['RACK_ENV'] = 'test'
@@ -11,10 +19,20 @@ LOGGER = OTLogger.new(STDOUT)
LOGGER.datetime_format = "%Y-%m-%d %H:%M:%S "
LOGGER.formatter = Logger::Formatter.new
-#Rack::Test::DEFAULT_HOST = "localhost" #"/validation"
+if AA_SERVER
+ TEST_USER = "mgtest"
+ TEST_PW = "mgpasswd"
+ SUBJECTID = OpenTox::Authorization.authenticate(TEST_USER,TEST_PW)
+ raise "could not log in" unless SUBJECTID
+ puts "logged in: "+SUBJECTID.to_s
+else
+ SUBJECTID = nil
+end
+
+#Rack::Test::DEFAULT_HOST = "local-ot" #"/validation"
module Sinatra
module UrlForHelper
- BASE = "http://localhost/validation"
+ BASE = "http://local-ot/validation"
def url_for url_fragment, mode=:path_only
case mode
when :path_only
@@ -32,99 +50,112 @@ class ValidationTest < Test::Unit::TestCase
include Lib::TestUtil
def test_it
- $test_case = self
-
- #get "/1",nil,'HTTP_ACCEPT' => "text/html"
- #get "/2",nil,'HTTP_ACCEPT' => "application/rdf+xml"
- #puts last_response.body
- #exit
-
-# d = OpenTox::Dataset.find("http://ot-dev.in-silico.ch/dataset/307")
-# puts d.compounds.inspect
-# exit
-
- #get "?model=http://localhost/model/1"
-# get "/crossvalidation/3/predictions"
-# puts last_response.body
-
-# post "/validate_datasets",{
-# :test_dataset_uri=>"http://apps.deaconsult.net:8080/ambit2/dataset/R3924",
-# :prediction_dataset_uri=>"http://apps.ideaconsult.net:8080/ambit2/dataset/R3924?feature_uris[]=http%3A%2F%2Fapps.ideaconsult.net%3A8080%2Fambit2%2Fmodel%2F52%2Fpredicted",
-# #:test_target_dataset_uri=>"http://localhost/dataset/202",
-# :prediction_feature=>"http://apps.ideaconsult.net:8080/ambit2/feature/21715",
-# :predicted_feature=>"http://apps.ideaconsult.net:8080/ambit2/feature/28944",
-# :regression=>"true"}
-# #:classification=>"true"}
-# puts last_response.body
-
- #post "/crossvalidation/cleanup"
- #puts last_response.body
-
- #get "/crossvalidation/19/predictions",nil,'HTTP_ACCEPT' => "application/x-yaml" #/statistics"
-# post "",:model_uri=>"http://localhost/model/1",:test_dataset_uri=>"http://localhost/dataset/3",
-# :test_target_dataset_uri=>"http://localhost/dataset/1"
-
-# get "/crossvalidation/2",nil,'HTTP_ACCEPT' => "application/rdf+xml"
- #puts last_response.body
- #exit
-
- #get "/crossvalidation?model_uri=lazar"
-# post "/test_validation",:select=>"6d" #,:report=>"yes,please"
- #puts last_response.body
-
-# post "/validate_datasets",{
-# :test_dataset_uri=>"http://localhost/dataset/204",
-# :prediction_dataset_uri=>"http://localhost/dataset/206",
-# :test_target_dataset_uri=>"http://localhost/dataset/202",
-# :prediction_feature=>"http://ot-dev.in-silico.ch/toxcreate/feature#IRIS%20unit%20risk",
-# :predicted_feature=>"http://ot-dev.in-silico.ch/toxcreate/feature#IRIS%20unit%20risk_lazar_regression",
-# :regression=>"true"}
-# #:classification=>"true"}
-# puts last_response.body
-
-# post "/validate_datasets",{
-# :test_dataset_uri=>"http://localhost/dataset/89",
-# :prediction_dataset_uri=>"http://localhost/dataset/91",
-# :test_target_dataset_uri=>"http://localhost/dataset/87",
-# :prediction_feature=>"http://localhost/dataset/1/feature/hamster_carcinogenicity",
-# :predicted_feature=>"",
-## :regression=>"true"}
-# :classification=>"true"}
-# puts last_response.body
-
- # m = OpenTox::Model::Generic.find("http://localhost/model/1323333")
- # puts m.to_yaml
-
-# post "/validate_datasets",{
-# :test_dataset_uri=>"http://localhost/dataset/506",
-# :prediction_dataset_uri=>"http://localhost/dataset/526",
-# :test_target_dataset_uri=>"http://localhost/dataset/504",
-# :prediction_feature=>"http://localhost/dataset/504/feature/LC50_mmol",
-# :model_uri=>"http://localhost/model/48"}
-# #:regression=>"true"}
-## :classification=>"true"}
-# puts last_response.body
-
- #run_test("13a","http://localhost/validation/39",nil,false) #,"http://localhost/validation/28")#,"http://localhost/validation/394");
- run_test("1b",nil,nil,false)
-
- #run_test("7b","http://localhost/validation/21")
-
- #run_test("3a","http://localhost/validation/crossvalidation/4")
- #run_test("3b","http://localhost/validation/crossvalidation/3")
-
- #run_test("8a", "http://localhost/validation/crossvalidation/6")
- #run_test("8b", "http://localhost/validation/crossvalidation/5")
+ begin
+ $test_case = self
+
+ #get "/1",nil,'HTTP_ACCEPT' => "text/html"
+
+# get "/crossvalidation/1",nil,'HTTP_ACCEPT' => "application/x-yaml"
+# puts last_response.body
+##
+# get "/crossvalidation/1",nil,'HTTP_ACCEPT' => "application/rdf+xml"
+# puts last_response.body
+# exit
+
+ # d = OpenTox::Dataset.find("http://ot-dev.in-silico.ch/dataset/307")
+ # puts d.compounds.inspect
+ # exit
+
+ #get "?model=http://local-ot/model/1"
+ # get "/crossvalidation/3/predictions"
+ # puts last_response.body
+
+ # post "/validate_datasets",{
+ # :test_dataset_uri=>"http://apps.deaconsult.net:8080/ambit2/dataset/R3924",
+ # :prediction_dataset_uri=>"http://apps.ideaconsult.net:8080/ambit2/dataset/R3924?feature_uris[]=http%3A%2F%2Fapps.ideaconsult.net%3A8080%2Fambit2%2Fmodel%2F52%2Fpredicted",
+ # #:test_target_dataset_uri=>"http://local-ot/dataset/202",
+ # :prediction_feature=>"http://apps.ideaconsult.net:8080/ambit2/feature/21715",
+ # :predicted_feature=>"http://apps.ideaconsult.net:8080/ambit2/feature/28944",
+ # :regression=>"true"}
+ # #:classification=>"true"}
+ # puts last_response.body
+
+ #post "/crossvalidation/cleanup"
+ #puts last_response.body
+
+ #get "/crossvalidation/19/predictions",nil,'HTTP_ACCEPT' => "application/x-yaml" #/statistics"
+ # post "",:model_uri=>"http://local-ot/model/1",:test_dataset_uri=>"http://local-ot/dataset/3",
+ # :test_target_dataset_uri=>"http://local-ot/dataset/1"
+
+ # get "/crossvalidation/2",nil,'HTTP_ACCEPT' => "application/rdf+xml"
+ #puts last_response.body
+ #exit
+
+ #get "/crossvalidation?model_uri=lazar"
+ # post "/test_validation",:select=>"6d" #,:report=>"yes,please"
+ #puts last_response.body
+
+ # post "/validate_datasets",{
+ # :test_dataset_uri=>"http://local-ot/dataset/204",
+ # :prediction_dataset_uri=>"http://local-ot/dataset/206",
+ # :test_target_dataset_uri=>"http://local-ot/dataset/202",
+ # :prediction_feature=>"http://ot-dev.in-silico.ch/toxcreate/feature#IRIS%20unit%20risk",
+ # :predicted_feature=>"http://ot-dev.in-silico.ch/toxcreate/feature#IRIS%20unit%20risk_lazar_regression",
+ # :regression=>"true"}
+ # #:classification=>"true"}
+ # puts last_response.body
+
+ # post "/validate_datasets",{
+ # :test_dataset_uri=>"http://local-ot/dataset/89",
+ # :prediction_dataset_uri=>"http://local-ot/dataset/91",
+ # :test_target_dataset_uri=>"http://local-ot/dataset/87",
+ # :prediction_feature=>"http://local-ot/dataset/1/feature/hamster_carcinogenicity",
+ # :predicted_feature=>"",
+ ## :regression=>"true"}
+ # :classification=>"true"}
+ # puts last_response.body
+
+ # m = OpenTox::Model::Generic.find("http://local-ot/model/1323333")
+ # puts m.to_yaml
+
+ # post "/validate_datasets",{
+ # :test_dataset_uri=>"http://local-ot/dataset/506",
+ # :prediction_dataset_uri=>"http://local-ot/dataset/526",
+ # :test_target_dataset_uri=>"http://local-ot/dataset/504",
+ # :prediction_feature=>"http://local-ot/dataset/504/feature/LC50_mmol",
+ # :model_uri=>"http://local-ot/model/48"}
+ # #:regression=>"true"}
+ ## :classification=>"true"}
+ # puts last_response.body
+
+ #run_test("13a","http://local-ot/validation/39",nil,false) #,"http://local-ot/validation/28")#,"http://local-ot/validation/394");
+
+ #puts OpenTox::Authorization.list_policy_uris(SUBJECTID).inspect
- #run_test("11b", "http://localhost/validation/crossvalidation/2" )# //localhost/validation/42")#, "http://localhost/validation/report/validation/8") #,"http://localhost/validation/report/validation/36") #, "http://localhost/validation/321")
- # run_test("7a","http://localhost/validation/40") #,"http://localhost/validation/crossvalidation/10") #, "http://localhost/validation/321")
- #run_test("8b", "http://localhost/validation/crossvalidation/4")
-
- #puts Nightly.build_nightly("1")
-
- #prepare_examples
- #do_test_examples # USES CURL, DO NOT FORGET TO RESTART VALIDATION SERVICE
- #do_test_examples_ortona
+ run_test("3b",nil,nil,true)
+ #delete "/1",:subjectid=>SUBJECTID
+
+ #run_test("7b","http://local-ot/validation/21")
+
+ #run_test("3a","http://local-ot/validation/crossvalidation/4")
+ #run_test("3b","http://local-ot/validation/crossvalidation/3")
+
+ #run_test("8a", "http://local-ot/validation/crossvalidation/6")
+ #run_test("8b", "http://local-ot/validation/crossvalidation/5")
+
+ #run_test("11b", "http://local-ot/validation/crossvalidation/2" )# //local-ot/validation/42")#, "http://local-ot/validation/report/validation/8") #,"http://local-ot/validation/report/validation/36") #, "http://local-ot/validation/321")
+ # run_test("7a","http://local-ot/validation/40") #,"http://local-ot/validation/crossvalidation/10") #, "http://local-ot/validation/321")
+ #run_test("8b", "http://local-ot/validation/crossvalidation/4")
+
+ #puts Nightly.build_nightly("1")
+
+ #prepare_examples
+ #do_test_examples # USES CURL, DO NOT FORGET TO RESTART VALIDATION SERVICE
+ #do_test_examples_ortona
+
+ ensure
+ OpenTox::Authorization.logout(SUBJECTID) if AA_SERVER
+ end
end
def app
@@ -132,6 +163,11 @@ class ValidationTest < Test::Unit::TestCase
end
def run_test(select=nil, validation_uri=nil, report_uri=nil, delete=false)
+
+ if AA_SERVER && delete
+ policies_before = OpenTox::Authorization.list_policy_uris(SUBJECTID)
+ end
+
puts ValidationExamples.list unless select
validationExamples = ValidationExamples.select(select)
validationExamples.each do |vv|
@@ -148,11 +184,24 @@ class ValidationTest < Test::Unit::TestCase
unless ex.report_uri
ex.report
end
- #ex.verify_yaml
- #ex.compare_yaml_vs_rdf
+ ##ex.verify_yaml
+ ##ex.compare_yaml_vs_rdf
ex.delete if delete
end
end
+
+ if AA_SERVER && delete
+ policies_after= OpenTox::Authorization.list_policy_uris(SUBJECTID)
+ diff = policies_after.size - policies_before.size
+ if (diff != 0)
+ policies_before.each do |k,v|
+ policies_after.delete(k)
+ end
+ LOGGER.warn diff.to_s+" policies NOT deleted:\n"+policies_after.collect{|k,v| k.to_s+" => "+v.to_s}.join("\n")
+ else
+ LOGGER.debug "all policies deleted"
+ end
+ end
end
def prepare_examples