diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-26 11:29:37 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-26 11:29:37 +0100 |
commit | ab77945c4769b4a73336beb046e62221d5c620f8 (patch) | |
tree | 143972af855fa869689839b70e4052656c02cc58 | |
parent | 675980f769955698209ac723eaa4d34eba9c3204 (diff) |
changes related to feature-encode-problem
-rw-r--r-- | EXAMPLES | 1 | ||||
-rw-r--r-- | data/hamster_carcinogenicity.yaml | 172 | ||||
-rw-r--r-- | example.rb | 6 | ||||
-rw-r--r-- | validation/validation_application.rb | 13 | ||||
-rw-r--r-- | validation/validation_service.rb | 16 | ||||
-rw-r--r-- | validation/validation_test.rb | 11 |
6 files changed, 113 insertions, 106 deletions
@@ -39,7 +39,6 @@ validate model on test-dateset >>> curl -X POST -d model_uri="<model_uri>" \ -d test_dataset_uri="<test_dataset_uri>" \ - -d prediction_feature="<prediction_feature>" \ <validation_service> result example (accept-header: application/rdf-xml) diff --git a/data/hamster_carcinogenicity.yaml b/data/hamster_carcinogenicity.yaml index 9f9f239..fbe7c12 100644 --- a/data/hamster_carcinogenicity.yaml +++ b/data/hamster_carcinogenicity.yaml @@ -87,175 +87,175 @@ compounds: - http://localhost/compound/InChI=1S/BF4.Na/c2-1(3,4)5;/q-1;+1 data: 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C3H6ClNO/c1-5(2)3(4)6/h1-2H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C2H8N2O/c3-4-1-2-5/h4-5H,1-3H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C4H10N2O3/c1-6(5-9)2-4(8)3-7/h4,7-8H,2-3H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/CH2O/c1-2/h1H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C4H8N2O2/c7-5-6-1-3-8-4-2-6/h1-4H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C3H6O2/c4-1-3-2-5-3/h3-4H,1-2H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C4H6N2O3/c1-3-2-6(5-8)4(7)9-3/h3H,2H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C6H5NO2/c8-6(9)5-1-3-7-4-2-5/h1-4H,(H,8,9): - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C3H6N2O2/c6-4-5-1-2-7-3-5/h1-3H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C3H7NO2/c1-2-6-3(4)5/h2H2,1H3,(H2,4,5): - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C5H8O2/c1-4(2)5(6)7-3/h1H2,2-3H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C2H6N2O/c1-4(3)2-5/h2H,3H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C5H4O2/c6-4-5-2-1-3-7-5/h1-4H: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C4H8N2O/c7-5-6-3-1-2-4-6/h1-4H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/H4N2.H2O4S/c1-2;1-5(2,3)4/h1-2H2;(H2,1,2,3,4): - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C5H10N2O/c8-6-7-4-2-1-3-5-7/h1-5H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C3H6N2O/c6-4-5-2-1-3-5/h1-3H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C4H8N2O3/c1-3-9-4(7)6(2)5-8/h3H2,1-2H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C6H10N2O2/c1-3-4-8(7-10)5-6(2)9/h3H,1,4-5H2,2H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/BrHO3.K/c2-1(3)4;/h(H,2,3,4);/q;+1/p-1: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C2H5ClO/c1-4-2-3/h2H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/Cd.2ClH/h;2*1H/q+2;;/p-2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/BF4.Na/c2-1(3,4)5;/q-1;+1: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C2H4N4/c3-2-4-1-5-6-2/h1H,(H3,3,4,5,6): - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C9H6O2/c10-9-6-5-7-3-1-2-4-8(7)11-9/h1-6H: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C2HCl3/c3-1-2(4)5/h1H: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C2H8N2/c1-4(2)3/h3H2,1-2H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C5H10N2O3/c1-5(9)4-7(6-10)2-3-8/h8H,2-4H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/CH6N2/c1-3-2/h3H,2H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/H4N2/c1-2/h1-2H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C4H5Cl/c1-3-4(2)5/h3H,1-2H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C2H8N2.2ClH/c1-3-4-2;;/h3-4H,1-2H3;2*1H: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C2H6O/c1-2-3/h3H,2H2,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C5H13N3O/c1-7(2)4-5-8(3)6-9/h4-5H2,1-3H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/HNO2.Na/c2-1-3;/h(H,2,3);/q;+1/p-1: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C6Cl6/c7-1-2(8)4(10)6(12)5(11)3(1)9: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C2H3Cl/c1-2-3/h2H,1H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C6H10N2O/c1-3-5-8(7-9)6-4-2/h3-4H,1-2,5-6H2: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): 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/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): false http://localhost/compound/InChI=1S/C4H7N3O3/c1-3(8)2-7(6-10)4(5)9/h2H2,1H3,(H2,5,9): - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true http://localhost/compound/InChI=1S/C2H4O/c1-2-3/h2H,1H3: - - http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true + - http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB): true features: -- http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB) +- http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB) title: Hamster%20Carcinogenicity%20(DSSTOX/CPDB) @@ -4,7 +4,7 @@ class Example @@file=File.new("data/hamster_carcinogenicity.yaml","r") @@file_type="text/x-yaml" @@model=File.join @@config[:services]["opentox-model"],"1" - @@feature="http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)" + @@feature="http://localhost/toxmodel/feature%23Hamster%20Carcinogenicity%20(DSSTOX/CPDB)" @@alg = File.join @@config[:services]["opentox-algorithm"],"lazar" @@alg_params = "feature_generation_uri="+File.join(@@config[:services]["opentox-algorithm"],"fminer") @@data=File.join @@config[:services]["opentox-dataset"],"1" @@ -66,13 +66,13 @@ class Example split_params = Validation::Util.train_test_dataset_split(data_uri, 0.9, 1) v = Validation::Validation.new :training_dataset_uri => split_params[:training_dataset_uri], :test_dataset_uri => split_params[:test_dataset_uri], - :prediction_feature => @@feature + :prediction_feature => URI.decode(@@feature) v.validate_algorithm( @@alg, @@alg_params ) log "crossvalidation" Lib::Crossvalidation.auto_migrate! cv = Validation::Crossvalidation.new({ :dataset_uri => data_uri, :algorithm_uri => @@alg, :num_folds => 5, :stratified => false }) - cv.create_cv_datasets( @@feature ) + cv.create_cv_datasets( URI.decode(@@feature) ) cv.perform_cv( @@alg_params ) log "create validation report" diff --git a/validation/validation_application.rb b/validation/validation_application.rb index a46a74e..526af89 100644 --- a/validation/validation_application.rb +++ b/validation/validation_application.rb @@ -10,13 +10,7 @@ require 'lib/merge.rb' # (before is executed in every rest call, problem is that the request object is not set, until the first rest-call ) before {$sinatra = self unless $sinatra} -class Sinatra::Base - # overwriting halt to log halts (!= 202) - def halt(status,msg) - LOGGER.error "halt "+status.to_s+" "+msg.to_s if (status != 202) - throw :halt, [status, msg] - end -end + get '/crossvalidation/?' do LOGGER.info "list all crossvalidations" @@ -88,6 +82,7 @@ post '/crossvalidation/?' do halt 400, "dataset_uri missing" unless params[:dataset_uri] halt 400, "algorithm_uri missing" unless params[:algorithm_uri] halt 400, "prediction_feature missing" unless params[:prediction_feature] + cv_params = { :dataset_uri => params[:dataset_uri], :algorithm_uri => params[:algorithm_uri] } [ :num_folds, :random_seed, :stratified ].each{ |sym| cv_params[sym] = params[sym] if params[sym] } @@ -129,7 +124,7 @@ end post '/?' do OpenTox::Task.as_task do LOGGER.info "creating validation "+params.inspect - if params[:model_uri] and params[:test_dataset_uri] and !params[:training_dataset_uri] and !params[:algorithm_uri] and params[:prediction_feature] + if params[:model_uri] and params[:test_dataset_uri] and !params[:training_dataset_uri] and !params[:algorithm_uri] v = Validation::Validation.new :model_uri => params[:model_uri], :test_dataset_uri => params[:test_dataset_uri], :prediction_feature => params[:prediction_feature] @@ -141,7 +136,7 @@ post '/?' do v.validate_algorithm( params[:algorithm_uri], params[:algorithm_params]) else halt 400, "illegal parameter combination for validation, use either\n"+ - "* model_uri, test_dataset_uri, prediction_feature\n"+ + "* model_uri, test_dataset_uri\n"+ "* algorithm_uri, training_dataset_uri, test_dataset_uri, prediction_feature\n" "params given: "+params.inspect end diff --git a/validation/validation_service.rb b/validation/validation_service.rb index 1d6946f..62062a5 100644 --- a/validation/validation_service.rb +++ b/validation/validation_service.rb @@ -65,13 +65,17 @@ module Validation def validate_algorithm( algorithm_uri, algorithm_params=nil ) $sinatra.halt 404, "no algorithm uri: '"+algorithm_uri+"'" if algorithm_uri==nil or algorithm_uri.to_s.size<1 + + $sinatra.halt 404, "prediction_feature is already encoded: "+@prediction_feature if @prediction_feature=~/%20/ + update :prediction_feature => URI.encode(@prediction_feature) params = { :dataset_uri => @training_dataset_uri, :feature_uri => @prediction_feature } if (algorithm_params!=nil) algorithm_params.split(";").each do |alg_params| alg_param = alg_params.split("=") #puts "param "+alg_param.to_s - $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 + $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 + 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 end @@ -80,6 +84,9 @@ module Validation model = OpenTox::Model::PredictionModel.build(algorithm_uri, params) raise "model building failed" unless model update :model_uri => model.uri + + raise "error after building model: model.dependent_variable != validation.prediciton_feature ("+ + model.dependent_variables+" != "+@prediction_feature+")" if @prediction_feature!=model.dependent_variables validate_model end @@ -95,6 +102,13 @@ module Validation model = OpenTox::Model::PredictionModel.find(@model_uri) $sinatra.halt 400, "model not found: "+@model_uri.to_s unless model + if @prediction_feature + $sinatra.halt 400, "error validating model: model.dependent_variable != validation.prediciton_feature ("+ + model.dependent_variables+" != "+@prediction_feature+")" if @prediction_feature!=model.dependent_variables + else + update :prediction_feature => model.dependent_variables + end + prediction_dataset_uri = "" benchmark = Benchmark.measure do prediction_dataset_uri = model.predict_dataset(@test_dataset_uri) diff --git a/validation/validation_test.rb b/validation/validation_test.rb index ddc2494..4396562 100644 --- a/validation/validation_test.rb +++ b/validation/validation_test.rb @@ -28,7 +28,8 @@ FILE_TRAIN=File.new("data/hamster_carcinogenicity.owl","r") FILE_TEST=File.new("data/hamster_carcinogenicity.owl","r") #FEATURE_URI="http://www.epa.gov/NCCT/dsstox/CentralFieldDef.html#ActivityOutcome_CPDBAS_Hamster" -FEATURE_URI="http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)" +#FEATURE_URI="http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)" +FEATURE_URI="http://localhost/toxmodel/feature#Hamster Carcinogenicity (DSSTOX/CPDB)" #WS_CLASS_ALG="http://webservices.in-silico.ch/test/algorithm/lazar" WS_CLASS_ALG=File.join(@@config[:services]["opentox-algorithm"],"lazar") #"localhost:4003/lazar" @@ -354,13 +355,11 @@ class ValidationTest < Test::Unit::TestCase ## end # end - # def test_prepare_examples # get '/prepare_examples' # end - -# def test_examples # USES CURL, DO NOT FORGET TO RESTART -# get '/test_examples' -# end + def test_examples # USES CURL, DO NOT FORGET TO RESTART + get '/test_examples' + end end |