Class: Ucsc::Hg18::Slice
- Inherits:
-
Object
- Object
- Ucsc::Hg18::Slice
- Defined in:
- lib/ucsc/hg18/slice.rb
Instance Attribute Summary collapse
-
#chromosome ⇒ Object
Returns the value of attribute chromosome.
-
#range ⇒ Object
Returns the value of attribute range.
-
#strand ⇒ Object
Returns the value of attribute strand.
Instance Method Summary collapse
- #contained_by?(other_slice) ⇒ Boolean
- #contains?(other_slice) ⇒ Boolean
-
#initialize(chromosome, range, strand = nil) ⇒ Slice
constructor
A new instance of Slice.
- #overlaps?(other_slice) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(chromosome, range, strand = nil) ⇒ Slice
Returns a new instance of Slice.
4 5 6 |
# File 'lib/ucsc/hg18/slice.rb', line 4 def initialize(chromosome, range, strand = nil) @chromosome, @range = chromosome, range, strand end |
Instance Attribute Details
#chromosome ⇒ Object
Returns the value of attribute chromosome.
7 8 9 |
# File 'lib/ucsc/hg18/slice.rb', line 7 def chromosome @chromosome end |
#range ⇒ Object
Returns the value of attribute range.
7 8 9 |
# File 'lib/ucsc/hg18/slice.rb', line 7 def range @range end |
#strand ⇒ Object
Returns the value of attribute strand.
7 8 9 |
# File 'lib/ucsc/hg18/slice.rb', line 7 def strand @strand end |
Instance Method Details
#contained_by?(other_slice) ⇒ Boolean
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ucsc/hg18/slice.rb', line 25 def contained_by?(other_slice) if self.chromosome != other_slice.chromosome return false end if self.range.contained_by?(other_slice.range) return true else return false end end |
#contains?(other_slice) ⇒ Boolean
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/ucsc/hg18/slice.rb', line 37 def contains?(other_slice) if self.chromosome != other_slice.chromosome return false end if self.range.contains?(other_slice.range) return true else return false end end |
#overlaps?(other_slice) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ucsc/hg18/slice.rb', line 13 def overlaps?(other_slice) if self.chromosome != other_slice.chromosome return false end if self.range.overlaps?(other_slice.range) return true else return false end end |
#to_s ⇒ Object
9 10 11 |
# File 'lib/ucsc/hg18/slice.rb', line 9 def to_s return @chromosome + ':' + @range.to_s end |