;; Grammar pfold
;;
(grammar
(name pfold)
(update-rates 1)
(update-rules 1)
;; Transformation rules for grammar symbols
;; State pfoldS
;;
(transform (from (pfoldS)) (to (pfoldL)) (prob 0.0888798))
(transform (from (pfoldS)) (to (pfoldB)) (prob 0.911301))
;; State pfoldF
;;
(transform (from (pfoldF)) (to (LNUC pfoldF* RNUC)) (gaps-ok)
(annotate (row SS_cons) (column LNUC) (label <))
(annotate (row SS_cons) (column RNUC) (label >))
(minlen 2))
(transform (from (pfoldF*)) (to (pfoldF)) (prob 0.753667))
(transform (from (pfoldF*)) (to (pfoldB)) (prob 0.2469))
;; State pfoldL
;;
(transform (from (pfoldL)) (to (pfoldF)) (prob 0.0745835))
(transform (from (pfoldL)) (to (pfoldU)) (prob 0.925946))
;; State pfoldB
;;
(transform (from (pfoldB)) (to (pfoldL pfoldS)))
;; State pfoldU
;;
(transform (from (pfoldU)) (to (NUC pfoldU*)) (gaps-ok)
(annotate (row SS_cons) (column NUC) (label _))
(minlen 1))
(transform (from (pfoldU*)) (to ()) (prob 1))
;; Markov chain substitution models
(chain
(update-policy rev)
(terminal (LNUC RNUC))
;; initial probability distribution
(initial (state (a a)) (prob 0.0228465))
(initial (state (c a)) (prob 0.0161447))
(initial (state (g a)) (prob 0.0218842))
(initial (state (u a)) (prob 0.164218))
(initial (state (a c)) (prob 0.0121978))
(initial (state (c c)) (prob 0.0110829))
(initial (state (g c)) (prob 0.22142))
(initial (state (u c)) (prob 0.00988232))
(initial (state (a g)) (prob 0.0142639))
(initial (state (c g)) (prob 0.216563))
(initial (state (g g)) (prob 0.014943))
(initial (state (u g)) (prob 0.0600486))
(initial (state (a u)) (prob 0.135061))
(initial (state (c u)) (prob 0.0105746))
(initial (state (g u)) (prob 0.0487416))
(initial (state (u u)) (prob 0.0201287))
;; mutation rates
(mutate (from (a a)) (to (c a)) (rate 0.232935))
(mutate (from (a a)) (to (g a)) (rate 0.278363))
(mutate (from (a a)) (to (u a)) (rate 0.442669))
(mutate (from (a a)) (to (a c)) (rate 0.21661))
(mutate (from (a a)) (to (c c)) (rate 0.0163224))
(mutate (from (a a)) (to (g c)) (rate 0.00529501))
(mutate (from (a a)) (to (u c)) (rate 0.0451581))
(mutate (from (a a)) (to (a g)) (rate 0.289094))
(mutate (from (a a)) (to (c g)) (rate 0.00486023))
(mutate (from (a a)) (to (g g)) (rate 0.0357234))
(mutate (from (a a)) (to (u g)) (rate 0.0467622))
(mutate (from (a a)) (to (a u)) (rate 0.417535))
(mutate (from (a a)) (to (c u)) (rate 0.0574855))
(mutate (from (a a)) (to (g u)) (rate 0.0657536))
(mutate (from (a a)) (to (u u)) (rate 0.126285))
(mutate (from (c a)) (to (a a)) (rate 0.329627))
(mutate (from (c a)) (to (g a)) (rate 0.198078))
(mutate (from (c a)) (to (u a)) (rate 1.05653))
(mutate (from (c a)) (to (a c)) (rate 0.0443118))
(mutate (from (c a)) (to (c c)) (rate 0.294163))
(mutate (from (c a)) (to (g c)) (rate 0.00956298))
(mutate (from (c a)) (to (u c)) (rate 0.0715911))
(mutate (from (c a)) (to (a g)) (rate 0.0491335))
(mutate (from (c a)) (to (c g)) (rate 0.944452))
(mutate (from (c a)) (to (g g)) (rate 0.0298297))
(mutate (from (c a)) (to (u g)) (rate 0.139075))
(mutate (from (c a)) (to (a u)) (rate 0.0279239))
(mutate (from (c a)) (to (c u)) (rate 0.418415))
(mutate (from (c a)) (to (g u)) (rate 0.0309747))
(mutate (from (c a)) (to (u u)) (rate 0.0807136))
(mutate (from (g a)) (to (a a)) (rate 0.290603))
(mutate (from (g a)) (to (c a)) (rate 0.146129))
(mutate (from (g a)) (to (u a)) (rate 0.20632))
(mutate (from (g a)) (to (a c)) (rate 0.0150121))
(mutate (from (g a)) (to (c c)) (rate 0.0138578))
(mutate (from (g a)) (to (g c)) (rate 0.17892))
(mutate (from (g a)) (to (u c)) (rate 0.0285063))
(mutate (from (g a)) (to (a g)) (rate 0.041656))
(mutate (from (g a)) (to (c g)) (rate 0.0112407))
(mutate (from (g a)) (to (g g)) (rate 0.399829))
(mutate (from (g a)) (to (u g)) (rate 0.0159419))
(mutate (from (g a)) (to (a u)) (rate 0.0600181))
(mutate (from (g a)) (to (c u)) (rate 0.0142424))
(mutate (from (g a)) (to (g u)) (rate 0.206404))
(mutate (from (g a)) (to (u u)) (rate 0.0733953))
(mutate (from (u a)) (to (a a)) (rate 0.0615855))
(mutate (from (u a)) (to (c a)) (rate 0.103871))
(mutate (from (u a)) (to (g a)) (rate 0.0274949))
(mutate (from (u a)) (to (a c)) (rate 0.00572901))
(mutate (from (u a)) (to (c c)) (rate 0.000302498))
(mutate (from (u a)) (to (g c)) (rate 0.125656))
(mutate (from (u a)) (to (u c)) (rate 0.0435469))
(mutate (from (u a)) (to (a g)) (rate 0.0117235))
(mutate (from (u a)) (to (c g)) (rate 0.392175))
(mutate (from (u a)) (to (g g)) (rate 0.00346473))
(mutate (from (u a)) (to (u g)) (rate 0.20071))
(mutate (from (u a)) (to (a u)) (rate 0.186955))
(mutate (from (u a)) (to (c u)) (rate 0.00182837))
(mutate (from (u a)) (to (g u)) (rate 0.0225739))
(mutate (from (u a)) (to (u u)) (rate 0.0810523))
(mutate (from (a c)) (to (a a)) (rate 0.405709))
(mutate (from (a c)) (to (c a)) (rate 0.0586499))
(mutate (from (a c)) (to (g a)) (rate 0.0269333))
(mutate (from (a c)) (to (u a)) (rate 0.0771289))
(mutate (from (a c)) (to (c c)) (rate 0.319768))
(mutate (from (a c)) (to (g c)) (rate 0.859852))
(mutate (from (a c)) (to (u c)) (rate 0.34587))
(mutate (from (a c)) (to (a g)) (rate 0.146981))
(mutate (from (a c)) (to (c g)) (rate 0.0319116))
(mutate (from (a c)) (to (g g)) (rate 0.120589))
(mutate (from (a c)) (to (u g)) (rate 0.0406886))
(mutate (from (a c)) (to (a u)) (rate 0.814662))
(mutate (from (a c)) (to (c u)) (rate 0.0384822))
(mutate (from (a c)) (to (g u)) (rate 0.35091))
(mutate (from (a c)) (to (u u)) (rate 0.234822))
(mutate (from (c c)) (to (a a)) (rate 0.0336472))
(mutate (from (c c)) (to (c a)) (rate 0.428515))
(mutate (from (c c)) (to (g a)) (rate 0.0273636))
(mutate (from (c c)) (to (u a)) (rate 0.0044822))
(mutate (from (c c)) (to (a c)) (rate 0.351938))
(mutate (from (c c)) (to (g c)) (rate 0.341469))
(mutate (from (c c)) (to (u c)) (rate 0.910666))
(mutate (from (c c)) (to (a g)) (rate 0.0115937))
(mutate (from (c c)) (to (c g)) (rate 0.502437))
(mutate (from (c c)) (to (g g)) (rate 0.0298207))
(mutate (from (c c)) (to (u g)) (rate 0.053901))
(mutate (from (c c)) (to (a u)) (rate 0.00164932))
(mutate (from (c c)) (to (c u)) (rate 0.843265))
(mutate (from (c c)) (to (g u)) (rate 0.0430873))
(mutate (from (c c)) (to (u u)) (rate 0.0620845))
(mutate (from (g c)) (to (a a)) (rate 0.000546348))
(mutate (from (g c)) (to (c a)) (rate 0.00069728))
(mutate (from (g c)) (to (g a)) (rate 0.0176837))
(mutate (from (g c)) (to (u a)) (rate 0.0931936))
(mutate (from (g c)) (to (a c)) (rate 0.0473685))
(mutate (from (g c)) (to (c c)) (rate 0.0170918))
(mutate (from (g c)) (to (u c)) (rate 0.0220961))
(mutate (from (g c)) (to (a g)) (rate 0.00220435))
(mutate (from (g c)) (to (c g)) (rate 0.138649))
(mutate (from (g c)) (to (g g)) (rate 0.0212823))
(mutate (from (g c)) (to (u g)) (rate 0.0171876))
(mutate (from (g c)) (to (a u)) (rate 0.284742))
(mutate (from (g c)) (to (c u)) (rate 0.00310648))
(mutate (from (g c)) (to (g u)) (rate 0.183016))
(mutate (from (g c)) (to (u u)) (rate 0.0072272))
(mutate (from (u c)) (to (a a)) (rate 0.104399))
(mutate (from (u c)) (to (c a)) (rate 0.116958))
(mutate (from (u c)) (to (g a)) (rate 0.0631267))
(mutate (from (u c)) (to (u a)) (rate 0.723633))
(mutate (from (u c)) (to (a c)) (rate 0.42691))
(mutate (from (u c)) (to (c c)) (rate 1.0213))
(mutate (from (u c)) (to (g c)) (rate 0.495077))
(mutate (from (u c)) (to (a g)) (rate 0.0772664))
(mutate (from (u c)) (to (c g)) (rate 0.0997815))
(mutate (from (u c)) (to (g g)) (rate 0.21653))
(mutate (from (u c)) (to (u g)) (rate 0.396524))
(mutate (from (u c)) (to (a u)) (rate 0.151578))
(mutate (from (u c)) (to (c u)) (rate 0.327868))
(mutate (from (u c)) (to (g u)) (rate 0.0655005))
(mutate (from (u c)) (to (u u)) (rate 0.969586))
(mutate (from (a g)) (to (a a)) (rate 0.463042))
(mutate (from (a g)) (to (c a)) (rate 0.0556122))
(mutate (from (a g)) (to (g a)) (rate 0.0639101))
(mutate (from (a g)) (to (u a)) (rate 0.134971))
(mutate (from (a g)) (to (a c)) (rate 0.125691))
(mutate (from (a g)) (to (c c)) (rate 0.00900819))
(mutate (from (a g)) (to (g c)) (rate 0.0342183))
(mutate (from (a g)) (to (u c)) (rate 0.0535317))
(mutate (from (a g)) (to (c g)) (rate 0.37781))
(mutate (from (a g)) (to (g g)) (rate 0.381481))
(mutate (from (a g)) (to (u g)) (rate 0.2406))
(mutate (from (a g)) (to (a u)) (rate 0.377184))
(mutate (from (a g)) (to (c u)) (rate 0.0457857))
(mutate (from (a g)) (to (g u)) (rate 0.0672571))
(mutate (from (a g)) (to (u u)) (rate 0.156892))
(mutate (from (c g)) (to (a a)) (rate 0.000512734))
(mutate (from (c g)) (to (c a)) (rate 0.0704088))
(mutate (from (c g)) (to (g a)) (rate 0.0011359))
(mutate (from (c g)) (to (u a)) (rate 0.297384))
(mutate (from (c g)) (to (a c)) (rate 0.00179741))
(mutate (from (c g)) (to (c c)) (rate 0.0257129))
(mutate (from (c g)) (to (g c)) (rate 0.141759))
(mutate (from (c g)) (to (u c)) (rate 0.00455329))
(mutate (from (c g)) (to (a g)) (rate 0.0248845))
(mutate (from (c g)) (to (g g)) (rate 0.0279372))
(mutate (from (c g)) (to (u g)) (rate 0.172287))
(mutate (from (c g)) (to (a u)) (rate 0.109935))
(mutate (from (c g)) (to (c u)) (rate 0.024824))
(mutate (from (c g)) (to (g u)) (rate 0.0296638))
(mutate (from (c g)) (to (u u)) (rate 0.0111359))
(mutate (from (g g)) (to (a a)) (rate 0.0546176))
(mutate (from (g g)) (to (c a)) (rate 0.0322285))
(mutate (from (g g)) (to (g a)) (rate 0.585553))
(mutate (from (g g)) (to (u a)) (rate 0.0380759))
(mutate (from (g g)) (to (a c)) (rate 0.0984358))
(mutate (from (g g)) (to (c c)) (rate 0.0221172))
(mutate (from (g g)) (to (g c)) (rate 0.315352))
(mutate (from (g g)) (to (u c)) (rate 0.143198))
(mutate (from (g g)) (to (a g)) (rate 0.364143))
(mutate (from (g g)) (to (c g)) (rate 0.404881))
(mutate (from (g g)) (to (u g)) (rate 0.21474))
(mutate (from (g g)) (to (a u)) (rate 0.0294367))
(mutate (from (g g)) (to (c u)) (rate 0.0639325))
(mutate (from (g g)) (to (g u)) (rate 0.362801))
(mutate (from (g g)) (to (u u)) (rate 0.118178))
(mutate (from (u g)) (to (a a)) (rate 0.0177914))
(mutate (from (u g)) (to (c a)) (rate 0.0373919))
(mutate (from (u g)) (to (g a)) (rate 0.00580986))
(mutate (from (u g)) (to (u a)) (rate 0.548891))
(mutate (from (u g)) (to (a c)) (rate 0.00826519))
(mutate (from (u g)) (to (c c)) (rate 0.00994823))
(mutate (from (u g)) (to (g c)) (rate 0.0633766))
(mutate (from (u g)) (to (u c)) (rate 0.0652568))
(mutate (from (u g)) (to (a g)) (rate 0.057152))
(mutate (from (u g)) (to (c g)) (rate 0.621343))
(mutate (from (u g)) (to (g g)) (rate 0.0534378))
(mutate (from (u g)) (to (a u)) (rate 0.0428718))
(mutate (from (u g)) (to (c u)) (rate 0.0137622))
(mutate (from (u g)) (to (g u)) (rate 0.040235))
(mutate (from (u g)) (to (u u)) (rate 0.12103))
(mutate (from (a u)) (to (a a)) (rate 0.0706289))
(mutate (from (a u)) (to (c a)) (rate 0.00333792))
(mutate (from (a u)) (to (g a)) (rate 0.00972485))
(mutate (from (a u)) (to (u a)) (rate 0.227315))
(mutate (from (a u)) (to (a c)) (rate 0.073575))
(mutate (from (a u)) (to (c c)) (rate 0.00013534))
(mutate (from (a u)) (to (g c)) (rate 0.466808))
(mutate (from (a u)) (to (u c)) (rate 0.0110909))
(mutate (from (a u)) (to (a g)) (rate 0.0398347))
(mutate (from (a u)) (to (c g)) (rate 0.176274))
(mutate (from (a u)) (to (g g)) (rate 0.00325686))
(mutate (from (a u)) (to (u g)) (rate 0.019061))
(mutate (from (a u)) (to (c u)) (rate 0.0267973))
(mutate (from (a u)) (to (g u)) (rate 0.266126))
(mutate (from (a u)) (to (u u)) (rate 0.0914102))
(mutate (from (c u)) (to (a a)) (rate 0.124197))
(mutate (from (c u)) (to (c a)) (rate 0.638811))
(mutate (from (c u)) (to (g a)) (rate 0.0294746))
(mutate (from (c u)) (to (u a)) (rate 0.0283935))
(mutate (from (c u)) (to (a c)) (rate 0.0443892))
(mutate (from (c u)) (to (c c)) (rate 0.883794))
(mutate (from (c u)) (to (g c)) (rate 0.0650459))
(mutate (from (c u)) (to (u c)) (rate 0.306403))
(mutate (from (c u)) (to (a g)) (rate 0.0617594))
(mutate (from (c u)) (to (c g)) (rate 0.508381))
(mutate (from (c u)) (to (g g)) (rate 0.0903431))
(mutate (from (c u)) (to (u g)) (rate 0.0781497))
(mutate (from (c u)) (to (a u)) (rate 0.34226))
(mutate (from (c u)) (to (g u)) (rate 0.415204))
(mutate (from (c u)) (to (u u)) (rate 0.678589))
(mutate (from (g u)) (to (a a)) (rate 0.0308204))
(mutate (from (g u)) (to (c a)) (rate 0.0102598))
(mutate (from (g u)) (to (g a)) (rate 0.092672))
(mutate (from (g u)) (to (u a)) (rate 0.076055))
(mutate (from (g u)) (to (a c)) (rate 0.0878171))
(mutate (from (g u)) (to (c c)) (rate 0.00979718))
(mutate (from (g u)) (to (g c)) (rate 0.831392))
(mutate (from (g u)) (to (u c)) (rate 0.0132802))
(mutate (from (g u)) (to (a g)) (rate 0.0196823))
(mutate (from (g u)) (to (c g)) (rate 0.131798))
(mutate (from (g u)) (to (g g)) (rate 0.111226))
(mutate (from (g u)) (to (u g)) (rate 0.0495686))
(mutate (from (g u)) (to (a u)) (rate 0.737425))
(mutate (from (g u)) (to (c u)) (rate 0.0900796))
(mutate (from (g u)) (to (u u)) (rate 0.107341))
(mutate (from (u u)) (to (a a)) (rate 0.143335))
(mutate (from (u u)) (to (c a)) (rate 0.0647381))
(mutate (from (u u)) (to (g a)) (rate 0.0797961))
(mutate (from (u u)) (to (u a)) (rate 0.661254))
(mutate (from (u u)) (to (a c)) (rate 0.1423))
(mutate (from (u u)) (to (c c)) (rate 0.0341837))
(mutate (from (u u)) (to (g c)) (rate 0.0795004))
(mutate (from (u u)) (to (u c)) (rate 0.476023))
(mutate (from (u u)) (to (a g)) (rate 0.111179))
(mutate (from (u u)) (to (c g)) (rate 0.11981))
(mutate (from (u u)) (to (g g)) (rate 0.0877322))
(mutate (from (u u)) (to (u g)) (rate 0.361059))
(mutate (from (u u)) (to (a u)) (rate 0.613349))
(mutate (from (u u)) (to (c u)) (rate 0.356496))
(mutate (from (u u)) (to (g u)) (rate 0.259927))
) ;; end chain LNUC RNUC
(chain
(update-policy rev)
(terminal (NUC))
;; initial probability distribution
(initial (state (a)) (prob 0.316823))
(initial (state (c)) (prob 0.191125))
(initial (state (g)) (prob 0.231626))
(initial (state (u)) (prob 0.260426))
;; mutation rates
(mutate (from (a)) (to (c)) (rate 0.216179))
(mutate (from (a)) (to (g)) (rate 0.323422))
(mutate (from (a)) (to (u)) (rate 0.321388))
(mutate (from (c)) (to (a)) (rate 0.358354))
(mutate (from (c)) (to (g)) (rate 0.263416))
(mutate (from (c)) (to (u)) (rate 0.728797))
(mutate (from (g)) (to (a)) (rate 0.442384))
(mutate (from (g)) (to (c)) (rate 0.217357))
(mutate (from (g)) (to (u)) (rate 0.32297))
(mutate (from (u)) (to (a)) (rate 0.390987))
(mutate (from (u)) (to (c)) (rate 0.534862))
(mutate (from (u)) (to (g)) (rate 0.287254))
) ;; end chain NUC
) ;; end grammar pfold
;; Alphabet RNA
;;
(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