Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 261fafeae4
Fetching contributors…

Cannot retrieve contributors at this time

251 lines (226 sloc) 8.708 kb
% !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}
Jump to Line
Something went wrong with that request. Please try again.