diff --git a/Exareme-Docker/src/exareme/exareme-master/src/main/java/madgik/exareme/master/queryProcessor/HBP/ParameterProperties.java b/Exareme-Docker/src/exareme/exareme-master/src/main/java/madgik/exareme/master/queryProcessor/HBP/ParameterProperties.java index fd172ab2a8a080098f4778d4203417f142d4c730..4308f62fad14e52b17374dcd71ee85d9595702a7 100644 --- a/Exareme-Docker/src/exareme/exareme-master/src/main/java/madgik/exareme/master/queryProcessor/HBP/ParameterProperties.java +++ b/Exareme-Docker/src/exareme/exareme-master/src/main/java/madgik/exareme/master/queryProcessor/HBP/ParameterProperties.java @@ -21,6 +21,7 @@ public class ParameterProperties { public enum ParameterType { column, // used for selecting specific columns from the database formula, // used for parsing the input as a formula of R, '+ - * : 0' are allowed. + formula_description, // used for providing a formula description to the algorithm in json format filter, // used for filtering on the database input dataset, // used for choosing database input pathology, // used for specifying what database to use @@ -33,7 +34,6 @@ public class ParameterProperties { real, json } - public ParameterProperties() { } @@ -50,13 +50,15 @@ public class ParameterProperties { if (type == null) { throw new AlgorithmException(algorithmName, "The parameter field 'type' was not initialized in the properties.json file."); } else if (type.equals(ParameterType.column) || type.equals(ParameterType.formula)) { - if (columnValuesSQLType == null) { - } - if (columnValuesIsCategorical == null) { throw new AlgorithmException(algorithmName, "The parameter field 'columnValuesIsCategorical' was not initialized in the properties.json file."); } - } else if (valueType.equals(ParameterValueType.json)){ + }else if (type.equals(ParameterType.formula_description)) { + if (!valueType.equals(ParameterValueType.json)) { + throw new AlgorithmException(algorithmName, "The parameter field 'valueType' must be json since the 'type' is formula_description."); + } + } + if (valueType.equals(ParameterValueType.json)){ if(valueMultiple) { throw new AlgorithmException(algorithmName, "The parameter field 'valueMultiple' cannot be true because the 'valueType' is json."); } diff --git a/Exareme-Docker/src/mip-algorithms/DESCRIPTIVE_STATS/properties.json b/Exareme-Docker/src/mip-algorithms/DESCRIPTIVE_STATS/properties.json index 6cc7a3847584c285e37bbe05500cbd6513ba845e..7517cbab1b6ced8f08958efa9f645495aaf86dd5 100644 --- a/Exareme-Docker/src/mip-algorithms/DESCRIPTIVE_STATS/properties.json +++ b/Exareme-Docker/src/mip-algorithms/DESCRIPTIVE_STATS/properties.json @@ -11,7 +11,7 @@ "columnValuesSQLType": "real, integer, text", "columnValuesIsCategorical": "", "columnValuesNumOfEnumerations": "", - "value": "rightcuncuneus,rightaorganteriororbitalgyrus,leftpogpostcentralgyrus,leftmcggmiddlecingulategyrus,leftsmcsupplementarymotorcortex,leftsogsuperioroccipitalgyrus,leftmtgmiddletemporalgyrus,rightpoparietaloperculum", + "value": "lefthippocampus,righthippocampus", "valueNotBlank": true, "valueMultiple": true, "valueType": "string" @@ -20,7 +20,7 @@ "label": "dataset", "desc": "It contains the names of one or more datasets, in which the algorithm will be executed. It cannot be empty", "type": "dataset", - "value": "adni,edsd", + "value": "adni,edsd, ppmi", "valueNotBlank": true, "valueMultiple": true, "valueType": "string" @@ -29,12 +29,12 @@ "name": "formula", "label": "formula", "desc": "Patsy formula (R language syntax).", - "type": "other", - "value": "", + "type": "formula_description", + "value": "{\"single\":[{\"var_name\":\"lefthippocampus\",\"unary_operation\":\"log\"},{\"var_name\":\"righthippocampus\",\"unary_operation\":\"exp\"}],\"interactions\":[]}", "defaultValue": "", "valueNotBlank": false, "valueMultiple": false, - "valueType": "string" + "valueType": "json" }, { "name": "filter", diff --git a/Exareme-Docker/src/mip-algorithms/README.md b/Exareme-Docker/src/mip-algorithms/README.md index 379b01a342fa9b8a47ff54a47dc36c8a6b2ac377..2412908c2c011157f56ace28dbe1ef89d124db69 100644 --- a/Exareme-Docker/src/mip-algorithms/README.md +++ b/Exareme-Docker/src/mip-algorithms/README.md @@ -41,7 +41,8 @@ The parameter has the following properties:<ul> <li><code>type</code> Defines the type of the parameter. It can take the following values: <ol> <li><code>column</code> (Used for querying the columns of the database.)</li> -<li><code>formula</code> (Same as the column type but is is parsed as a formula of R. Allowed characters are '+ - * : 0.' )</li> +<li><code>formula</code> (Same as the column type but it is parsed as a formula of R. Allowed characters are '+ - * : 0.' )</li> +<li><code>formula_description</code> (Similar to the column and formula types but it is parsed as a json object representing a formula. )</li> <li><code>filter</code> (Used to filter the results of the database.)</li> <li><code>dataset</code> (If the property is of type dataset then it will be used to choose on which dataset to run the algorithm on.)</li> <li><code>other</code> (For any other reason use this type.)</li>