Class: Bio::Graphics::MiniFeature
- Inherits:
-
Object
- Object
- Bio::Graphics::MiniFeature
- Defined in:
- lib/bio/graphics/mini_feature.rb
Overview
A Bio::Graphics::MiniFeature object represents a single genomic feature (e.g. a gene, transcript, exon, start codon, etc), it is a lightweight object that holds the minimum information needed to do the render.
Instance Attribute Summary collapse
-
#block_gaps ⇒ Object
Returns the value of attribute block_gaps.
-
#end ⇒ Object
Returns the value of attribute end.
-
#exons ⇒ Object
Returns the value of attribute exons.
-
#id ⇒ Object
Returns the value of attribute id.
-
#params ⇒ Object
Returns the value of attribute params.
-
#segment_height ⇒ Object
Returns the value of attribute segment_height.
-
#start ⇒ Object
Returns the value of attribute start.
-
#strand ⇒ Object
Returns the value of attribute strand.
-
#utrs ⇒ Object
Returns the value of attribute utrs.
Instance Method Summary collapse
-
#initialize(args) ⇒ MiniFeature
constructor
Creates a new MiniFeature.
Constructor Details
#initialize(args) ⇒ MiniFeature
Creates a new MiniFeature
args
-
:start = the start position of the feature
-
:end = the end position of the feature
-
:strand = the strand of the feature
-
:exons = an array of exon positions
-
:utrs = an array of utrs positions
-
:block_gaps = an array of regions with nothing to be drawn, e.g. introns
-
:id = the name for the feature such as the gene name or transcript ID
-
:segment_height = the height of the current feature
Example usage
mini1 = Bio::Graphics::MiniFeature.new(
:start=>3631,
:end=>5899,
:strand=>'+',
:exons=>[4000, 4500, 4700, 5000],
:utrs=>[3631, 3650],
:segment_height=>5,
:id=>"AT1G01010"
)
MiniFeatures and Tracks
MiniFeatures are created and added to Bio::Graphics::Track objects which will take responsibility for positioning and syling them.#
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/bio/graphics/mini_feature.rb', line 35 def initialize(args) @start = args[:start] @end = args[:end] @strand = args[:strand] @exons = args[:exons] || [] @utrs = args[:utrs] || [] #start, ennd, strand, arg[:exons], arg[:utrs] @block_gaps = [] @id = args[:id] @segment_height = args[:segment_height] @params = args[:params] end |
Instance Attribute Details
#block_gaps ⇒ Object
Returns the value of attribute block_gaps.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def block_gaps @block_gaps end |
#end ⇒ Object
Returns the value of attribute end.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def end @end end |
#exons ⇒ Object
Returns the value of attribute exons.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def exons @exons end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def id @id end |
#params ⇒ Object
Returns the value of attribute params.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def params @params end |
#segment_height ⇒ Object
Returns the value of attribute segment_height.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def segment_height @segment_height end |
#start ⇒ Object
Returns the value of attribute start.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def start @start end |
#strand ⇒ Object
Returns the value of attribute strand.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def strand @strand end |
#utrs ⇒ Object
Returns the value of attribute utrs.
8 9 10 |
# File 'lib/bio/graphics/mini_feature.rb', line 8 def utrs @utrs end |