-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpdb.sublime-syntax
252 lines (224 loc) · 6.3 KB
/
pdb.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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
%YAML 1.2
---
# PDB syntax highlighting file
# Maintainer: bioSyntax.org
# Version: v0.1
name: pdb
# YAML for PDB files
file_extensions: [pdb]
scope: source.pdb
contexts:
main:
#Header line
- match: '^HEADER.*$'
scope: invalid.pdb
#Title line
- match: '^TITLE.*$'
scope: constant.character.pdb
#COMPND line
- match: '^COMPND.*$'
scope: markup.deleted.pdb
#SOURCE line
- match: '^SOURCE.*$'
scope: constant.language.pdb
#KEYWDS line
- match: '^KEYWDS.*$'
scope: entity.name.pdb
#EXPDTA line
- match: '^EXPDTA.*$'
scope: storage.type.pdb
#AUTHOR line
- match: '^AUTHOR.*$'
scope: string.pdb
#REVDAT line
- match: "^REVDAT.*$"
scope: constant.character.pdb
#JRNL section
- match: '^JRNL.*$'
push: journal
#REMARK section
- match: '^REMARK[\s\t]+[0-9]+'
push: remark
#SEQRES section
- match: '^SEQRES'
#scope: storage.type.pdb
push: seqres
#HELIX section
- match: "^HELIX.*$"
scope: storage.type.pdb
#HELIX section
- match: "^SHEET.*$"
scope: entity.name.tag.pdb
#SITE section
- match: "^SITE.*$"
scope: string.pdb
#ATOM section
- match: '^(ATOM|ANISOU)[\s\t]+[0-9]+[\s\t]+[A-Z0-9]+'
#scope: constant.character.pdb
push: atom
#HETATM section
- match: "^HETATM.*$"
scope: markup.deleted.pdb
journal:
- meta_scope: string.pdb #colour everything in this section
- match: '[\s\t]+TITL\b.*'
scope: entity.name.pdb #colour the title of the paper
- match: '(?!JRNL\b)\b.*' #when new string starts with no JRNL header, go out
pop: true
remark:
- meta_scope: constant.character.pdb #meta.structure.dictionary.json.pdb
- match: '[\s\t]+RESOLUTION.*$' #'[\s\t]+(?=RESOLUTION).*'
scope: entity.name.pdb #string.unquoted.yaml.pdb
- match: '.*(?=:)'
push: remark_value
- match: '((?!REMARK).)*$' #'(?!REMARK\b)\b.*'
pop: true
remark_value:
- meta_scope: constant.character.pdb
- match: ':[\s\t]+NULL' #':([\s\t]+NULL[\s\t]+.*)+'
#scope: markup.deleted.pdb
push: semicolon_NULL
- match: ':'
#scope: entity.name.pdb
push: semicolon
- match: '$'
pop: true
semicolon:
- meta_scope: entity.name.pdb
- match: '[\s\t]?;[\s\t]?'
scope: constant.language.pdb
- match: '$'
pop: true
semicolon_NULL:
- meta_scope: markup.deleted.pdb
- match: '[\s\t]?;[\s\t]?'
scope: constant.language.pdb
- match: '$'
pop: true
seqres:
#different chanes should be coloured differently (focus on A-H)
#don't care about colours for now, but they should be different
- meta_scope: constant.character.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[AP].*'
scope: ntA.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[BQ].*'
scope: ntT.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[CR].*'
scope: ntG.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[DS].*'
scope: ntC.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[ET].*'
scope: ntU.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[FU].*'
scope: ntR.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[GV].*'
scope: ntY.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[HW].*'
scope: ntS.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[IX].*'
scope: ntW.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[JY].*'
scope: ntM.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[KZ].*'
scope: ntK.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[L].*'
scope: ntD.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[M].*'
scope: ntB.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[N].*'
scope: ntV.pdb
- match: '[\s\t]+[0-9]+[\s\t]+[O].*'
scope: ntH.pdb
- match: '$'
pop: true
atom:
- meta_scope: constant.character.pdb
#residue number
- match: '(?<=[A-Z])[\s\t]+[0-9]+'
scope: storage.type.pdb
#amino acids
- match: '[\s\t]+ALA'
scope: aaA
- match: '[\s\t]+ARG'
scope: aaR
- match: '[\s\t]+ASN'
scope: aaN
- match: '[\s\t]+ASP'
scope: aaD
- match: '[\s\t]+CYS'
scope: aaC
- match: '[\s\t]+GLN'
scope: aaQ
- match: '[\s\t]+GLU'
scope: aaE
- match: '[\s\t]+GLY'
scope: aaG
- match: '[\s\t]+HIS'
scope: aaH
- match: '[\s\t]+ILE'
scope: aaI
- match: '[\s\t]+LEU'
scope: aaL
- match: '[\s\t]+LYS'
scope: aaK
- match: '[\s\t]+MET'
scope: aaM
- match: '[\s\t]+MSE'
scope: aaM
- match: '[\s\t]+PHE'
scope: aaF
- match: '[\s\t]+PRO'
scope: aaP
- match: '[\s\t]+SER'
scope: aaS
- match: '[\s\t]+SEC'
scope: aaU
- match: '[\s\t]+THR'
scope: aaT
- match: '[\s\t]+TRP'
scope: aaW
- match: '[\s\t]+TYR'
scope: aaY
- match: '[\s\t]+VAL'
scope: aaV
- match: '[\s\t]+UNK'
scope: aaX
#define chains (different colours for different chains from A-H)
- match: '(?<=[\s\t])[AP](?=[\s\t]+[0-9])'
scope: ntA.pdb
- match: '(?<=[\s\t])[BQ](?=[\s\t]+[0-9])'
scope: ntT.pdb
- match: '(?<=[\s\t])[CR](?=[\s\t]+[0-9])'
scope: ntG.pdb
- match: '(?<=[\s\t])[DS](?=[\s\t]+[0-9])'
scope: ntC.pdb
- match: '(?<=[\s\t])[ET](?=[\s\t]+[0-9])'
scope: ntU.pdb
- match: '(?<=[\s\t])[FU](?=[\s\t]+[0-9])'
scope: ntR.pdb
- match: '(?<=[\s\t])[GV](?=[\s\t]+[0-9])'
scope: ntY.pdb
- match: '(?<=[\s\t])[HW](?=[\s\t]+[0-9])'
scope: ntS.pdb
- match: '(?<=[\s\t])[IX](?=[\s\t]+[0-9])'
scope: ntW.pdb
- match: '(?<=[\s\t])[JY](?=[\s\t]+[0-9])'
scope: ntM.pdb
- match: '(?<=[\s\t])[KZ](?=[\s\t]+[0-9])'
scope: ntK.pdb
- match: '(?<=[\s\t])L(?=[\s\t]+[0-9])'
scope: ntD.pdb
- match: '(?<=[\s\t])M(?=[\s\t]+[0-9])'
scope: ntB.pdb
- match: '(?<=[\s\t])N(?=[\s\t]+[0-9])'
scope: ntV.pdb
- match: '(?<=[\s\t])O(?=[\s\t]+[0-9])'
scope: ntH.pdb
- match: '$'
pop: true
#aa_chain_resnumber:
#- meta_scope: string.pdb
#- match: '[A-Z]{3}'
#scope: storage.type.pdb'
#- match: '[\s\t]+'
#pop: true