"src/components/core/visualisation/highlight-zdna2.vue" did not exist on "f9ed47e5d84e310cf5ead83b7c03aa132e837f6b"
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
<template>
<div class="highlight">
<span v-for="part of sequenceHighlight" :class="part.styleClass">{{ part.nuclide }}</span>
</div>
</template>
<script>
export default {
props: ['sequence', 'mask'],
data() {
return {}
},
computed: {
sequenceHighlight() {
const styleClass = {
'GC': 'gc', // Definícia štýlu pre sekvenciu "GC"
'default': 'other', // Predvolený štýl pre ostatné nukleotidy
}
let ret = []
let sequence = this.sequence.toUpperCase()
for (var i = 0; i < sequence.length; i++) {
if (sequence.substring(i, i + 2) === "GC") {
ret.push({
styleClass: styleClass['GC'] + (this.mask && this.mask[i] === 'W' ? ' mutation' : ''),
nuclide: "G",
})
ret.push({
styleClass: styleClass['GC'] + (this.mask && this.mask[i + 1] === 'W' ? ' mutation' : ''),
nuclide: "C",
})
i++; // Preskočíme ďalší znak, keďže sme už zvýraznili "GC"
} else {
ret.push({
styleClass: styleClass['default'] + (this.mask && this.mask[i] === 'W' ? ' mutation' : ''),
nuclide: sequence[i],
})
}
}
return ret
},
},
}
</script>
<style scoped>
.gc {
/* Definujte štýly pre zvýraznenie "GC" */
color: #dd0000; /* Príklad: zelená farba pre "GC" */
}
.other {
color: #0000dd;
}
.highlight {
display: block;
word-wrap: break-word;
white-space: normal;
padding: 0;
margin: 0;
line-height: 1;
font-size: 1.3rem;
}
</style>