From f9b8f4d4cd4cac9129fc8b2d3a04a8b851266cc3 Mon Sep 17 00:00:00 2001 From: Andreas Maunz Date: Wed, 11 Apr 2012 16:59:02 +0200 Subject: Update doc --- README.md | 121 ++++++++++++++++++++++++++++++++++++++------------------------ fminer.rb | 5 ++- fs.rb | 6 ++-- 3 files changed, 79 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index 344f747..ea25a8f 100644 --- a/README.md +++ b/README.md @@ -3,60 +3,81 @@ OpenTox Algorithm - An [OpenTox](http://www.opentox.org) REST Webservice - Implements the OpenTox algorithm API for - - fminer - lazar + - subgraph descriptor calculation (fminer) + - physico-chemical descriptor calculation (pc) for more than 300 descriptors + - feature selection (fs) using recursive feature elimination (rfe) REST operations --------------- - Get a list of all algorithms GET / - URIs of algorithms 200 - Get a representation of the GET /fminer/ - fminer representation 200,404 - fminer algorithms - Get a representation of the GET /fminer/bbrc - bbrc representation 200,404 - bbrc algorithm - Get a representation of the GET /fminer/last - last representation 200,404 - last algorithm - Get a representation of the GET /lazar - lazar representation 200,404 - lazar algorithm - Get a representation of the GET /feature_selection - feature selection representation 200,404 - feature selection algorithms - Get a representation of the GET /feature_selection/rfe - rfe representation 200,404 - rfe algorithm - - - Create bbrc features POST /fminer/bbrc dataset_uri, URI for feature dataset 200,400,404,500 - feature_uri, - [min_frequency=5 per-mil], - [feature_type=trees], - [backbone=true], - [min_chisq_significance=0.95], - [nr_hits=false] - Create last features POST /fminer/last dataset_uri, URI for feature dataset 200,400,404,500 - feature_uri, - [min_frequency=8 %], - [feature_type=trees], - [nr_hits=false] - Create lazar model POST /lazar dataset_uri, URI for lazar model 200,400,404,500 - [prediction_feature], - [feature_generation_uri], - [prediction_algorithm], - [feature_dataset_uri], - [pc_type=null], - [nr_hits=false (class. using wt. maj. vote), true (else)], - [min_sim=0.3 (nominal), 0.4 (numeric features)] - [min_train_performance=0.1] - - Create selected features POST /feature_selection/rfe dataset_uri, URI for dataset 200,400,404,500 - prediction_feature, - feature_dataset_uri, - [del_missing=false] - - +DESCRIPTION REST ADDRESS ARGUMENTS RETURN CODES + +Get a representation of the GET /lazar - lazar representation 200,404 +lazar algorithm + +Get a list of all algorithms GET / - URIs of algorithms 200 +Get a representation of the GET /fminer/ - fminer representation 200,404 +fminer algorithms +Get a representation of the GET /fminer/bbrc - bbrc representation 200,404 +bbrc algorithm +Get a representation of the GET /fminer/last - last representation 200,404 +last algorithm + +Get a representation of the GET /pc - URIs of algorithms 200,404 +pc algorithms +Get a representation of the GET /pc/ - descriptor representation 200,404 +pc algorithm + +Get a representation of the GET /fs - fs representation 200,404 +fs algorithms +Get a representation of the GET /fs/rfe - rfe representation 200,404 +rfe algorithm + +Create lazar model POST /lazar dataset_uri, URI for lazar model 200,400,404,500 + [prediction_feature], + [feature_generation_uri], + [feature_dataset_uri], + [prediction_algorithm], + [pc_type=null], + [lib=null], + [nr_hits=false (cl.wmv), + true (else)], + [min_sim=0.3 (nominal), 0.4 + (numeric features)], + [min_train_performance=0.1] + +Create bbrc features POST /fminer/bbrc dataset_uri, URI for feature dataset 200,400,404,500 + prediction_feature, + [min_frequency=5 per-mil], + [feature_type=trees], + [backbone=true], + [min_chisq_significance=0.95], + [nr_hits=false] +Create last features POST /fminer/last dataset_uri, URI for feature dataset 200,400,404,500 + prediction_feature, + [min_frequency=8 %], + [feature_type=trees], + [nr_hits=false] + +Create features POST /pc/AllDescriptors dataset_uri, URI for dataset 200,400,404,500 + [pc_type=constitutional, + topological,geometrical, + electronic,cpsa,hybrid], + [lib=cdk,joelib,openbabel] + +Create feature POST /pc/ dataset_uri URI for dataset 200,400,404,500 + +Select features POST /fs/rfe dataset_uri, URI for dataset 200,400,404,500 + prediction_feature, + feature_dataset_uri, + [del_missing=false] Synopsis -------- - prediction\_algorithm: One of "weighted\_majority\_vote" (default for classification), "local\_svm\_classification", "local\_svm\_regression" (default for regression). "weighted\_majority\_vote" is not applicable for regression. -- pc_type: Mandatory for feature dataset, one of [geometrical, topological, electronic, constitutional, hybrid, cpsa]. +- pc_type: Mandatory for feature datasets that do not contain appropriate feature metadata, one of [geometrical, topological, electronic, constitutional, hybrid, cpsa]. +- lib: Mandatory for feature datasets that do not contain appropriate feature metadata, one of [cdk, openbabel, joelib]. - nr_hits: Whether nominal features should be instantiated with their occurrence counts in the instances. One of "true", "false". - min_sim: The minimum similarity threshold for neighbors. Numeric value in [0,1]. - min_train_performance. The minimum training performance for "local\_svm\_classification" (Accuracy) and "local\_svm\_regression" (R-squared). Numeric value in [0,1]. @@ -124,7 +145,13 @@ Creates a standard Lazar model. * * * -### Create a feature dataset of selected features - curl -X POST -d dataset_uri={dataset_uri} -d prediction_feature_uri={prediction_feature_uri} -d feature_dataset_uri={feature_dataset_uri} -d del_missing=true http://webservices.in-silico.ch/test/algorithm/feature_selection/rfe +### Create a feature dataset of physico-chemical descriptors with CDK + curl -X POST -d dataset_uri={dataset_uri} -d lib=cdk http://webservices.in-silico.ch/test/algorithm/pc/AllDescriptors + +* * * + +### Select features from a feature dataset + curl -X POST -d dataset_uri={dataset_uri} -d prediction_feature_uri={prediction_feature_uri} -d feature_dataset_uri={feature_dataset_uri} http://webservices.in-silico.ch/test/algorithm/fs/rfe + Copyright (c) 2009-2011 Christoph Helma, Martin Guetlein, Micha Rautenberg, Andreas Maunz, David Vorgrimmler, Denis Gebele. See LICENSE for details. diff --git a/fminer.rb b/fminer.rb index ee504fc..da06fc8 100644 --- a/fminer.rb +++ b/fminer.rb @@ -39,6 +39,7 @@ get "/fminer/bbrc/?" do { DC.description => "Feature type, can be 'paths' or 'trees'", OT.paramScope => "optional", DC.title => "feature_type" }, { DC.description => "BBRC classes, pass 'false' to switch off mining for BBRC representatives.", OT.paramScope => "optional", DC.title => "backbone" }, { DC.description => "Significance threshold (between 0 and 1)", OT.paramScope => "optional", DC.title => "min_chisq_significance" }, + { DC.description => "Whether subgraphs should be weighted with their occurrence counts in the instances (frequency)", OT.paramScope => "optional", DC.title => "nr_hits" }, ] } case request.env['HTTP_ACCEPT'] @@ -69,7 +70,7 @@ get "/fminer/last/?" do { DC.description => "Feature URI for dependent variable", OT.paramScope => "mandatory", DC.title => "prediction_feature" }, { DC.description => "Minimum frequency", OT.paramScope => "optional", DC.title => "min_frequency" }, { DC.description => "Feature type, can be 'paths' or 'trees'", OT.paramScope => "optional", DC.title => "feature_type" }, - { DC.description => "Maximum number of hops", OT.paramScope => "optional", DC.title => "hops" }, + { DC.description => "Whether subgraphs should be weighted with their occurrence counts in the instances (frequency)", OT.paramScope => "optional", DC.title => "nr_hits" }, ] } case request.env['HTTP_ACCEPT'] @@ -253,7 +254,6 @@ end # @param [optional] parameters LAST parameters, accepted parameters are # - min_frequency freq Minimum frequency (default 5) # - feature_type Feature type, can be 'paths' or 'trees' (default "trees") -# - hops Maximum number of hops # - nr_hits Set to "true" to get hit count instead of presence # @return [text/uri-list] Task URI post '/fminer/last/?' do @@ -272,7 +272,6 @@ post '/fminer/last/?' do end @@last.SetMinfreq(fminer.minfreq) @@last.SetType(1) if params[:feature_type] == "paths" - @@last.SetMaxHops(params[:hops]) if params[:hops] @@last.SetConsoleOut(false) diff --git a/fs.rb b/fs.rb index 1c8ac67..490e34e 100644 --- a/fs.rb +++ b/fs.rb @@ -29,7 +29,7 @@ get "/fs/rfe/?" do RDF.type => [OT.Algorithm,OTA.PatternMiningSupervised], OT.parameters => [ { DC.description => "Dataset URI", OT.paramScope => "mandatory", DC.title => "dataset_uri" }, - { DC.description => "Prediction Feature URI", OT.paramScope => "mandatory", DC.title => "prediction_feature_uri" }, + { DC.description => "Prediction Feature URI", OT.paramScope => "mandatory", DC.title => "prediction_feature" }, { DC.description => "Feature Dataset URI", OT.paramScope => "mandatory", DC.title => "feature_dataset_uri" }, { DC.description => "Delete Instances with missing values", OT.paramScope => "optional", DC.title => "del_missing" } ] @@ -55,7 +55,7 @@ end post '/feature_selection/rfe/?' do raise OpenTox::NotFoundError.new "Please submit a dataset_uri." unless params[:dataset_uri] - raise OpenTox::NotFoundError.new "Please submit a prediction_feature_uri." unless params[:prediction_feature_uri] + raise OpenTox::NotFoundError.new "Please submit a prediction_feature_uri." unless params[:prediction_feature] raise OpenTox::NotFoundError.new "Please submit a feature_dataset_uri." unless params[:feature_dataset_uri] ds_csv=OpenTox::RestClientWrapper.get( params[:dataset_uri], {:accept => "text/csv"} ) @@ -63,7 +63,7 @@ post '/feature_selection/rfe/?' do ds.puts(ds_csv) ds.flush() - prediction_feature = URI.escape(params[:prediction_feature_uri].split('/').last) # get col name + prediction_feature = URI.escape(params[:prediction_feature].split('/').last) # get col name fds_features = OpenTox::Dataset.new(params[:feature_dataset_uri]).load_features fds_csv=OpenTox::RestClientWrapper.get( params[:feature_dataset_uri], {:accept => "text/csv"}) -- cgit v1.2.3