Skip to content
Snippets Groups Projects
Commit 3c36fece authored by stevereis's avatar stevereis
Browse files

Add coVariables in expriment

parent a9895b3f
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,16 @@ export const experimentInputToData = (data: ExperimentCreateInput) => {
},
name: data.name,
};
if (data.coVariables && data.coVariables.length) {
params.algorithm.parameters.push({
name: 'x',
label: 'x',
value: data.coVariables.join(','),
});
}
return params;
};
export const descriptiveDataToTableResult = (
......
......@@ -5,7 +5,7 @@ import * as jsonata from 'jsonata'; // old import style needed due to 'export =
export const transformToAlgorithms = jsonata(`
(
$params := ["y", "pathology", "dataset", "filter"];
$params := ["y", "pathology", "dataset", "filter", "x"];
$toArray := function($x) { $type($x) = 'array' ? $x : [$x]};
......@@ -30,7 +30,7 @@ export const transformToAlgorithms = jsonata(`
export const transformToExperiment = jsonata(`
(
$params := ["y", "pathology", "dataset", "filter"];
$params := ["y", "pathology", "dataset", "filter", "x"];
$toArray := function($x) { $type($x) = 'array' ? $x : [$x]};
......@@ -46,6 +46,7 @@ export const transformToExperiment = jsonata(`
"updateAt": updated,
"domain": algorithm.parameters[name = "pathology"].value,
"variables": $split(algorithm.parameters[name = "y"].value, ','),
"coVariables": $toArray($split(algorithm.parameters[name = "x"].value, ',')),
"filter": algorithm.parameters[name = "filter"].value,
"datasets": $split(algorithm.parameters[name = "dataset"].value, ','),
"algorithm": {
......
......@@ -43,6 +43,9 @@ export class Experiment {
@Field(() => [String])
variables: string[];
@Field(() => [String], { nullable: true, defaultValue: [] })
coVariables?: string[];
@Field()
algorithm: Algorithm;
......
......@@ -24,6 +24,9 @@ export class ExperimentCreateInput {
@Field(() => [String])
variables: string[];
@Field(() => [String], { nullable: true, defaultValue: [] })
coVariables?: string[];
@Field()
algorithm: AlgorithmInput;
......
......@@ -37,7 +37,7 @@ type Domain {
}
type AlgorithmParameter {
name: String!
id: String!
value: [String!]
label: String
description: String
......@@ -50,7 +50,7 @@ type AlgorithmParameter {
}
type Algorithm {
name: String!
id: String!
parameters: [AlgorithmParameter!]
label: String
type: String
......@@ -140,6 +140,7 @@ type Experiment {
filter: String
domain: String!
variables: [String!]!
coVariables: [String!]
algorithm: Algorithm!
name: String!
}
......@@ -158,6 +159,7 @@ type PartialExperiment {
filter: String
domain: String
variables: [String!]
coVariables: [String!]
algorithm: Algorithm
name: String
}
......@@ -187,6 +189,7 @@ input ExperimentCreateInput {
filter: String
domain: String!
variables: [String!]!
coVariables: [String!] = []
algorithm: AlgorithmInput!
name: String!
transformations: [FormulaTransformation!]
......@@ -194,13 +197,13 @@ input ExperimentCreateInput {
}
input AlgorithmInput {
name: String!
id: String!
parameters: [AlgorithmParamInput!] = []
type: String!
}
input AlgorithmParamInput {
name: String!
id: String!
value: [String!]!
}
......@@ -211,5 +214,6 @@ input FormulaTransformation {
input ExperimentEditInput {
name: String
shared: Boolean
viewed: Boolean
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment