Stylesheets for Dalliance

Dalliance aims to implement the full DAS Stylesheet language, including all glyph types.

There are also a number of extensions:

Label matching (since 0.7)
Features can be filtered by label if you add a label attribute to the TYPE element.
Regexp matching (since 0.7)
The id, method, and label fields of the TYPE element can take regular expression arguments as well as exact matches, e.g.:
<TYPE id="repeat" label="L1.+">
  <GLYPH>
    <BOX>
      <HEIGHT>10</HEIGHT>
      <BGCOLOR>red</BGCOLOR>
    </BOX>
  </GLYPH>
</TYPE>
<TYPE id="repeat">
  <GLYPH>
    <BOX>
      <HEIGHT>10</HEIGHT>
      <BGCOLOR>orange</BGCOLOR>
    </BOX>
  </GLYPH>
</TYPE>
Orientation matching (since 0.11)
Features can be filtered by orientation, e.g.:
<TYPE id="foo" orientation="+">
  <GLYPH>
    <BOX>
      <BGCOLOR>red</BGCOLOR>
    </BOX>
  </GLYPH>
</TYPE>
<TYPE id="foo" orientation="-">
  <GLYPH>
    <BOX>
      <BGCOLOR>blue</BGCOLOR>
    </BOX>
  </GLYPH>
</TYPE>
POINTS glyph (since 0.9)
The POINTS glyph type can be used to draw scatter plots. It will probably be deprecated in Dalliance 0.10 in favour of the more general SCATTER attribute, and may be removed in the future.
SIZE (since 0.10)
This can be applied to small glyphs to specify the size. If not specified, size is equal to the height. Mostly useful in conjuction with the SCATTER attribute.
RSIZE (since 0.12)
This property can be applied to small glyphs to specify their size, as an alternative to SIZE. The value should be between 0 and 1, and controls glyph size as a fraction of the total height of the track.
SCATTER (since 0.10)
This attribute can be applied to all the "small" glyph types (DOT, EX, STAR, etc.) to convert them into points on a scatter plot. When this attribute is set to "yes", the y position of the glyph is adjusted according to the feature's score, and the MIN, MAX and HEIGHT attributes are interpreted as for line-plots and histograms.
<TYPE id='default'>
  <GLYPH>
    <STAR>
      <SCATTER>yes</SCATTER>
      <POINTS>8</POINTS>
      <SIZE>6</SIZE>
      <FGCOLOR>blue</FGCOLOR>
      <MIN>0</MIN>
      <MAX>100</MAX>
      <HEIGHT>50</HEIGHT>
    </STAR>
  </GLYPH>
</TYPE>
SQUARE glyph (since 0.10)
Rendered the same as BOX but the width is independent of the size of the underlying feature. Usable in scatter plots.
STAR glyph (since 0.10)
A star. Number of points can be configured using the POINTS attribute (default is 5). Usable in scatter plots.
PLIMSOLL glyph (since 0.11)
A circle with a vertical line through the mid-point -- good for representing point features.
BGITEM option (since 0.11)
Enable per-feature setting of a feature's primary colour (works with BED/bigBed files with colours stored in the "itemRgb" field).

JSON-encoded stylesheets (since 0.8)

As an alternative to writing XML stylesheets, it is possible to write stylesheets in a JSON-encoded notation, directly in your Dalliance configuration file. The glyphs, attribute, and filters available in JSON-encoded stylesheets are exactly the same as in XML stylesheets. It currently isn't possible to load JSON-encoded stylesheets from external files, although this may change in the future. A JSON-encoded stylesheet is an array of Javascript objects with the following properties:
type
Equivalent to the TYPE ID in an XML stylesheet. Required, but may be set to default
method (optional)
orientation (optional)
zoom (optional)
May be low, medium, or high.
style (required)
A Javascript object. This must have a property named glyph, which is the glyph type to use. It may have other properties (e.g. BGCOLOR, BUMP, etc.) which are interpretted the same as in an XML stylesheet.
[
   {type: 'default', 
    style: {
       glyph: 'PLIMSOLL', 
       HEIGHT: '12', 
       STROKECOLOR: 'black',
       FGCOLOR: 'red'}},
   {type: 'nasty',
    style: {
        glyph: 'CROSS',
        FGCOLOR: 'green'}}
]