Class: OligoEnumerator
- Inherits:
-
Object
- Object
- OligoEnumerator
- Includes:
- Enumerable
- Defined in:
- lib/oligo_enumerator.rb
Overview
Class OligoEnumerator provides a simple means of generating unique tag sequences for testing and development
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(size, initial = 0) ⇒ OligoEnumerator
constructor
Generate an oligo enumerator.
- #last ⇒ Object
- #tag(i) ⇒ Object
Constructor Details
#initialize(size, initial = 0) ⇒ OligoEnumerator
Generate an oligo enumerator
16 17 18 19 |
# File 'lib/oligo_enumerator.rb', line 16 def initialize(size, initial = 0) @size = size @initial = initial end |
Instance Method Details
#each ⇒ Object
25 26 27 |
# File 'lib/oligo_enumerator.rb', line 25 def each @size.times { |i| yield tag(i + @initial) } end |
#last ⇒ Object
21 22 23 |
# File 'lib/oligo_enumerator.rb', line 21 def last tag(@size) end |
#tag(i) ⇒ Object
29 30 31 |
# File 'lib/oligo_enumerator.rb', line 29 def tag(i) i.to_s(4).tr('0123', 'ATCG') end |