class Cytogenetics::Breakpoint

Attributes

band[RW]
chr[RW]
type[RW]

Public Class Methods

new(*args) click to toggle source
# 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 StructureError, "#{c}#{b} is not a valid breakpoint"
  end
  @chr = c; @band = b
end

Public Instance Methods

arm() click to toggle source
# File lib/cytogenetics/breakpoint.rb, line 19
def arm
  @band.match(/(q|p)\d+/)
  return $1
end
config_logging() click to toggle source
# File lib/cytogenetics/breakpoint.rb, line 30
def config_logging
  @log = Cytogenetics.logger
  #@log.progname = self.class.name
end
to_s() click to toggle source
# File lib/cytogenetics/breakpoint.rb, line 24
def to_s
  return "#{@chr}#{@band}"
end