class Cytogenetics::Fragment

Attributes

chr[R]
end[R]
genes[R]
start[R]

Public Class Methods

new(*args) click to toggle source
# File lib/cytogenetics/fragment.rb, line 7
def initialize(*args)
  config_logging()
  unless (args.length.eql? 2 and (args[0].is_a? Breakpoint and args[1].is_a? Breakpoint))
    raise ArgumentError, "Expected arguments are missing or are not Breakpoints: #{args}"
  end

  #@genes = []
  @start = args[0]
  @end = args[1]
  @chr = @start.chr

  unless @start.chr.eql? @end.chr
    raise StructureError, "Fragments must be within the same chromosome: #{args}"
  end
end

Public Instance Methods

add_gene(gene) click to toggle source
# File lib/cytogenetics/fragment.rb, line 23
def add_gene(gene)
  @genes << gene
end
config_logging() click to toggle source
# File lib/cytogenetics/fragment.rb, line 38
def config_logging
  @log = Cytogenetics.logger
  #@log.progname = self.class.name
end
to_s() click to toggle source
# File lib/cytogenetics/fragment.rb, line 27
def to_s
  return "#{@start.to_s} --> #{@end.to_s}"
end