Class: Bio::DB::PileupIterator::PileupRead

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/db/pileup_iterator.rb

Constant Summary collapse

FORWARD_DIRECTION =

Directions relative to reference

'+'
REVERSE_DIRECTION =
'-'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePileupRead

Returns a new instance of PileupRead.



155
156
157
158
# File 'lib/bio/db/pileup_iterator.rb', line 155

def initialize
  @sequence = ''
  @insertions = {}
end

Instance Attribute Details

#directionObject

sequence is always in the direction of the start of the reference to the end - only @direction gives direction information



150
151
152
# File 'lib/bio/db/pileup_iterator.rb', line 150

def direction
  @direction
end

#insertionsObject (readonly)

A hash of recorded insertions. Key of hash is the position in the consensus that is has been added to in the alignment, value is the bases that have been inserted



153
154
155
# File 'lib/bio/db/pileup_iterator.rb', line 153

def insertions
  @insertions
end

#sequenceObject

sequence is always in the direction of the start of the reference to the end - only @direction gives direction information



150
151
152
# File 'lib/bio/db/pileup_iterator.rb', line 150

def sequence
  @sequence
end

Instance Method Details

#add_insertion(position, insertion_length, insertion_bases) ⇒ Object



164
165
166
# File 'lib/bio/db/pileup_iterator.rb', line 164

def add_insertion(position, insertion_length, insertion_bases)
  insertions[position] = insertion_bases
end

#readObject



160
161
162
# File 'lib/bio/db/pileup_iterator.rb', line 160

def read
  @sequence[@sequence.length-2..@sequence.length-1]
end