Class Bio::Graphics::Track
In: lib/bio/graphics/track.rb
Parent: Object

The Bio::Graphics::Track class describes the container for features of the same type. See Bio::Graphics documentation for explanation of interplay between different classes.


add_feature   draw   new  


colour  [RW] 
features  [RW] 
glyph  [RW] 
grid  [RW] 
height  [RW] 
name  [RW] 
number_of_feature_rows  [RW] 
panel  [RW] 
show_label  [RW] 
vertical_offset  [RW] 

Public Class methods

!!Not to be used directly. Use Bio::Graphics::Panel.add_track instead!! A track can not exist except within the confines of a Bio::Graphics::Panel object.


  • panel (required) :: Bio::Graphics::Panel object that this track belongs to
  • name (required) :: Name of the track to be displayed (e.g. ‘genes’)
  • _:label_ :: Boolean: should the label for each feature be drawn or not Default = true
  • _:glyph_ :: Glyph to use for drawing the features. Options are: :generic, :directed_generic, :box, directed_box, :spliced, :directed_spliced, :dot, :triangle, :line and :line_with_handles. Default = :generic
  • colour :: Colour to be used to draw the features within the track (in RGB) Default = [0,0,1] (i.e. blue)
Returns:Bio::Graphics::Track object

Public Instance methods

Takes a Bio::Feature and adds it as a Bio::Graphics::Feature to this track. A track contains features of the same type, e.g. (for sequence annotation:) genes, polymorphisms, ESTs, etc.


For spliced features:


Or on the complement strand:


See the documentation in Bio::Locations for a full description of how locations can be defined.

Features are only added if they are at least partly in the displayed region. If a feature is completely outside of the region, it‘s not added. If it should be only partly visible, it is added completely.


  • feature object (required) :: A Bio::Feature object
  • label :: Label for the feature. Default = ‘anonymous‘
  • link :: URL to link to for this glyph. Default = nil
  • glyph :: Glyph for the feature. Default = glyph of the track
  • colour :: Colour for the feature. Default = colour of the track
Returns:Bio::Graphics::Feature object that was created or nil

Adds the track to a cairo drawing. This method should not be used directly by the user, but is called by Bio::Graphics::Panel.draw


  • panel__drawing (required) :: the panel cairo object
Returns:FIXME: I don‘t know