File: bed.sublime-syntax

package info (click to toggle)
biosyntax 1.0.0b-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,020 kB
  • sloc: sh: 876; javascript: 292; xml: 246; makefile: 52
file content (103 lines) | stat: -rw-r--r-- 2,265 bytes parent folder | download | duplicates (4)
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
%YAML 1.2
---
# Bed syntax highlighting file
# Maintainer: bioSyntax.org
# Version: v0.1
name: bed
file_extensions: [bed]
scope: source.bed


contexts:
  main:
    #Handle UCSC track line
    - match: '^track.*'
      scope: comment.bed
    
    # Column 1: Reference Sequence Name
    - match: '^[\S]*\t'
      scope: chr.bed
      push: start
  
  # Column 2: Start coordinate
  start:
    - match: ([0-9|\.](?=\d{2}\t))
      scope: chrStart2.bed
    - match: ([0-9|\.](?=\d{5}\t))
      scope: chrStart2.bed
    - match: ([0-9|\.](?=\d{8}\t))
      scope: chrStart2.bed
    - match: ([0-9|\.])
      scope: chrStart.bed
    - match: \t
      push: end
    - match: $
      pop: true

  # Column 3: End Coordinate
  end:
    - match: ([0-9|\.](?=\d{2}\t))
      scope: chrStart2.bed
    - match: ([0-9|\.](?=\d{5}\t))
      scope: chrStart2.bed
    - match: ([0-9|\.](?=\d{8}\t))
      scope: chrStart2.bed
    - match: ([0-9|\.])
      scope: chrStart.bed
    - match: \t
      push: name
    - match: $
      pop: true

  # Column 4: Description / Name
  name:
    - match: '[\S]*'
      scope: string.bed
    - match: \t
      push: score
    - match: $
      pop: true

  # Column 5: Score (0-1000 scale)
  score:
    - match: \.\b
      scope: comment.bed
    - match: ([0-9])\b
      scope: grad1.bed  
    - match: ([1-9][0-9])\b
      scope: grad1.bed
    - match: 1[0-9][0-9]\b
      scope: grad2.bed
    - match: 2[0-9][0-9]\b
      scope: grad3.bed
    - match: 3[0-9][0-9]\b
      scope: grad4.bed
    - match: 4[0-9][0-9]\b
      scope: grad5.bed
    - match: 5[0-9][0-9]\b
      scope: grad6.bed
    - match: 6[0-9][0-9]\b
      scope: grad7.bed
    - match: 7[0-9][0-9]\b
      scope: grad8.bed
    - match: 8[0-9][0-9]\b
      scope: grad9.bed
    - match: 9[0-9][0-9]\b
      scope: grad10.bed  
    - match: ([0-9][0-9][0-9][0-9])\b
      scope: grad10.bed                
    - match: \t
      push: strand
    - match: $
      pop: true

  # Column 6: Feature Strand
  strand:
    - match: \+
      scope: strandPlus.bed
    - match: \-
      scope: strandMinus.bed
    - match: \.
      scope: strandNone.bed
    - match: $
      pop: true