Skip to content
Snippets Groups Projects
Commit 6f1d2627 authored by xpetrov4's avatar xpetrov4
Browse files

add new model

parent 28ea7964
Branches
1 merge request!20Resolve "pridať nový model so špecifickým skóre"
......@@ -18,6 +18,72 @@
<p v-if="minSequenceSize > 20" class="alert alert-warning">
Sequence size recommended value is between 10 and 20.
</p>
<div class="form-group row">
<label class="col-md-4 col-form-label">Prediction Model</label>
<div class="col-md-8">
<select class="form-control" v-model="selectedModel">
<option value="model1">Model 1</option>
<option value="model2">Model 2</option>
</select>
</div>
</div>
<div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score GC</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
min="0.1"
v-model="score_gc"
@input="updateValue($event.target.value, 'score_gc')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score GT/AC</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
v-model="score_gtac"
step="0.1"
min="0.1"
@input="updateValue($event.target.value, 'score_gtac')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score AT</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
min="0.1"
v-model="score_at"
@input="updateValue($event.target.value, 'score_at')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Score Others</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
step="0.1"
min="0"
v-model="score_oth"
@input="updateValue($event.target.value, 'score_oth')"
/>
</div>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Threshold</label>
<div class="col-md-8">
......@@ -25,7 +91,7 @@
type="number"
class="form-control"
step="0.1"
min="7.5"
min="1"
v-model="threshold"
@input="updateValue($event.target.value, 'threshold')"
/>
......@@ -59,12 +125,37 @@ export default {
},
threshold: {
type: [Number, String],
default: 7.5
default: 1
},
score_gc: {
type: [Number, String],
default: 25
},
score_gtac: {
type: [Number, String],
default: 3
},
score_at: {
type: [Number, String],
default: 3
},
score_oth: {
type: [Number, String],
default: 0
}
},
data() {
return {
selectedModel: 'model1',
}
},
created() {
this.minSequenceSize = Number(this.minSequenceSize);
this.threshold = Number(this.threshold);
this.minSequenceSize = Number(this.minSequenceSize);
this.threshold = Number(this.threshold);
this.score_gc = Number(this.score_gc);
this.score_gtac = Number(this.score_gtac);
this.score_at = Number(this.score_at);
this.score_oth = Number(this.score_oth);
},
validations: {
minSequenceSize: {
......@@ -75,16 +166,60 @@ export default {
threshold: {
required,
decimal,
minValue: minValue(7.5)
minValue: minValue(1)
},
score_gc: {
required,
decimal,
minValue: minValue(0.1)
},
score_gtac: {
required,
decimal,
minValue: minValue(0.1)
},
score_at: {
required,
decimal,
minValue: minValue(0.1)
},
score_oth: {
required,
decimal,
minValue: minValue(0)
}
},
watch: {
selectedModel(newModel) {
if (newModel === 'model1') {
this.score_gc = 25;
this.updateValue(25, 'score_gc')
this.score_gtac = 3;
this.updateValue(3, 'score_gtac')
this.score_at = 3;
this.updateValue(3, 'score_at')
this.score_oth = 0;
this.updateValue(0, 'score_oth')
} else if (newModel === 'model2') {
this.score_gc = 1;
this.updateValue(1, 'score_gc')
this.score_gtac = 0.5;
this.updateValue(0.5, 'score_gtac')
this.score_at = 0.25;
this.updateValue(0.25, 'score_at')
this.score_oth = 0;
this.updateValue(0, 'score_oth')
}
},
},
methods: {
updateValue: function(value, type) {
this[type] = value; // Aktualizácia lokálnej hodnoty
updateValue(value, type) {
this[type] = Number(value);
this.$v[type].$touch(); // Aktivuje validáciu
this.$emit('checkModel', value, type)
this.$emit('checkModel', value, type);
},
},
}
</script>
......@@ -32,6 +32,14 @@
Minimal sequence size: {{ analysisInfo.minSequenceSize | number(0) }}
<br />
Threshold: {{ analysisInfo.threshold }}
<br />
Score GC: {{ analysisInfo.score_gc }}
<br />
Score GT/AC: {{ analysisInfo.score_gtac }}
<br />
Score AT: {{ analysisInfo.score_at }}
<br />
Score Others: {{ analysisInfo.score_oth }}
</td>
<td>
Z-DNAs found: {{ analysisInfo.resultCount | number(0) }}
......
......@@ -64,13 +64,17 @@ export default {
data() {
return {
minSequenceSize: 10,
threshold: 7.5,
threshold: 1,
config: {},
finishedAnalysis: [],
analysisId: null,
waiting: false,
waitError: false,
serverError: null,
score_gc: 25,
score_gtac: 3,
score_at: 3,
score_oth: 0,
}
},
methods: {
......@@ -99,7 +103,15 @@ export default {
this.minSequenceSize = value;
} else if (type === 'threshold') {
this.threshold = value;
}
} else if (type == 'score_gc') {
this.score_gc = value;
} else if (type == 'score_gtac') {
this.score_gtac = value;
} else if (type == 'score_at') {
this.score_at = value;
} else if (type == 'score_oth') {
this.score_oth = value;
}
},
startAnalysis(sequence, callback) {
this.$http
......@@ -107,6 +119,10 @@ export default {
minSequenceSize: this.minSequenceSize,
threshold: this.threshold,
sequence: sequence.id,
score_gc: this.score_gc,
score_gtac: this.score_gtac,
score_at: this.score_at,
score_oth: this.score_oth,
tags: sequence.tags,
})
.then(response => {
......
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