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

The Bio::Graphics::Track object acts as a container for Bio::Graphics::MiniFeature objects. The Bio::Graphics::Track takes style information on instantiation. Style information is applied to each feature in the track by the track

Methods

add   get_rows   new   overlaps  

Attributes

args  [R] 
feature_height  [RW] 
feature_rows  [RW] 
features  [RW] 
glyph  [R] 
label  [R] 
max_y  [R] 
min_width  [R] 
name  [RW] 
name  [R] 
number_rows  [RW] 
scale  [R] 
track_height  [R] 

Public Class methods

Creates a new Bio::Graphics::Track

args

  • :glyph = one of Bio::Graphics::Glyphs#glyphs currently
 [:generic, :directed, :transcript, :scale, :label, :histogram, :circle, :down_triangle, :up_triangle, :span]
  • :stroke_color = the outline colour of the glyphs in the track (default = "black"), can be any SVG colour eg rgb(256,0,0) or FF0000
  • :fill_color = the fill colour of the glyphs in the track (default = ‘red’), can be any SVG colour eg rgb(256,0,0) or FF0000, or one of the built in gradient types Bio::Graphics::Glyph#gradients
 [:red_white_h, :green_white_h, :blue_white_h, :yellow_white_h, :red_white_radial, :green_white_radial, :blue_white_radial, :yellow_white_radial ]

or a custom definition of a gradient

 {:type => :radial,
 :id => :custom,
 :cx => 5,
 :cy => 5,
 :r => 50,
 :fx => 50,
 :fy => 50,
   :stops => [ {
        :offset => 0,
        :color => 'rgb(255,255,255)',
        :opacity => 0
        },  {
        :offset => 100,
        :color => 'rgb(0,127,200)',
        :opacity => 1
        }, ]
 }
  • :track_height = minimum height for the track, will be modified automatically if more space is needed e.g for overlapping features (default = auto),
  • :name = a displayed name for the track (default = ‘feature_track’)
  • :label = display the name given to the track (default = true),
  • :stroke_width = width in pixels of the outline of the glyphs (default=1)
  • :x_round = x radius of the ellipse used to round off the corners of rectangles (default = 1)
  • :y_round = y radius of the ellipse used to round off the corners of rectangles (default = 1)

:utr_fill_color = the fill colour of the utr part of the glyph (default = ‘black’), can be any SVG colour eg rgb(256,0,0) or FF0000, or one of the built in gradient types Bio::Graphics::Glyph#gradients

 [:red_white_h, :green_white_h, :blue_white_h, :yellow_white_h, :red_white_radial, :green_white_radial, :blue_white_radial, :yellow_white_radial ]

or a custom definition of a gradient

 {:type => :radial,
 :id => :custom,
 :cx => 5,
 :cy => 5,
 :r => 50,
 :fx => 50,
 :fy => 50,
   :stops => [ {
        :offset => 0,
        :color => 'rgb(255,255,255)',
        :opacity => 0
        },  {
        :offset => 100,
        :color => 'rgb(0,127,200)',
        :opacity => 1
        }, ]
 }
  • :utr_stroke = the outline colour of the utr part of the glyph (default = "black"), can be any SVG colour eg rgb(256,0,0) or FF0000
  • :utr_stroke_width = The width of the outline stroke for the utr part of the glyph (default = 1)
  • :exon_fill_color = the fill colour of the utr part of the glyph (default = ‘red’), can be any SVG colour eg rgb(256,0,0) or FF0000, or one of the built in gradient types Bio::Graphics::Glyph#gradients or a custom definition of a gradient
 [:red_white_h, :green_white_h, :blue_white_h, :yellow_white_h, :red_white_radial, :green_white_radial, :blue_white_radial, :yellow_white_radial ]

or a custom definition of a gradient

 {:type => :radial,
 :id => :custom,
 :cx => 5,
 :cy => 5,
 :r => 50,
 :fx => 50,
 :fy => 50,
   :stops => [ {
        :offset => 0,
        :color => 'rgb(255,255,255)',
        :opacity => 0
        },  {
        :offset => 100,
        :color => 'rgb(0,127,200)',
        :opacity => 1
        }, ]
  • :exon_stroke = the outline colour of the exon part of the glyph (default = "black") can be any SVG colour eg rgb(256,0,0) or FF0000
  • :exon_stroke_width = The width of the outline stroke for the exon part of the glyph (default = 1)
  • :line_color = the colour for the line part that joins the blocks (default = ‘black’) can be any SVG colour eg rgb(256,0,0) or FF0000
  • :line_width = the width ffor the line part that joins the blocks (default = 1)
  • :exon_style = an arbitrary SVG compliant style string eg "fill-opacity:0.4;"
  • :utr_style = an arbitrary SVG compliant style string eg "fill-opacity:0.4;"
  • :line_style = an arbitrary SVG compliant style string eg "fill-opacity:0.4;"
  • :gap_marker = style of the line between blocks - either angled or straight

Public Instance methods

Calculates how many rows are needed per track for overlapping features and which row each feature should be in. Usually only called by the enclosing Bio::Graphics::Page object.

Calculates whether two Bio::Graphics::MiniFeature objects overlap by examining their start and end positions.

args

[Validate]