Class: Cytogenetics::Breakpoint
- Inherits:
-
Object
- Object
- Cytogenetics::Breakpoint
- Defined in:
- lib/cytogenetics/breakpoint.rb
Instance Attribute Summary collapse
-
#band ⇒ Object
Returns the value of attribute band.
-
#chr ⇒ Object
Returns the value of attribute chr.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #arm ⇒ Object
- #config_logging ⇒ Object
-
#initialize(*args) ⇒ Breakpoint
constructor
A new instance of Breakpoint.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Breakpoint
Returns a new instance of Breakpoint.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/cytogenetics/breakpoint.rb', line 7 def initialize(*args) config_logging c = args[0]; b = args[1] @type = args[2] if args.length > 2 unless ((c.is_a? String and c.match(/\d+|X|Y/)) and (b.is_a? String and b.length > 0)) @log.error("#{c}#{b} is not a valid breakpoint") raise ArgumentError, "#{c}#{b} is not a valid breakpoint" end @chr = c; @band = b end |
Instance Attribute Details
#band ⇒ Object
Returns the value of attribute band.
5 6 7 |
# File 'lib/cytogenetics/breakpoint.rb', line 5 def band @band end |
#chr ⇒ Object
Returns the value of attribute chr.
5 6 7 |
# File 'lib/cytogenetics/breakpoint.rb', line 5 def chr @chr end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/cytogenetics/breakpoint.rb', line 5 def type @type end |
Instance Method Details
#arm ⇒ Object
19 20 21 22 |
# File 'lib/cytogenetics/breakpoint.rb', line 19 def arm @band.match(/(q|p)\d+/) return $1 end |
#config_logging ⇒ Object
30 31 32 33 |
# File 'lib/cytogenetics/breakpoint.rb', line 30 def config_logging @log = Cytogenetics.logger #@log.progname = self.class.name end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/cytogenetics/breakpoint.rb', line 24 def to_s return "#{@chr}#{@band}" end |