Class: Cytogenetics::Fragment
- Inherits:
-
Object
- Object
- Cytogenetics::Fragment
- Defined in:
- lib/cytogenetics/fragment.rb
Instance Attribute Summary collapse
-
#chr ⇒ Object
readonly
Returns the value of attribute chr.
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#genes ⇒ Object
readonly
Returns the value of attribute genes.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
Instance Method Summary collapse
- #add_gene(gene) ⇒ Object
- #config_logging ⇒ Object
-
#initialize(*args) ⇒ Fragment
constructor
A new instance of Fragment.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Fragment
Returns a new instance of Fragment.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# 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 GenomeStructureError, "Fragments must be within the same chromosome: #{args}" end end |
Instance Attribute Details
#chr ⇒ Object (readonly)
Returns the value of attribute chr.
5 6 7 |
# File 'lib/cytogenetics/fragment.rb', line 5 def chr @chr end |
#end ⇒ Object (readonly)
Returns the value of attribute end.
5 6 7 |
# File 'lib/cytogenetics/fragment.rb', line 5 def end @end end |
#genes ⇒ Object (readonly)
Returns the value of attribute genes.
5 6 7 |
# File 'lib/cytogenetics/fragment.rb', line 5 def genes @genes end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
5 6 7 |
# File 'lib/cytogenetics/fragment.rb', line 5 def start @start end |
Instance Method Details
#add_gene(gene) ⇒ Object
23 24 25 |
# File 'lib/cytogenetics/fragment.rb', line 23 def add_gene(gene) @genes << gene end |
#config_logging ⇒ Object
38 39 40 41 |
# File 'lib/cytogenetics/fragment.rb', line 38 def config_logging @log = Cytogenetics.logger #@log.progname = self.class.name end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/cytogenetics/fragment.rb', line 27 def to_s return "#{@start.to_s} --> #{@end.to_s}" end |