File: vim_fasta-ORF.vim

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 (53 lines) | stat: -rw-r--r-- 1,410 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
" bioSyntax
" Syntax Highlighting for Computational Biology
" =========================================================
" https://bioSyntax.org	||	info@bioSyntax.org  || GPLv3
"
" Filetype:		Fasta-ORF
" Extensions:	[no default set]
" Version:		v0.1
"
" Description:	Nucleotide Fasta highlighting open reading
"				frames (ORFs). Will highlight from first
"				'ATG' to first STOP codon.

if exists("syntax_on")
	syntax reset
	colorscheme bioSyntax
	set nowrap
endif

syntax match headerbw ">.*$"

" ORF begins at first ATG
syntax match Start '\v[Aa]\n?[Tt]\n?[Gg]\n?' nextgroup=codon

	" codon shade 1
	syntax match codon '\v[AaTtGgCc]{-3}\n|
				\[AaTtGgCc]{-3}|
				\[AaTtGgCc\n]{-4}'
				\ contained nextgroup=Opal,Ochre,Amber,codon2

	" codon shade 2
	syntax match codon2 '\v[ATGCatgc]{-3}\n|
				\[AaTtGgCc]{-3}|
				\[AaTtGgCc\n]{-4}'
				\ contained nextgroup=Opal,Ochre,Amber,codon

	" Stop codons: TGA | TAA | TAG
	syntax match Opal  '\v([Tt]\n?[Gg]\n?[Aa]|>)' contained
	syntax match Ochre '\v([Tt]\n?[Aa]\n?[Aa]|>)' contained
	syntax match Amber '\v([Tt]\n?[Aa]\n?[Gg]|>)' contained
	"syntax cluster Stops  contains=Opal,Ochre,Amber

" " Highlighting / Theme Control
" =========================================================

highlight link Start ntA
highlight link codon      numeric
highlight link codon2     numeric2

highlight link Opal  ntC
highlight link Ochre ntC
highlight link Amber ntC