Class: Bioroebe::SVG::MiniFeature

Inherits:
Object
  • Object
show all
Defined in:
lib/bioroebe/svg/mini_feature.rb

Overview

Bioroebe::SVG::MiniFeature

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(i) ⇒ MiniFeature

#

initialize

Creates a new MiniFeature.

Arguments:

: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

Usage examples:

mini1 = Bioroebe::SVG::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 Bioroebe::SVG::Track# objects which will take responsibility for positioning and syling them.

#


61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/bioroebe/svg/mini_feature.rb', line 61

def initialize(i)
  # ======================================================================= #
  # Deconstruct from the input hash given.
  # ======================================================================= #

  # ======================================================================= #
  # === @start
  # ======================================================================= #
  @start          = i[:start]
  # ======================================================================= #
  # === @end
  # ======================================================================= #
  @end            = i[:end]
  # ======================================================================= #
  # === @strand
  # ======================================================================= #
  @strand         = i[:strand]
  # ======================================================================= #
  # === @exons
  # ======================================================================= #
  @exons          = i[:exons] || []
  # ======================================================================= #
  # === @utrs
  # ======================================================================= #
  @utrs           = i[:utrs] || [] #start, ennd, strand, arg[:exons], arg[:utrs]
  # ======================================================================= #
  # === @id
  # ======================================================================= #
  @id             = i[:id]
  # ======================================================================= #
  # === @params
  # ======================================================================= #
  @params         = i[:params]
  # ======================================================================= #
  # === @segment_height
  # ======================================================================= #
  @segment_height = i[:segment_height]
  reset
end

Instance Attribute Details

#block_gapsObject

Returns the value of attribute block_gaps.



24
25
26
# File 'lib/bioroebe/svg/mini_feature.rb', line 24

def block_gaps
  @block_gaps
end

#endObject

Returns the value of attribute end.



20
21
22
# File 'lib/bioroebe/svg/mini_feature.rb', line 20

def end
  @end
end

#exonsObject

Returns the value of attribute exons.



22
23
24
# File 'lib/bioroebe/svg/mini_feature.rb', line 22

def exons
  @exons
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/bioroebe/svg/mini_feature.rb', line 18

def id
  @id
end

#paramsObject

Returns the value of attribute params.



26
27
28
# File 'lib/bioroebe/svg/mini_feature.rb', line 26

def params
  @params
end

#segment_heightObject

Returns the value of attribute segment_height.



25
26
27
# File 'lib/bioroebe/svg/mini_feature.rb', line 25

def segment_height
  @segment_height
end

#startObject

Returns the value of attribute start.



19
20
21
# File 'lib/bioroebe/svg/mini_feature.rb', line 19

def start
  @start
end

#strandObject

Returns the value of attribute strand.



21
22
23
# File 'lib/bioroebe/svg/mini_feature.rb', line 21

def strand
  @strand
end

#utrsObject

Returns the value of attribute utrs.



23
24
25
# File 'lib/bioroebe/svg/mini_feature.rb', line 23

def utrs
  @utrs
end

Instance Method Details

#resetObject

#

reset (reset tag)

#


104
105
106
107
108
109
# File 'lib/bioroebe/svg/mini_feature.rb', line 104

def reset
  # ======================================================================= #
  # === @block_gaps
  # ======================================================================= #
  @block_gaps = []
end