/
RNAPyro-DP.tex
250 lines (226 loc) · 8.5 KB
/
RNAPyro-DP.tex
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
% !TEX TS-program = pdflatex
% !TEX encoding = UTF-8 Unicode
% This is a simple template for a LaTeX document using the "article" class.
% See "book", "report", "letter" for other types of document.
\documentclass[11pt]{article} % use larger type; default would be 10pt
\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)
%%% Examples of Article customizations
% These packages are optional, depending whether you want the features they provide.
% See the LaTeX Companion or other references for full information.
%%% PAGE DIMENSIONS
\usepackage{geometry} % to change the page dimensions
\usepackage{relsize}
\geometry{a4paper} % or letterpaper (US) or a5paper or....
% \geometry{margin=2in} % for example, change the margins to 2 inches all round
% \geometry{landscape} % set up the page for landscape
% read geometry.pdf for detailed page layout information
\usepackage{graphicx} % support the \includegraphics command and options
% \usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
%%% PACKAGES
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{booktabs} % for much better looking tables
\usepackage{array} % for better arrays (eg matrices) in maths
\usepackage{paralist} % very flexible & customisable lists (eg. enumerate/itemize, etc.)
\usepackage{verbatim} % adds environment for commenting out blocks of text & for better verbatim
\usepackage{subfig} % make it possible to include more than one captioned figure/table in a single float
% These packages are all incorporated in the memoir class to one degree or another...
%%% HEADERS & FOOTERS
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
\pagestyle{fancy} % options: empty , plain , fancy
\renewcommand{\headrulewidth}{0pt} % customise the layout...
\lhead{}\chead{}\rhead{}
\lfoot{}\cfoot{\thepage}\rfoot{}
%%% SECTION TITLE APPEARANCE
\usepackage{sectsty}
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
% (This matches ConTeXt defaults)
%%% ToC (table of contents) APPEARANCE
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!
%%% END Article customizations
%%% The "real" document content comes below...
\title{RNAPyro: Stacking version}
%\author{Yann Ponty}
\begin{document}
\maketitle
\newcommand{\Z}[3]{\mathcal{Z}_{\substack{(#1)\\ [#3]}}^{#2}}
\newcommand{\Y}[3]{\mathcal{Y}_{\substack{(#1)\\ [#3]}}^{#2}}
\newcommand{\B}{\mathcal{B}}
\newcommand{\Kron}{\delta}
\newcommand{\ub}{\bullet}
%Forward computation:
%\begin{equation}
% \Z{i,j}{m}{\alpha,\beta} = \left\{
% \begin{array}{ll}
% \displaystyle
% \sum_{\substack{a'\in \B,\\ \Kron_{a',a}\le m}}
% \Z{i+1,j}{m-\Kron_{a',a}}{a',\beta} & \text{If }S_{[i]}=\varnothing\text{ and }s_{[i]}=a\\
% \displaystyle
% \sum_{\substack{a',b'\in \B^2,\\ \Kron_{a'b',ab}\le m}}
% \sum_{m'=0}^{m-\Kron_{a'b',ab}} \underset{\text{If }s[i-1]=j+1}{\left(e^{\frac{-E_{\alpha \beta \to a' b'}}{RT}}\times\right)} \Z{i+1,k-1}{m-m'-\Kron_{a'b',ab}}{a',b'}\underset{\text{If }s[i-1]\neq j+1}{\left(\times\Z{k+1,j}{m'}{b',\beta}\right)} & \text{If }S_{[i]}=k, s_{[i]}=a\text{ and }s_{[k]}=b.
% \end{array}
%\right.
%\end{equation}
%
%Backward computation:
%\begin{equation}
% \Y{i,j}{m}{\alpha,\beta} = \left\{
% \begin{array}{ll}
% \displaystyle
% \sum_{\substack{a'\in \B,\\ \Kron_{a',a}\le m}}
% \Y{i-1,j}{m-\Kron_{a',a}}{a',\beta} & \text{If }S_{[i]}=\varnothing\text{ and }s_{[i-1]}=a\\
% \displaystyle
% \sum_{\substack{a',b'\in \B^2,\\ \Kron_{a'b',ab}\le m}}
% \sum_{m'=0}^{m-\Kron_{a'b',ab}}
% e^{\frac{-E_{\alpha \beta \to a' b'}}{RT}}
% \times \Y{i-1,k+1}{m-m'-\Kron_{a'b',ab}}{a',b'}
% \times\Z{j,k-1}{m'}{\beta,b'}
% & \text{If }S_{[i]}=k, s_{[i]}=a\text{ and }s_{[k]}=b.
% \end{array}
%\right.
%\end{equation}
\section{Implemented}
Given:
\begin{itemize}
\item an RNA sequence $s$ of length $n$
\item $s[i]:=$ nucleotide at position $i$ in $s$
\item $\displaystyle
S[i]:=\left\{
\begin{array}{rl}
-1 & \text{If position }i \text{ unpaired}\\
k & \text{If position }i \text{ paired with position }k
\end{array}\right.
$\\
S[-1] = -1, special value allowing to compute $S[i-1]$ when $i\equiv 0$
\item $B:=\{A, U, G, C\}$
\item $ \Kron_{a,a'}:=\left\{
\begin{array}{ll}
1 &\text{If }a \equiv a'\\
0 &\text{Else}
\end{array}\right.$
\item $\Z{i,j}{m}{\alpha,\beta}:=$ Partition function of the subsequence of $s$ from nucleotides
$i$ to $j$ with $m$ mutations when nucleotides at positions $i-1=\alpha$ and $j+1=\beta$
\item $\Y{i,j}{m}{\alpha,\beta}:=$ Partition function of $s$ excluding subsequence from $i+1$ to
$j-1$ with $m$ mutations when nucleotides at positions $i+1=\alpha$ and $j-1=\beta$
\item Some function $ES_{ab \to a'b'}$ in function of turner starking energy, isostericity and
some $\alpha$. If we choose $\alpha\times\text{StackEnergy} + (1-\alpha)\text{SumIsostericity}$
we have the problem that on any invalid base pair (e.g $GG$) the infinite energy given to the
stacking will remove all information of the isostericity.
\item $EI_{ab,a'b'}$ which take into account the isostericity of base pairs not stacked $ab$ when
change to $a'b'$.
\end{itemize}
\subsection{Forward}
Initial conditions:
$$
\forall i \in (0,\cdots,n-1):\, \Z{i+1,i}{m}{\alpha,\beta}=\left\{
\begin{array}{ll}
1 &\text{If } m = 0\\
0 &\text{Else }
\end{array}\right.
$$
Recursion:
$$
\Z{i,j}{m}{\alpha,\beta}:=\left\{
\begin{array}{ll}
\displaystyle
\sum_{\substack{a'\in \B,\\ \Kron_{a',s[i]}\le m}}
\Z{i+1,j}{m-\Kron_{a',s[i]}}{a',\beta} & \text{If }S{[i]}=-1\\
\displaystyle
\sum_{\substack{a',b'\in \B^2,\\ \Kron_{a'b',s[i]s[j]}\le m}}
e^{\frac{-ES_{\alpha \beta \to a' b'}}{RT}}
\Z{i+1,j-1}{m-\Kron_{a'b',s[i]s[j]}}{a',b'}&
\text{Elif }S{[i]}=j \land S{[i-1]}=j+1\\
\displaystyle
\sum_{\substack{a',b'\in \B^2,\\ \Kron_{a'b',s[i]s[k]}\le m}}
\sum_{m'=0}^{m-\Kron_{a'b',s[i]s[k]}}
e^{\frac{-EI_{s[i]s[k],a'b'}}{RT}}
\Z{i+1,k-1}{m-\Kron_{a'b',s[i]s[k]}-m'}{a',b'}
\Z{k+1,j}{m'}{b',\beta} & \text{Elif }S[i]=k \land i < k \leq j\\
0 &\text{Else}
\end{array}\right.
$$
\subsection{Backward}
Initial conditions:
$$
\Y{-1,j}{m}{X,X}:=
\displaystyle
\Z{j,n-1}{m}{X,X}
$$
Recursion:
$$
\Y{i,j}{m}{\alpha,\beta} = \left\{
\begin{array}{ll}
\displaystyle
\sum_{\substack{a'\in \B,\\ \Kron_{a',s[i]}\le m}}
\Y{i-1,j}{m- \Kron_{a',s[i]}}{a',\beta} &
\text{Elif }S[i]=-1 \\
\displaystyle
\sum_{\substack{a'b'\in \B^2,\\ \Kron_{a'b',s[i]s[j]}\le m}}
e^{\frac{-ES_{ a' b' \to \alpha \beta }}{RT}}
\Y{i-1,j+1}{m- \Kron_{a'b',s[i]s[j]}}{a',b'} &
\text{Elif }S{[i]}=j \land S{[i+1]}=j-1\\
\displaystyle
\sum_{\substack{a'b'\in \B^2,\\ \Kron_{a'b',s[i]s[k]}\le m}}
\sum_{m'=0}^{m-\Kron_{a'b',s[i]s[k]}}
e^{\frac{-EI_{s[i]s[k],a'b'}}{RT}}
\Y{i-1,k+1}{m- \Kron_{a'b',s[i]s[k]} - m'}{a',b'}
\Z{j,k-1}{m'}{\beta,b'} &
\text{Elif }S{[i]}=k \geq j\\
\displaystyle
\sum_{\substack{a'b'\in \B^2,\\ \Kron_{a'b',s[k]s[i]}\le m}}
\sum_{m'=0}^{m-\Kron_{a'b',s[k]s[i]}}
e^{\frac{-EI_{s[i]s[k],a'b'}}{RT}}
\Y{k-1,j}{m- \Kron_{a'b',s[k]s[i]} - m'}{a',\beta}
\Z{k+1,i-1}{m'}{a',b'} &
\text{Elif }-1 < S{[i]}=k < i\\
0 & \text{Else}
\end{array}\right.
$$
\subsection*{}
We must have (if $S[k] = -1)$:
$$
\Z{0,n-1}{m}{X,X} \equiv
\sum_{\substack{a\in \B,\\ \Kron_{a,s[k]}\le m}}
\Y{k-1,k+1}{m-\Kron_{a,s[k]}}{a,a};\qquad
\forall k \in \{0,\cdots,n-1\}
$$
\subsection{Probability of a position being a given nucleotide}
Given $x\in B$,
$$
\mathbb{P}(s[i] = x\mid s, S,m):=\left\{
\begin{array}{ll}
\displaystyle
\frac{
\Y{i-1,i+1}{m-\Kron_{x,s[k]}}{x,x}
}{
\Z{0,n-1}{m}{X,X}
}
&\text{If }S[i] = -1\\
\displaystyle
\frac{
\displaystyle
\sum_{\substack{b\in Bases\\\Kron_{bx,s[k]s[i]\leq m}}}
\sum_{m'=0}^{m-\Kron_{bx,s[k]s[i]}}
\Y{k-1,i+1}{m-\Kron_{bx,s[k]s[i]-m'}}{b,x}
\Z{k+1,i-1}{m'}{b,x}
}{
\Z{0,n-1}{m}{X,X}
}
&\text{If }S[i]=k<i\\
\displaystyle
\frac{
\displaystyle
\sum_{\substack{b\in Bases\\\Kron_{xb,s[i]s[k]\leq m}}}
\sum_{m'=0}^{m-\Kron_{xb,s[i]s[k]}}
\Y{i-1,k+1}{m-\Kron_{xb,s[i]s[k]-m'}}{x,b}
\Z{i+1,k-1}{m'}{x,b}
}{
\Z{0,n-1}{m}{X,X}
}
&\text{If }S[i]=k>i
\end{array}\right.
$$
\end{document}