sequence-algorithms/figures/part1/motif_search_automaton_bis.tex

48 lines
1.5 KiB
TeX
Raw Permalink Normal View History

2024-03-15 09:16:50 +01:00
\documentclass[tikz]{standalone}
\usepackage{tikz}
\begin{document}
\usetikzlibrary{automata,positioning}
\iffalse
Let $M = $ CCATCAT be a motif.
$\Sigma = \{A,C,T\}$
\fi
\begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid, auto]
\node[state, initial] (q_0) {$q_{0}$};
\node[state,right=of q_0] (q_1) {$q_{1}$};
\node[state,right=of q_1] (q_2) {$q_{2}$};
\node[state,right=of q_2] (q_3) {$q_{3}$};
\node[state,right=of q_3] (q_4) {$q_{4}$};
\node[state,right=of q_4] (q_5) {$q_{5}$};
\node[state,right=of q_5] (q_6) {$q_{6}$};
\node[state,right=of q_6,accepting] (q_7) {$q_{7}$};
% M itself
\path[->] (q_0) edge node {C} (q_1)
(q_1) edge node {C} (q_2)
(q_2) edge node {A} (q_3)
(q_3) edge node {T} (q_4)
(q_4) edge node {C} (q_5)
(q_5) edge node {A} (q_6)
(q_6) edge node {T} (q_7)
;
\path[->] (q_0) edge [loop above] node {A,T} (q_0);
\path[->] (q_1) edge [bend right=40] node {A, T} (q_0);
\path[->] (q_2) edge [bend right=40] node {C} (q_1);
\path[->] (q_2) edge [bend right=40] node {T} (q_0);
\path[->] (q_3) edge [bend right=40] node {A} (q_0);
\path[->] (q_3) edge [bend right=40] node {C} (q_1);
\path[->] (q_4) edge [bend right=40] node {A, T} (q_0);
2024-03-15 09:34:02 +01:00
\path[->] (q_5) edge [bend left=40] node[above] {C} (q_2);
2024-03-15 09:16:50 +01:00
\path[->] (q_5) edge [bend left=40] node[above] {T} (q_0);
\path[->] (q_6) edge [bend left=40] node[above] {A} (q_0);
\path[->] (q_6) edge [bend right=40] node {C} (q_1);
\path[->] (q_7) edge [bend right=40] node {A, C, T} (q_0);
\end{tikzpicture}
\end{document}