view test-data/structure1.ps @ 0:c05c83b3ef0f draft

planemo upload for repository https://github.com/bgruening/galaxytools/tools/GraphClust/AlignCluster commit 4406735e44aba20859c252be39f4e99df28c7a92
author rnateam
date Sat, 27 Oct 2018 13:21:39 -0400
parents
children 953353eacec2
line wrap: on
line source

%!PS-Adobe-3.0 EPSF-3.0
%%Creator: ViennaRNA-2.2.10
%%CreationDate: Sat Oct 27 14:38:56 2018
%%Title: RNA Secondary Structure Plot
%%BoundingBox: 66 210 518 662
%%DocumentFonts: Helvetica
%%Pages: 1
%%EndComments

%Options: --noLP 
% to switch off outline pairs of sequence comment or
% delete the appropriate line near the end of the file

%%BeginProlog
/RNAplot 100 dict def
RNAplot begin
/fsize  14 def
/outlinecolor {0.2 setgray} bind def
/paircolor    {0.2 setgray} bind def
/seqcolor     {0   setgray} bind def
/cshow  { dup stringwidth pop -2 div fsize -3 div rmoveto show} bind def
/min { 2 copy gt { exch } if pop } bind def
/max { 2 copy lt { exch } if pop } bind def
/arccoords { % i j arccoords
  % puts optimal x1 y1 x2 y2 coordinates used in bezier curves from i to j
  % onto the stack
  dup 3 -1 roll dup 4 -1 roll lt dup dup 5 2 roll {exch} if
  dup 3 -1 roll dup 3 -1 roll exch sub 1 sub dup
  4 -2 roll 5 -1 roll {exch} if 4 2 roll
  sequence length dup 2 div exch 3 1 roll lt 
  {exch 5 -1 roll pop 4 -2 roll exch 4 2 roll}
  { 4 2 roll 5 -1 roll dup 6 1 roll {exch} if
    4 -2 roll exch pop dup 3 -1 roll dup 4 1 roll
    exch add 4 -1 roll dup 5 1 roll sub 1 sub
    5 -1 roll not {4 -2 roll exch 4 2 roll} if
  }ifelse
   % compute the scalingfactor and prepare (1-sf) and sf*r
  2 mul exch cpr 3 1 roll div dup
  3 -1 roll mul exch 1 exch sub exch
   % compute the coordinates
  3 -1 roll 1 sub coor exch get aload pop % get coord for i
  4 -1 roll dup 5 1 roll mul 3 -1 roll dup 4 1 roll add exch % calculate y1
  4 -1 roll dup 5 1 roll mul 3 -1 roll dup 4 1 roll add exch % calculate x1
  5 -1 roll 1 sub coor exch get aload pop % get coord for j
  % duplicate j coord
  dup 3 -1 roll dup 4 1 roll exch 8 2 roll
  6 -1 roll dup 7 1 roll mul 5 -1 roll dup 6 1 roll add exch % calculate y2
  6 -1 roll mul 5 -1 roll add exch % calculate x2
  6 -2 roll % reorder
} bind def
/drawoutline {
  gsave outlinecolor newpath
  coor 0 get aload pop 0.8 0 360 arc % draw 5' circle of 1st sequence
  currentdict /cutpoint known        % check if cutpoint is defined
  {coor 0 cutpoint getinterval
   {aload pop lineto} forall         % draw outline of 1st sequence
   coor cutpoint 1 add get aload pop
   2 copy moveto 0.8 0 360 arc       % draw 5' circle of 2nd sequence
   coor cutpoint 1 add coor length cutpoint 1 add sub getinterval
   {aload pop lineto} forall}        % draw outline of 2nd sequence
  {coor {aload pop lineto} forall}   % draw outline as a whole
  ifelse
  stroke grestore
} bind def
/drawpairs {
  paircolor
  0.7 setlinewidth
  [9 3.01] 9 setdash
  newpath
  pairs {aload pop
      currentdict (cpr) known
      { exch dup
        coor  exch 1 sub get aload pop moveto
        exch arccoords curveto
      }
      { coor exch 1 sub get aload pop moveto
        coor exch 1 sub get aload pop lineto
      }ifelse
  } forall
  stroke
} bind def
% draw bases
/drawbases {
  [] 0 setdash
  seqcolor
  0
  coor {
    aload pop moveto
    dup sequence exch 1 getinterval cshow
    1 add
  } forall
  pop
} bind def

