-
Notifications
You must be signed in to change notification settings - Fork 2
/
gtf-julia.rl
51 lines (38 loc) · 1.03 KB
/
gtf-julia.rl
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
%%{
machine gtf;
seqname = [^\t]*;
source = [^\t]*;
feature = [^\t]*;
start = digit+;
end = digit+;
score = '.' |
[+\-]?
(
' '* digit+ ('.' digit*)? |
'.' digit+
)
([eE] [+\-]? digit+)?;
strand = [+\-.];
frame = [012.];
attribute_tag = alpha [A-Za-z0-9_]*;
attribute_value = '"' '"' | '"' [^"\n\r\t]* [^\\] '"' | [^"space]*;
attribute = ' '* attribute_tag ' '+ attribute_value;
attributes = (attribute ' '* ';')* attribute?;
gtfline = seqname '\t'
source '\t'
feature '\t'
start '\t'
end '\t'
score '\t'
strand '\t'
frame '\t'
attributes '\n';
main := gtfline*;
}%%
%% write data;
function isgtf(data)
%% write init;
%% write exec;
return cs >= gtf_first_final
end
@time isgtf(readall(open("sample.gtf")))