-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwig.sublime-syntax
105 lines (95 loc) · 2.22 KB
/
wig.sublime-syntax
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
%YAML 1.2
---
# Wig syntax highlighting file
# Maintainer: bioSyntax.org
# Version: v0.1
name: wig
file_extensions: [wig]
scope: source.wig
contexts:
main:
#find declaration line
#declared as fixedStep
- match: fixedStep\s
scope: chr.wig
push: fchrom
#declared as varibleStep
- match: variableStep\s
scope: keyword.wig
push: vchrom
#color data value for variableStep format
- match: (?=([0-9]+\s\d+\s))([0-9]+\s)
scope: numeric.wig
push: colorData
#color data value for fixedStep format
- match: (?=\d+\s)
scope: numeric.wig
push: colorData
#fixedStep chromosome name
fchrom:
- match: chrom
scope: chr.wig
- match: \=
scope: comment.wig
- match: \s
push: fstart
- match: $
pop: true
#fixedStep start position
fstart:
- match: start
scope: chrStart.wig
- match: \s
push: fstep
- match: $
pop: true
#fixedStep step interval
fstep:
- match: step
scope: numeric.wig
- match: $
pop: true
#variableStep chromosome name
vchrom:
- match: chrom
scope: chr.wig
- match: \s
push: vspan
- match: $
pop: true
#variableStep span
vspan:
- match: span
scope: numeric.wig
- match: $
pop: true
#data values will be passed to here and be painted
colorData:
- match: \.\b
scope: comment.gtf
- match: ([1-9]|[1-9].\d+)\b
scope: grad1.gtf
- match: ([1-9])([0-9]|[0-9].\d+)\b
scope: grad1.gtf
- match: 1([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad2.gtf
- match: 2([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad3.gtf
- match: 3([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad4.gtf
- match: 4([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad5.gtf
- match: 5([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad6.gtf
- match: 6([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad7.gtf
- match: 7([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad8.gtf
- match: 8([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad9.gtf
- match: 9([0-9]{2}|[0-9]{2}.\d+)\b
scope: grad10.gtf
- match: ([1-9])([0-9]{2,}|[0-9]{2,}.\d+)\b
scope: grad10.gtf
- match: $
pop: true