[sci.med] PostScript Agarose Gel electrophoresis simulation

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

	Although my sequencing gel simulation was a cute but useless program
(yet for some reason, someone actually needed it), the following PostScript
program is of considerable utility.
	The header allows you to simulate migration patterns on an agarose
gel.  I, and others, find this very useful when doing restriction digests,
as it is easier to correlate two visual pictures (actual data and
simulated migration) than a picture and a set of numbers.
	The pattern used is really an ideal migration.  I have yet to
simulate the actual artifacts that electrophoresis can give.

	The text of the program is an example, really. I used my four
favorite markers:  lambda BstEII, lambda HindIII, Charon27 BglII, and
Charon27 KpnI. 
	Using the same notation, feel free either to replace lanes with
your favorite markers, or add additional lanes.

--------- cut here, the first two characters of the file must be %! -----
%!PS
%
%% resgel.ps -- Craig Werner, Medical Scientist Training Program
%		Albert Einstein College of Medicine
% This program, though its form be lacking, simulates the migration of
% DMA fragments through an agarose gel, and draws a passable representation
% of the gel on PostScript printers.
%
%% Prologue
/inch {72 mul} def
/cm {inch 2.54 div} def

%% band
% called as: 		size [bp] 	band
% Uses L Lane Y dL 
/band
  {
   /_size exch def
   /migration 4.5 _size log sub inch 3 mul def
   L Lane 1 sub dL mul add ds add Y migration sub moveto
   dL ds sub 0 rlineto stroke
  } def

%% Lanelabel
% called as   (Text) Lanelabel
% uses:  /Lane to determine which lane to label
/Lanelabel
{
   L Lane 1 sub dL mul add dL 2 div add Y moveto
   dup stringwidth pop
   2 div neg 0 rmoveto
   show
} def

%% Variables:

0.5 setlinewidth

/L 1 inch def
/dL 0.5 inch def
/ds 2 def
/Y 9 inch def
/PS 8 def
/Times-Roman findfont PS scalefont setfont

%% End Prologue
% ----- data begins here: lambda HindIII & BstEII, Charon27 BglII & KpnI  ------

%lambda HindIII
/Lane 1 def
(HindIII) lanelabel
23130 band
9416 band
6557 band
4361 band
2322 band
2027 band
564 band
% 125 band

% lambda BstEII
/Lane 2 def
(BstEII) lanelabel
8454 band
7242 band
6369 band
5686 band
4822 band
4324 band
3675 band
2323 band
1929 band
1371 band
1264 band
702 band
% 224 band
% 117 band

% Charon 27 BglII
/Lane 3 def
(27BglII) lanelabel
428 band
22302 band
6114 band
882 band
3476 band
1875 band
6652 band

% Charon 27 KpnI
/Lane 4 def
(27KpnI) lanelabel
17290 band
1522 band
13713 band
1657 band
7601 band

% ---------------  above four lanes were examples -----------------
%% Epilogue
showpage


-- 
---------
	Craig Werner 	(Lognames: werner, craigw)
       "This is no social crisis, just another tricky day for you."

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

	I don't quite know how it happened, because the copy I retained
still works, but in the posted copy of the above program, there was a typo
that causes a fatal error (are there any other kind in PostScript?) when
run.  It is a simple thing to fix.

 	Change: 		Linelabel
	to:			linelabel

	(i.e., the capitalization was wrongfully added during the posting)

	I'm currently working on a better version that labels the bands,
and I eventually hope to add the known artifacts to simulate real gels more
effectively.
-- 
---------
	Craig Werner 	(Lognames: werner, craigw)
       "This is no social crisis, just another tricky day for you."