/init {
  /Helvetica findfont fsize scalefont setfont
  1 setlinejoin
  1 setlinecap
  0.8 setlinewidth
  72 216 translate
  % find the coordinate range
  /xmax -1000 def /xmin 10000 def
  /ymax -1000 def /ymin 10000 def
  coor {
      aload pop
      dup ymin lt {dup /ymin exch def} if
      dup ymax gt {/ymax exch def} {pop} ifelse
      dup xmin lt {dup /xmin exch def} if
      dup xmax gt {/xmax exch def} {pop} ifelse
  } forall
  /size {xmax xmin sub ymax ymin sub max} bind def
  72 6 mul size div dup scale
  size xmin sub xmax sub 2 div size ymin sub ymax sub 2 div
  translate
} bind def
end
RNAplot begin
% extra definitions for standard anotations
/min { 2 copy gt { exch } if pop } bind def
/BLACK { 0 0 0 } def
/RED   { 1 0 0 } def
/GREEN { 0 1 0 } def
/BLUE  { 0 0 1 } def
/WHITE { 1 1 1 } def
/LabelFont { % font size LabelFont
  exch findfont exch fsize mul scalefont setfont
} bind def
/Label { % i dx dy (text) Label
  % write text at base i plus offset dx, dy
  4 3 roll 1 sub coor exch get aload pop moveto
  3 1 roll fsize mul exch fsize mul exch rmoveto
  show
} bind def
/cmark { % i cmark   draw circle around base i
  newpath 1 sub coor exch get aload pop
  fsize 2 div 0 360 arc stroke
} bind def
/gmark { % i j c gmark
  % draw basepair i,j with c counter examples in gray
  gsave
  3 min [0 0.33 0.66 0.9] exch get setgray
  1 sub dup coor exch get aload pop moveto
  sequence exch 1 getinterval cshow
  1 sub dup coor exch get aload pop moveto
  sequence exch 1 getinterval cshow
  grestore
} bind def
/segmark { % f i j lw r g b segmark
  % mark segment [i,j] with outline width lw and color rgb
  % use omark and Fomark instead
  gsave
  setrgbcolor setlinewidth
  newpath
  1 sub exch 1 sub dup
  coor exch get aload pop moveto
  currentdict (cpr) known
  {
    3 -1 roll dup 4 1 roll dup
    {
      3 1 roll dup 3 -1 roll dup
      4 1 roll exch 5 2 roll exch
    }
    {
      3 1 roll exch
    } ifelse
    1 exch { coor exch get aload pop lineto } for
    {
      dup 3 1 roll 1 add exch 1 add arccoords pop pop
      4 2 roll 5 -1 roll coor exch get aload pop curveto
    } if
  }
  {
    exch 1 exch {
      coor exch get aload pop lineto
    } for
  } ifelse
  { closepath fill } if  stroke
  grestore
} bind def
/omark { % i j lw r g b omark
  % stroke segment [i..j] with linewidth lw, color rgb
  false 7 1 roll segmark
} bind def
/Fomark { % i j r g b Fomark
  % fill segment [i..j] with color rgb
  % should precede drawbases
  1 4 1 roll true 7 1 roll segmark
} bind def
/BFmark{ % i j k l r g b BFmark
  % fill block between pairs (i,j) and (k,l) with color rgb
  % should precede drawbases
  gsave
  setrgbcolor
  newpath
  currentdict (cpr) known
  {
    dup 1 sub coor exch get aload pop moveto % move to l
    dup 1 sub 4 -1 roll dup 5 1 roll 1 sub 1 exch
    { coor exch get aload pop lineto } for % lines from l to j
    3 -1 roll 4 -1 roll dup 5 1 roll arccoords curveto % curve from j to i
    exch dup 4 -1 roll 1 sub exch 1 sub 1 exch
    { coor exch get aload pop lineto } for % lines from i to k
    exch arccoords curveto% curve from k to l
  }
  {  exch 4 3 roll exch 1 sub exch 1 sub dup
     coor exch get aload pop moveto
     exch 1 exch { coor exch get aload pop lineto } for
     exch 1 sub exch 1 sub dup
     coor exch get aload pop lineto
     exch 1 exch { coor exch get aload pop lineto } for
  } ifelse
    closepath fill stroke
   grestore
} bind def
/hsb {
  dup 0.3 mul 1 exch sub sethsbcolor
} bind def
/colorpair { % i j hue sat colorpair
  % draw basepair i,j in color
  % 1 index 0.00 ne {
  gsave
  newpath
  hsb
  fsize setlinewidth
  currentdict (cpr) known
  {
    exch dup
    coor  exch 1 sub get aload pop moveto
    exch arccoords curveto
  }
  { 1 sub coor exch get aload pop moveto
    1 sub coor exch get aload pop lineto
  } ifelse
   stroke
   grestore
   % } if
} bind def
end

