Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<template>
<div class="row">
<div class="col-md-12">
<div class="form-group row">
<label class="col-md-4 col-form-label">Minimal window size</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
v-model="minWindowSize"
step="1"
min="10"
max="10000"
@input="updateValue($event.target.value, 'minWindowSize')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Minimal GC percentage</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
v-model="minGcPercentage"
step="0.001"
min="0"
max="1"
@input="updateValue($event.target.value, 'minGcPercentage')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Minimal observed/expected CpG</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
v-model="minObservedToExpectedCpG"
step="0.001"
min="0"
max="1"
@input="updateValue($event.target.value, 'minObservedToExpectedCpG')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Minimal island merge gap</label>
<div class="col-md-8">
<input
type="number"
class="form-control"
v-model="minIslandMergeGap"
step="1"
min="10"
max="10000"
@input="updateValue($event.target.value, 'minIslandMergeGap')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">First nucleotide</label>
<div class="col-md-8">
<input
type="text"
class="form-control"
v-model="firstNucleotide"
@input="updateValue($event.target.value, 'firstNucleotide')"
/>
</div>
</div>
<div class="form-group row">
<label class="col-md-4 col-form-label">Second nucleotide</label>
<div class="col-md-8">
<input
type="text"
class="form-control"
v-model="secondNucleotide"
@input="updateValue($event.target.value, 'secondNucleotide')"
/>
</div>
</div>
<div class="alert alert-danger" v-if="$v.$anyError">
<div v-if="!$v.minSequenceSize.required">Minimal sequence size is required.</div>
<div v-if="!$v.minSequenceSize.numeric">Minimal sequence size must be numeric.</div>
<div v-if="!$v.minSequenceSize.minValue">Minimal length of sequence is {{ $v.minSequenceSize.$params.minValue.min }}.</div>
<div v-if="!$v.threshold.required">Threshold is required.</div>
<div v-if="!$v.threshold.decimal">Threshold must be decimal number.</div>
<div v-if="!$v.threshold.minValue">Minimal value of threshold is {{ $v.threshold.$params.minValue.min }}.</div>
</div>
<div class="text-right">
<slot name="additionalButtons"></slot>
</div>
</div>
</div>
</template>
<script>
import { required, numeric, minValue, decimal } from 'vuelidate/lib/validators'
export default {
props: {
minWindowSize: {
type: [Number, String],
default: 200
},
minGcPercentage: {
type: [Number, String],
default: 0.5
},
minObservedToExpectedCpG: {
type: [Number, String],
default: 0.6
},
minIslandMergeGap: {
type: [Number, String],
default: 100
},
firstNucleotide: {
type: [Number, String],
default: "C"
},
secondNucleotide: {
type: [Number, String],
default: "G"
},
},
created() {
this.minSequenceSize = Number(this.minSequenceSize);
this.threshold = Number(this.threshold);
},
validations: {
minWindowSize: {
required,
numeric,
minValue: minValue(0)
},
minGcPercentage: {
required,
decimal,
minValue: minValue(0)
},
minObservedToExpectedCpG: {
required,
decimal,
minValue: minValue(0)
},
minIslandMergeGap: {
required,
numeric,
minValue: minValue(0)
},
firstNucleotide: {
required,
},
secondNucleotide: {
required,
},
},
methods: {
updateValue: function(value, type) {
this[type] = value; // Aktualizácia lokálnej hodnoty
this.$v[type].$touch(); // Aktivuje validáciu
this.$emit('checkModel', value, type)
},
},
}
</script>