Class: HTS::Bam::Mpileup::ColumnsView
- Inherits:
-
Object
- Object
- HTS::Bam::Mpileup::ColumnsView
- Includes:
- Enumerable
- Defined in:
- lib/hts/bam/mpileup.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
(also: #size)
readonly
Returns the value of attribute length.
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#tid ⇒ Object
readonly
Returns the value of attribute tid.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ ColumnsView
constructor
A new instance of ColumnsView.
- #reset(tid, pos, rows) ⇒ Object
Constructor Details
#initialize ⇒ ColumnsView
Returns a new instance of ColumnsView.
40 |
# File 'lib/hts/bam/mpileup.rb', line 40 def initialize = @column_view = Pileup::BorrowedColumnView.new |
Instance Attribute Details
#length ⇒ Object (readonly) Also known as: size
Returns the value of attribute length.
38 39 40 |
# File 'lib/hts/bam/mpileup.rb', line 38 def length @length end |
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
38 39 40 |
# File 'lib/hts/bam/mpileup.rb', line 38 def pos @pos end |
#tid ⇒ Object (readonly)
Returns the value of attribute tid.
38 39 40 |
# File 'lib/hts/bam/mpileup.rb', line 38 def tid @tid end |
Instance Method Details
#each ⇒ Object
50 51 52 53 54 55 |
# File 'lib/hts/bam/mpileup.rb', line 50 def each return to_enum(__method__) unless block_given? @rows.each_with_index { |entries, index| yield index, @column_view.reset(entries, @tid, @pos) } self end |
#reset(tid, pos, rows) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/hts/bam/mpileup.rb', line 42 def reset(tid, pos, rows) @tid = tid @pos = pos @rows = rows @length = rows.length self end |