[comp.lang.postscript] DNA Gel Display

craigw@aecom.YU.EDU (Craig Werner) (04/08/88)

The following can be used to display DNA sequences on PostScript printers.
Or I should say, given a sequence, it displays what the Sequencing gel
would look like, minus artifacts.  It's cute, but of limited utility.
Most of the other comments are embedded below.
And, yes, I know my programming form is terrible.



---- cut below ------- Make sure the first line is %! ----
%!PS
% Gel display - a quaint but useless PostScript program
% Craig Werner, Dept. of Microbiology and Immunology
%    Medical Scientist Training Program, Albert Einstein College of Medicine.
%    March 1987
% The following program, given a DNA sequence, will print what the sequencing
% gel would look like (under ideal conditions).  Of course, most people would
% like to go in the opposite direction, hence its advertised utility.
% The format of the sequence should be at least one space between every base.
% Replace your favorite sequence with my favorite sequence, which is currently
% there as a place-filler.  
%
/inch {72 mul} def
0.5 setlinewidth

%% Lane
% Usage 1-4 Lane
% Uses L Y dL dY (alters Y)
/lane
  {
   1 sub /_lane exch def
   L _lane dL mul add Y moveto
   dL 0 rlineto stroke
   /Y Y dY add def
  } def

/A {1 lane} def		/a {A} def
/C {2 lane} def 	/c {C} def
/G {3 lane} def		/g {G} def
/T {4 lane} def		/t {T} def	/U {T} def	/u {T} def

/Y 2 inch def
/L 1 inch def
/dY 3 def
/dL 0.4 inch def

%% Sequence starts -- replace with desired DNA sequence
% pBmCW7 - Brugia malayi collagen fragment
% it looks like sequence but is really program code

G G T  T A T  C C G  G G C  T T G  C T A  G G A  C C A  C A A  
G G T  G A A  A G G G G A  T T A  C C A  G G A 
G T G  C C A  G G T  C C T  C A G  G G T C C C C C T 
G G A G A T G A T G G A A T G C C T G G T G C G C C A 
G G A A G A C C T G G A C C A C C G G G A C C A C C T 
G G A A A A G A C G G C A T T C C C G G T T T A C C A 
G G A C A G  A A G G G T  G A A  C C A  A C A 

%% Sequence Ends

/PS 10 def
/Times-Roman findfont PS scalefont setfont
/XX L dL 2 div add def
/Y Y 0.5 inch add

/lanelabel
{
   XX Y moveto
   show
   /XX XX dL add def
} def

(A) lanelabel
(C) lanelabel
(G) lanelabel
(T) lanelabel

showpage


%----------------------
-- 
	Craig Werner 	(..!philabs!aecom!werner)
       "This is no social crisis, just another tricky day for you."