Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
297 lines (290 sloc) 13.1 KB
(alphabet
(name RNA)
(token (a c g u))
(complement (u g c a))
(extend (to n) (from a) (from c) (from g) (from u))
(extend (to x) (from a) (from c) (from g) (from u))
(extend (to t) (from u))
(extend (to r) (from a) (from g))
(extend (to y) (from c) (from u))
(extend (to m) (from a) (from c))
(extend (to k) (from g) (from u))
(extend (to s) (from c) (from g))
(extend (to w) (from a) (from u))
(extend (to h) (from a) (from c) (from u))
(extend (to b) (from c) (from g) (from u))
(extend (to v) (from a) (from c) (from g))
(extend (to d) (from a) (from g) (from u))
(wildcard *)
) ;; end alphabet RNA
(grammar
(name dinuc)
(update-rates 1)
(update-rules 1)
(chain
(update-policy rev)
(terminal (PREVNUC EMITNUC))
;; initial probability distribution
(initial (state (a a)) (prob 0.0625))
(initial (state (c a)) (prob 0.0625))
(initial (state (g a)) (prob 0.0625))
(initial (state (u a)) (prob 0.0625))
(initial (state (a c)) (prob 0.0625))
(initial (state (c c)) (prob 0.0625))
(initial (state (g c)) (prob 0.0625))
(initial (state (u c)) (prob 0.0625))
(initial (state (a g)) (prob 0.0625))
(initial (state (c g)) (prob 0.0625))
(initial (state (g g)) (prob 0.0625))
(initial (state (u g)) (prob 0.0625))
(initial (state (a u)) (prob 0.0625))
(initial (state (c u)) (prob 0.0625))
(initial (state (g u)) (prob 0.0625))
(initial (state (u u)) (prob 0.0625))
;; mutation rates
(mutate (from (a a)) (to (c a)) (rate 0.0625))
(mutate (from (a a)) (to (g a)) (rate 0.0625))
(mutate (from (a a)) (to (u a)) (rate 0.0625))
(mutate (from (a a)) (to (a c)) (rate 0.0625))
(mutate (from (a a)) (to (c c)) (rate 0.0625))
(mutate (from (a a)) (to (g c)) (rate 0.0625))
(mutate (from (a a)) (to (u c)) (rate 0.0625))
(mutate (from (a a)) (to (a g)) (rate 0.0625))
(mutate (from (a a)) (to (c g)) (rate 0.0625))
(mutate (from (a a)) (to (g g)) (rate 0.0625))
(mutate (from (a a)) (to (u g)) (rate 0.0625))
(mutate (from (a a)) (to (a u)) (rate 0.0625))
(mutate (from (a a)) (to (c u)) (rate 0.0625))
(mutate (from (a a)) (to (g u)) (rate 0.0625))
(mutate (from (a a)) (to (u u)) (rate 0.0625))
(mutate (from (c a)) (to (a a)) (rate 0.0625))
(mutate (from (c a)) (to (g a)) (rate 0.0625))
(mutate (from (c a)) (to (u a)) (rate 0.0625))
(mutate (from (c a)) (to (a c)) (rate 0.0625))
(mutate (from (c a)) (to (c c)) (rate 0.0625))
(mutate (from (c a)) (to (g c)) (rate 0.0625))
(mutate (from (c a)) (to (u c)) (rate 0.0625))
(mutate (from (c a)) (to (a g)) (rate 0.0625))
(mutate (from (c a)) (to (c g)) (rate 0.0625))
(mutate (from (c a)) (to (g g)) (rate 0.0625))
(mutate (from (c a)) (to (u g)) (rate 0.0625))
(mutate (from (c a)) (to (a u)) (rate 0.0625))
(mutate (from (c a)) (to (c u)) (rate 0.0625))
(mutate (from (c a)) (to (g u)) (rate 0.0625))
(mutate (from (c a)) (to (u u)) (rate 0.0625))
(mutate (from (g a)) (to (a a)) (rate 0.0625))
(mutate (from (g a)) (to (c a)) (rate 0.0625))
(mutate (from (g a)) (to (u a)) (rate 0.0625))
(mutate (from (g a)) (to (a c)) (rate 0.0625))
(mutate (from (g a)) (to (c c)) (rate 0.0625))
(mutate (from (g a)) (to (g c)) (rate 0.0625))
(mutate (from (g a)) (to (u c)) (rate 0.0625))
(mutate (from (g a)) (to (a g)) (rate 0.0625))
(mutate (from (g a)) (to (c g)) (rate 0.0625))
(mutate (from (g a)) (to (g g)) (rate 0.0625))
(mutate (from (g a)) (to (u g)) (rate 0.0625))
(mutate (from (g a)) (to (a u)) (rate 0.0625))
(mutate (from (g a)) (to (c u)) (rate 0.0625))
(mutate (from (g a)) (to (g u)) (rate 0.0625))
(mutate (from (g a)) (to (u u)) (rate 0.0625))
(mutate (from (u a)) (to (a a)) (rate 0.0625))
(mutate (from (u a)) (to (c a)) (rate 0.0625))
(mutate (from (u a)) (to (g a)) (rate 0.0625))
(mutate (from (u a)) (to (a c)) (rate 0.0625))
(mutate (from (u a)) (to (c c)) (rate 0.0625))
(mutate (from (u a)) (to (g c)) (rate 0.0625))
(mutate (from (u a)) (to (u c)) (rate 0.0625))
(mutate (from (u a)) (to (a g)) (rate 0.0625))
(mutate (from (u a)) (to (c g)) (rate 0.0625))
(mutate (from (u a)) (to (g g)) (rate 0.0625))
(mutate (from (u a)) (to (u g)) (rate 0.0625))
(mutate (from (u a)) (to (a u)) (rate 0.0625))
(mutate (from (u a)) (to (c u)) (rate 0.0625))
(mutate (from (u a)) (to (g u)) (rate 0.0625))
(mutate (from (u a)) (to (u u)) (rate 0.0625))
(mutate (from (a c)) (to (a a)) (rate 0.0625))
(mutate (from (a c)) (to (c a)) (rate 0.0625))
(mutate (from (a c)) (to (g a)) (rate 0.0625))
(mutate (from (a c)) (to (u a)) (rate 0.0625))
(mutate (from (a c)) (to (c c)) (rate 0.0625))
(mutate (from (a c)) (to (g c)) (rate 0.0625))
(mutate (from (a c)) (to (u c)) (rate 0.0625))
(mutate (from (a c)) (to (a g)) (rate 0.0625))
(mutate (from (a c)) (to (c g)) (rate 0.0625))
(mutate (from (a c)) (to (g g)) (rate 0.0625))
(mutate (from (a c)) (to (u g)) (rate 0.0625))
(mutate (from (a c)) (to (a u)) (rate 0.0625))
(mutate (from (a c)) (to (c u)) (rate 0.0625))
(mutate (from (a c)) (to (g u)) (rate 0.0625))
(mutate (from (a c)) (to (u u)) (rate 0.0625))
(mutate (from (c c)) (to (a a)) (rate 0.0625))
(mutate (from (c c)) (to (c a)) (rate 0.0625))
(mutate (from (c c)) (to (g a)) (rate 0.0625))
(mutate (from (c c)) (to (u a)) (rate 0.0625))
(mutate (from (c c)) (to (a c)) (rate 0.0625))
(mutate (from (c c)) (to (g c)) (rate 0.0625))
(mutate (from (c c)) (to (u c)) (rate 0.0625))
(mutate (from (c c)) (to (a g)) (rate 0.0625))
(mutate (from (c c)) (to (c g)) (rate 0.0625))
(mutate (from (c c)) (to (g g)) (rate 0.0625))
(mutate (from (c c)) (to (u g)) (rate 0.0625))
(mutate (from (c c)) (to (a u)) (rate 0.0625))
(mutate (from (c c)) (to (c u)) (rate 0.0625))
(mutate (from (c c)) (to (g u)) (rate 0.0625))
(mutate (from (c c)) (to (u u)) (rate 0.0625))
(mutate (from (g c)) (to (a a)) (rate 0.0625))
(mutate (from (g c)) (to (c a)) (rate 0.0625))
(mutate (from (g c)) (to (g a)) (rate 0.0625))
(mutate (from (g c)) (to (u a)) (rate 0.0625))
(mutate (from (g c)) (to (a c)) (rate 0.0625))
(mutate (from (g c)) (to (c c)) (rate 0.0625))
(mutate (from (g c)) (to (u c)) (rate 0.0625))
(mutate (from (g c)) (to (a g)) (rate 0.0625))
(mutate (from (g c)) (to (c g)) (rate 0.0625))
(mutate (from (g c)) (to (g g)) (rate 0.0625))
(mutate (from (g c)) (to (u g)) (rate 0.0625))
(mutate (from (g c)) (to (a u)) (rate 0.0625))
(mutate (from (g c)) (to (c u)) (rate 0.0625))
(mutate (from (g c)) (to (g u)) (rate 0.0625))
(mutate (from (g c)) (to (u u)) (rate 0.0625))
(mutate (from (u c)) (to (a a)) (rate 0.0625))
(mutate (from (u c)) (to (c a)) (rate 0.0625))
(mutate (from (u c)) (to (g a)) (rate 0.0625))
(mutate (from (u c)) (to (u a)) (rate 0.0625))
(mutate (from (u c)) (to (a c)) (rate 0.0625))
(mutate (from (u c)) (to (c c)) (rate 0.0625))
(mutate (from (u c)) (to (g c)) (rate 0.0625))
(mutate (from (u c)) (to (a g)) (rate 0.0625))
(mutate (from (u c)) (to (c g)) (rate 0.0625))
(mutate (from (u c)) (to (g g)) (rate 0.0625))
(mutate (from (u c)) (to (u g)) (rate 0.0625))
(mutate (from (u c)) (to (a u)) (rate 0.0625))
(mutate (from (u c)) (to (c u)) (rate 0.0625))
(mutate (from (u c)) (to (g u)) (rate 0.0625))
(mutate (from (u c)) (to (u u)) (rate 0.0625))
(mutate (from (a g)) (to (a a)) (rate 0.0625))
(mutate (from (a g)) (to (c a)) (rate 0.0625))
(mutate (from (a g)) (to (g a)) (rate 0.0625))
(mutate (from (a g)) (to (u a)) (rate 0.0625))
(mutate (from (a g)) (to (a c)) (rate 0.0625))
(mutate (from (a g)) (to (c c)) (rate 0.0625))
(mutate (from (a g)) (to (g c)) (rate 0.0625))
(mutate (from (a g)) (to (u c)) (rate 0.0625))
(mutate (from (a g)) (to (c g)) (rate 0.0625))
(mutate (from (a g)) (to (g g)) (rate 0.0625))
(mutate (from (a g)) (to (u g)) (rate 0.0625))
(mutate (from (a g)) (to (a u)) (rate 0.0625))
(mutate (from (a g)) (to (c u)) (rate 0.0625))
(mutate (from (a g)) (to (g u)) (rate 0.0625))
(mutate (from (a g)) (to (u u)) (rate 0.0625))
(mutate (from (c g)) (to (a a)) (rate 0.0625))
(mutate (from (c g)) (to (c a)) (rate 0.0625))
(mutate (from (c g)) (to (g a)) (rate 0.0625))
(mutate (from (c g)) (to (u a)) (rate 0.0625))
(mutate (from (c g)) (to (a c)) (rate 0.0625))
(mutate (from (c g)) (to (c c)) (rate 0.0625))
(mutate (from (c g)) (to (g c)) (rate 0.0625))
(mutate (from (c g)) (to (u c)) (rate 0.0625))
(mutate (from (c g)) (to (a g)) (rate 0.0625))
(mutate (from (c g)) (to (g g)) (rate 0.0625))
(mutate (from (c g)) (to (u g)) (rate 0.0625))
(mutate (from (c g)) (to (a u)) (rate 0.0625))
(mutate (from (c g)) (to (c u)) (rate 0.0625))
(mutate (from (c g)) (to (g u)) (rate 0.0625))
(mutate (from (c g)) (to (u u)) (rate 0.0625))
(mutate (from (g g)) (to (a a)) (rate 0.0625))
(mutate (from (g g)) (to (c a)) (rate 0.0625))
(mutate (from (g g)) (to (g a)) (rate 0.0625))
(mutate (from (g g)) (to (u a)) (rate 0.0625))
(mutate (from (g g)) (to (a c)) (rate 0.0625))
(mutate (from (g g)) (to (c c)) (rate 0.0625))
(mutate (from (g g)) (to (g c)) (rate 0.0625))
(mutate (from (g g)) (to (u c)) (rate 0.0625))
(mutate (from (g g)) (to (a g)) (rate 0.0625))
(mutate (from (g g)) (to (c g)) (rate 0.0625))
(mutate (from (g g)) (to (u g)) (rate 0.0625))
(mutate (from (g g)) (to (a u)) (rate 0.0625))
(mutate (from (g g)) (to (c u)) (rate 0.0625))
(mutate (from (g g)) (to (g u)) (rate 0.0625))
(mutate (from (g g)) (to (u u)) (rate 0.0625))
(mutate (from (u g)) (to (a a)) (rate 0.0625))
(mutate (from (u g)) (to (c a)) (rate 0.0625))
(mutate (from (u g)) (to (g a)) (rate 0.0625))
(mutate (from (u g)) (to (u a)) (rate 0.0625))
(mutate (from (u g)) (to (a c)) (rate 0.0625))
(mutate (from (u g)) (to (c c)) (rate 0.0625))
(mutate (from (u g)) (to (g c)) (rate 0.0625))
(mutate (from (u g)) (to (u c)) (rate 0.0625))
(mutate (from (u g)) (to (a g)) (rate 0.0625))
(mutate (from (u g)) (to (c g)) (rate 0.0625))
(mutate (from (u g)) (to (g g)) (rate 0.0625))
(mutate (from (u g)) (to (a u)) (rate 0.0625))
(mutate (from (u g)) (to (c u)) (rate 0.0625))
(mutate (from (u g)) (to (g u)) (rate 0.0625))
(mutate (from (u g)) (to (u u)) (rate 0.0625))
(mutate (from (a u)) (to (a a)) (rate 0.0625))
(mutate (from (a u)) (to (c a)) (rate 0.0625))
(mutate (from (a u)) (to (g a)) (rate 0.0625))
(mutate (from (a u)) (to (u a)) (rate 0.0625))
(mutate (from (a u)) (to (a c)) (rate 0.0625))
(mutate (from (a u)) (to (c c)) (rate 0.0625))
(mutate (from (a u)) (to (g c)) (rate 0.0625))
(mutate (from (a u)) (to (u c)) (rate 0.0625))
(mutate (from (a u)) (to (a g)) (rate 0.0625))
(mutate (from (a u)) (to (c g)) (rate 0.0625))
(mutate (from (a u)) (to (g g)) (rate 0.0625))
(mutate (from (a u)) (to (u g)) (rate 0.0625))
(mutate (from (a u)) (to (c u)) (rate 0.0625))
(mutate (from (a u)) (to (g u)) (rate 0.0625))
(mutate (from (a u)) (to (u u)) (rate 0.0625))
(mutate (from (c u)) (to (a a)) (rate 0.0625))
(mutate (from (c u)) (to (c a)) (rate 0.0625))
(mutate (from (c u)) (to (g a)) (rate 0.0625))
(mutate (from (c u)) (to (u a)) (rate 0.0625))
(mutate (from (c u)) (to (a c)) (rate 0.0625))
(mutate (from (c u)) (to (c c)) (rate 0.0625))
(mutate (from (c u)) (to (g c)) (rate 0.0625))
(mutate (from (c u)) (to (u c)) (rate 0.0625))
(mutate (from (c u)) (to (a g)) (rate 0.0625))
(mutate (from (c u)) (to (c g)) (rate 0.0625))
(mutate (from (c u)) (to (g g)) (rate 0.0625))
(mutate (from (c u)) (to (u g)) (rate 0.0625))
(mutate (from (c u)) (to (a u)) (rate 0.0625))
(mutate (from (c u)) (to (g u)) (rate 0.0625))
(mutate (from (c u)) (to (u u)) (rate 0.0625))
(mutate (from (g u)) (to (a a)) (rate 0.0625))
(mutate (from (g u)) (to (c a)) (rate 0.0625))
(mutate (from (g u)) (to (g a)) (rate 0.0625))
(mutate (from (g u)) (to (u a)) (rate 0.0625))
(mutate (from (g u)) (to (a c)) (rate 0.0625))
(mutate (from (g u)) (to (c c)) (rate 0.0625))
(mutate (from (g u)) (to (g c)) (rate 0.0625))
(mutate (from (g u)) (to (u c)) (rate 0.0625))
(mutate (from (g u)) (to (a g)) (rate 0.0625))
(mutate (from (g u)) (to (c g)) (rate 0.0625))
(mutate (from (g u)) (to (g g)) (rate 0.0625))
(mutate (from (g u)) (to (u g)) (rate 0.0625))
(mutate (from (g u)) (to (a u)) (rate 0.0625))
(mutate (from (g u)) (to (c u)) (rate 0.0625))
(mutate (from (g u)) (to (u u)) (rate 0.0625))
(mutate (from (u u)) (to (a a)) (rate 0.0625))
(mutate (from (u u)) (to (c a)) (rate 0.0625))
(mutate (from (u u)) (to (g a)) (rate 0.0625))
(mutate (from (u u)) (to (u a)) (rate 0.0625))
(mutate (from (u u)) (to (a c)) (rate 0.0625))
(mutate (from (u u)) (to (c c)) (rate 0.0625))
(mutate (from (u u)) (to (g c)) (rate 0.0625))
(mutate (from (u u)) (to (u c)) (rate 0.0625))
(mutate (from (u u)) (to (a g)) (rate 0.0625))
(mutate (from (u u)) (to (c g)) (rate 0.0625))
(mutate (from (u u)) (to (g g)) (rate 0.0625))
(mutate (from (u u)) (to (u g)) (rate 0.0625))
(mutate (from (u u)) (to (a u)) (rate 0.0625))
(mutate (from (u u)) (to (c u)) (rate 0.0625))
(mutate (from (u u)) (to (g u)) (rate 0.0625))
) ;; end chain PREVNUC EMITNUC
;; state S
(transform (from (PREVNUC S)) (to (PREVNUC EMITNUC S*)) (gaps-ok))
(transform (from (S*)) (to ()) (prob 0.00100054))
(transform (from (S*)) (to (S)) (prob 0.999307))
) ;; end grammar dinuc