I need to modify how to draw DNA sequences.
There is a function \DNASequence which does the job.
It uses nodes of constant size. However, I need to put arbitrary text instead of only one letter in a cell. How to do it?
I tried to modify original code but I don't know how to get the actual width of a node.
\documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc} % Language = Spanish
\usepackage{color}
\usepackage{tikz}
\usetheme{Warsaw}
\usecolortheme{whale}
\usepackage{xstring}
\usetikzlibrary{calc, arrows}
\newcommand*{\NodeSize}{0.5cm}%
\newcommand*{\YShiftBetweenRows}{-1cm}% Subsequent rows are shited down so they don't overlap
\tikzset{DNA Style/.style={minimum size=0.5cm, draw=gray, line width=1pt}}{}
\newlength{\YShift}%
\newcounter{ColumnCounter}% Prefix for node labels
\setlength{\YShift}{0cm}%
\setcounter{ColumnCounter}{0}
\newcounter{angle}
\setcounter{angle}{0}
%
\begin{document}
\newcommand*{\DNASequence}[2][Mark]{%
% https://tex.stackexchange.com/questions/12091/tikz-foreach-loop-with-macro-defined-list
\def\Sequence{#2}
\foreach [count=\xi] \Label/\Color in \Sequence {%
\pgfmathsetmacro{\XShift}{\NodeSize*\xi}%
\IfStrEq{\Color}{}{\def\Color{white}}{}
\edef\NodeName{#1-\arabic{ColumnCounter}}
\node [DNA Style, fill=\Color, xshift=\XShift] (\NodeName) {\Label};
\stepcounter{ColumnCounter}
}
}%
\begin{frame}{bla}
\begin{tikzpicture}
\DNASequence{AAAA/cyan,, Big/orange,,,Small/blue,,G/red!25,,C/yellow};
\end{tikzpicture}
\end{frame}
\end{document}
EDIT: I need \DNASequence function which draws arbitrary text in the nodes.

\documentclass{...}and ending with\end{document}. – jub0bs May 06 '13 at 07:30