program ckhelix(makelogop, ckhelixp,output); (* ckhelix: check that the helix location is where one wants Dr. Thomas D. Schneider National Institutes of Health National Cancer Institute Center for Cancer Research Nanobiology Program Molecular Information Theory Group Frederick, Maryland 21702-1201 toms@ncifcrf.gov permanent email: toms@alum.mit.edu (use only if first address fails) http://www.ccrnp.ncifcrf.gov/~toms/ *) label 1; (* end of program *) const (* begin module version *) version = 1.03; (* of ckhelix.p 2004 Sep 12 2004 Sep 12, 1.03: upgrade for GPC 2004 Sep 9, 1.02: upgrade for GPC 1992 Apr 28, 1.01: functional origin 1987 sep 21 *) (* end module version *) (* begin module describe.ckhelix *) (* name ckhelix: check that the helix location is where one wants synopsis ckhelix(makelogop: in, ckhelixp: in, output: out); files makelogop: the parameter file of the makelogo program ckhelixp: wave location: the point in bases on THIS logo which is to align with the other logos. NOTE: this is NOT necessarily the high or low point of the wave as given by the wave parameter file of the makelogo program, hence it is not read from that file. zero: location of the desired center in cm on the page output: messages to the user description The program is used to determine the position to place a sequence logo so that a particular point of the cosine wave (in bases of the nucleic acid coordinate system) is exactly at a given point on the page in cm. This allows one to adjust the location of the logos so that they can overlap. examples documentation see also author Thomas Dana Schneider bugs technical notes *) (* end module describe.ckhelix *) var makelogop, wave, ckhelixp: text; (* begin module halt *) procedure halt; (* stop the program. the procedure performs a goto to the end of the program. you must have a label: label 1; declared, and also the end of the program must have this label: 1: end. examples are in the module libraries. this is the only goto in the delila system. *) begin writeln(output,' program halt.'); goto 1 end; (* end module halt version = 7.67; {of delmod.p 2004 Sep 8} *) (* begin module ckhelix.themain *) procedure themain(var makelogop, ckhelixp: text); (* the main procedure of the program *) var (* variables from makelogop *) fromrange,torange: integer; barlocation: integer; xcorner, ycorner: real; rotation: integer; charwidth: real; (* variables from ckhelixp *) wavelocation: real; desiredcenter: real; actualcenter: real; (* where the current makelogop parameters really will put the wave *) correction: real; (* the amount to change the x or y corner *) thecorner: char; (* x or y - the corner from which the wave is propagated *) {unused variable wavelength: real; (* bases per turn of the DNA helix *) } begin writeln(output,'ckhelix ',version:4:2); reset(makelogop); readln(makelogop,fromrange,torange); readln(makelogop,barlocation); readln(makelogop,xcorner,ycorner); readln(makelogop,rotation); readln(makelogop,charwidth); reset(ckhelixp); readln(ckhelixp,wavelocation); readln(ckhelixp,desiredcenter); if (rotation <> 0) and (rotation <> -90) then begin writeln(output,'WARNING: rotation must be 0 or -90 for sensible results!'); end; if rotation = -90 then thecorner := 'y' else thecorner := 'x'; if thecorner = 'x' then actualcenter := xcorner - (wavelocation - fromrange)*charwidth else actualcenter := ycorner - (wavelocation - fromrange)*charwidth; writeln(output, ' |wave | | | | | | NEW'); writeln(output, ' ',thecorner, 'corner |location|fromrange|charwidth| center | rotation| change | CORNER'); {123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789} if thecorner = 'x' then write(output,' ',xcorner:7:4,' |') else write(output,' ',ycorner:7:4,' |'); write(output,' ',wavelocation:7:4,' |'); write(output,' ',fromrange:7,' |'); write(output,' ',charwidth:7:4,' |'); write(output, ' ',actualcenter:7:4,' |'); write(output, ' ',rotation:7,' |'); correction := desiredcenter-actualcenter; if correction <> 0.0 then begin write(output, ' ',correction:7:4,' |'); write(output, ' ',(ycorner+correction):7:4,' |'); end else write(output,' (none)'); writeln(output); end; (* end module ckhelix.themain *) begin themain(makelogop, ckhelixp); 1: end.