Class: Bix::Fastq
- Inherits:
-
Object
- Object
- Bix::Fastq
- Defined in:
- lib/bix/fastq.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
Returns the value of attribute header.
-
#invalid ⇒ Object
Returns the value of attribute invalid.
-
#qual ⇒ Object
Returns the value of attribute qual.
-
#seq ⇒ Object
Returns the value of attribute seq.
Class Method Summary collapse
Instance Method Summary collapse
- #from_io(io) ⇒ Object
-
#initialize(header = "", seq = "", qual = "") ⇒ Fastq
constructor
A new instance of Fastq.
- #qual_val(i) ⇒ Object
- #to_lines ⇒ Object
Constructor Details
#initialize(header = "", seq = "", qual = "") ⇒ Fastq
Returns a new instance of Fastq.
5 6 7 8 9 |
# File 'lib/bix/fastq.rb', line 5 def initialize(header="", seq="", qual="") @header = header @seq = seq @qual = qual end |
Instance Attribute Details
#header ⇒ Object
Returns the value of attribute header.
3 4 5 |
# File 'lib/bix/fastq.rb', line 3 def header @header end |
#invalid ⇒ Object
Returns the value of attribute invalid.
3 4 5 |
# File 'lib/bix/fastq.rb', line 3 def invalid @invalid end |
#qual ⇒ Object
Returns the value of attribute qual.
3 4 5 |
# File 'lib/bix/fastq.rb', line 3 def qual @qual end |
#seq ⇒ Object
Returns the value of attribute seq.
3 4 5 |
# File 'lib/bix/fastq.rb', line 3 def seq @seq end |
Class Method Details
Instance Method Details
#from_io(io) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bix/fastq.rb', line 11 def from_io(io) @header = io.gets @seq = io.gets io.gets # Throw away + line @qual = io.gets return false if @header == nil || @seq == nil || @qual == nil @header.chomp! @seq.chomp! @qual.chomp! return true end |
#qual_val(i) ⇒ Object
35 36 37 |
# File 'lib/bix/fastq.rb', line 35 def qual_val(i) return @qual[i].ord end |
#to_lines ⇒ Object
39 40 41 |
# File 'lib/bix/fastq.rb', line 39 def to_lines return "#{@header}\n#{@seq}\n+\n#{@qual}" end |