%%EndProlog
RNAplot begin
% data start here
/sequence (\
AUGAAUAUAGUUUAAA_UAGAACAUUAGAUUUUCAAACUAAUAGUAGAGGC\
) def
/coor [
[95.00124359 138.88397217]
[87.89935303 137.28974915]
[81.21456146 134.41014099]
[75.17730713 130.34443665]
[69.99568176 125.23274994]
[65.84830475 119.25129700]
[62.87813568 112.60626221]
[61.18754959 105.52667999]
[60.83482361 98.25659943]
[61.83211517 91.04661560]
[48.15361786 84.89042664]
[34.47511673 78.73423004]
[20.79662132 72.57804108]
[6.11008787 78.41596222]
[-8.36961174 72.08241272]
[-14.05193043 57.33497620]
[-7.56564760 42.92304993]
[7.24103928 37.39696503]
[21.58358574 44.03525925]
[26.95281219 58.89954376]
[40.63130951 65.05573273]
[54.30980682 71.21192932]
[67.98830414 77.36811829]
[94.10119629 61.24235916]
[123.82917786 68.86929321]
[135.05683899 58.92245483]
[146.28450012 48.97561264]
[157.51216125 39.02877426]
[168.73982239 29.08193398]
[168.13914490 13.45589161]
[177.76402283 1.13129318]
[193.06988525 -2.07256317]
[206.82977295 5.35708570]
[212.54667664 19.91218758]
[207.52125549 34.72026825]
[194.12637329 42.78940201]
[178.68666077 40.30959702]
[167.45899963 50.25643539]
[156.23133850 60.20327377]
[145.00367737 70.15011597]
[133.77601624 80.09695435]
[136.87315369 86.68378448]
[138.69926453 93.72961426]
[139.19142151 100.99159241]
[138.33265686 108.21938324]
[136.15257263 115.16385651]
[132.72630310 121.58563232]
[128.17196655 127.26335907]
[122.64655304 132.00131226]
[116.34051514 135.63619995]
[109.47121429 138.04269409]
] def
/pairs [
[10 23]
[11 22]
[12 21]
[13 20]
[25 41]
[26 40]
[27 39]
[28 38]
[29 37]
] def

init

% Start Annotations
10 23 0.16 1 colorpair
11 22 0.16 1 colorpair
12 21 0.16 1 colorpair
13 20 0.48 1 colorpair
25 41 0.32 1 colorpair
26 40 0.32 1 colorpair
27 39 0.32 1 colorpair
28 38 0.48 1 colorpair
29 37 0.32 1 colorpair

% End Annotations
% switch off outline pairs or bases by removing these lines
drawoutline
drawpairs
drawbases
% Start Annotations
23 cmark
11 cmark
22 cmark
12 cmark
21 cmark
13 cmark
20 cmark
25 cmark
41 cmark
26 cmark
40 cmark
27 cmark
39 cmark
28 cmark
38 cmark
29 cmark
37 cmark

% End Annotations
% show it
showpage
end
%%EOF