Class: Bio::DB::PileupIterator::PileupRead
- Inherits:
-
Object
- Object
- Bio::DB::PileupIterator::PileupRead
- Defined in:
- lib/bio/db/pileup_iterator.rb
Constant Summary collapse
- FORWARD_DIRECTION =
Directions relative to reference
'+'
- REVERSE_DIRECTION =
'-'
Instance Attribute Summary collapse
-
#direction ⇒ Object
sequence is always in the direction of the start of the reference to the end - only @direction gives direction information.
-
#insertions ⇒ Object
readonly
A hash of recorded insertions.
-
#sequence ⇒ Object
sequence is always in the direction of the start of the reference to the end - only @direction gives direction information.
Instance Method Summary collapse
- #add_insertion(position, insertion_length, insertion_bases) ⇒ Object
-
#initialize ⇒ PileupRead
constructor
A new instance of PileupRead.
- #read ⇒ Object
Constructor Details
#initialize ⇒ PileupRead
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
#direction ⇒ Object
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 |
#insertions ⇒ Object (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 |
#sequence ⇒ Object
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 |
#read ⇒ Object
160 161 162 |
# File 'lib/bio/db/pileup_iterator.rb', line 160 def read @sequence[@sequence.length-2..@sequence.length-1] end |