Class: HTS::Bam::Pileup::BorrowedColumnView

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/hts/bam/pileup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBorrowedColumnView

Returns a new instance of BorrowedColumnView.



64
# File 'lib/hts/bam/pileup.rb', line 64

def initialize = @entry_view = BorrowedEntryView.new

Instance Attribute Details

#depthObject (readonly)

Returns the value of attribute depth.



62
63
64
# File 'lib/hts/bam/pileup.rb', line 62

def depth
  @depth
end

#posObject (readonly)

Returns the value of attribute pos.



62
63
64
# File 'lib/hts/bam/pileup.rb', line 62

def pos
  @pos
end

#tidObject (readonly)

Returns the value of attribute tid.



62
63
64
# File 'lib/hts/bam/pileup.rb', line 62

def tid
  @tid
end

Instance Method Details

#eachObject



74
75
76
77
78
79
# File 'lib/hts/bam/pileup.rb', line 74

def each
  return to_enum(__method__) unless block_given?

  @rows.each { |row| yield @entry_view.reset(row, @tid, @pos) }
  self
end

#reset(rows, tid, pos) ⇒ Object



66
67
68
69
70
71
72
# File 'lib/hts/bam/pileup.rb', line 66

def reset(rows, tid, pos)
  @rows = rows
  @tid = tid
  @pos = pos
  @depth = rows.length
  self
end