# Underlining a coloured DNA sequence

In the posts to the question of Timtico (here) several ways have been proposed to colour the As,Ts,Cs and Gs differently within a DNA sequence. What I want is also to be able to underline some nucleotides to emphasise them, e.g.: \dna{ATACAG$\underbar{AG}$CATA} but I didn't manage to do so. Does anyone have suggestions to this problem? Thank you very much!

-
Do you want to underline a specific subsequence like AG? Not everyone here is a biologist. Please describe your question without many professional terms, and provide some examples/pictures to illustrate the question. –  Leo Liu May 22 '11 at 11:51
You might want to have a look at the texshade package (Typesetting nucleotide and peptide alignments) and maybe also textopo (for shaded membrane protein topology plots) by the same author. –  clemens Mar 22 '12 at 17:52

I added a delimiter to the code from my answer at typesetting different characters with different colors in a DNA sequence

\documentclass{article}
\usepackage{listings,xcolor}
\lstdefinestyle{dna}{%
literate={A}{\textcolor{green}{A}}{1}
{B}{\textcolor{blue}{B}}{1}
{C}{\textcolor{red}{C}}{1}
{a}{\textcolor{green}{A}}{1}
{b}{\textcolor{blue}{B}}{1}
{c}{\textcolor{red}{C}}{1},
basicstyle=\ttfamily,
moredelim=[is][\underline]{_}{_}
}
\newcommand{\DNA}[1]{%
\lstinline[style=dna]{#1}%
}
\begin{document}

@Ros: I don’t believe that there is a way to do it with listings. Maybe the manual can give you more information. ps. Note that there’s no comma , between the literate definitions. –  Tobi May 22 '11 at 17:48