From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/4728 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Prettyprinting DNA sequences Date: Fri, 25 May 2001 02:24:11 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20010525022411.009bf9d0@server-1> References: <20010524192354.A1610@ruhrau.de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035395370 28198 80.91.224.250 (23 Oct 2002 17:49:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:49:30 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: hannes@ruhrau.de In-Reply-To: <20010524192354.A1610@ruhrau.de> Xref: main.gmane.org gmane.comp.tex.context:4728 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:4728 At 07:23 PM 5/24/01 +0200, Johannes Huesing wrote: >Hi all, > >as it has become hip to fill publications with long strings of capital >letters from the set {A, C, G, T}, I would like to know how difficult >it is to have them prettyprinted, i.e. make A, C, G, T active >characters that are printed out in red (A), blue (G), yellow (C) and >green (T), respectively, and that are broken like regular words i.e. a >line can be broken after each letter. > >Do you think this would be feasible? well, fortunately this is quite simple to do, \def\dnasymbol#1#2% {\unskip {\localcolortrue\tttf#1#2}% local colors are much faster with many colors per page \hskip0pt plus 1pt minus 1pt % that way we can break and get no over/underfull lines \ignorespaces} \def\dnasequence #1#2#3#4 % space or line delimited {\dnasymbol\red #1% \dnasymbol\green #2% \dnasymbol\blue #3% \dnasymbol\yellow#4} \def\startdnasequence% watch out,\stopDNAsequence would fail now {\bgroup \defineactivecharacter A {\dnasymbol\red A}% \defineactivecharacter C {\dnasymbol\green C}% \defineactivecharacter G {\dnasymbol\blue G}% \defineactivecharacter T {\dnasymbol\yellow T}} \def\stopdnasequence% so we use lowercase names {\egroup} \setupcolors[state=start] \starttext \dnasequence ACGT \dnasequence ACGT \dnasequence ACGT \dnasequence ACGT \dnasequence ACGT \dnasequence ACGT \dnasequence ACGT \startdnasequence ACGT ACGT ACGT ACGT ACGT ACGT ACGT \stopdnasequence \stoptext As you can see, my genome is quite simple, but don't patent it, I'm sure that others can come up with alternatives; it also depends on the way you provide the input. Hans PS. Of course you can make a random generator [possible in context]. ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------