raise FastaError, "Bad FASTA format" if seq_name.nil? or seq.nil?
entry = Seq.new
- entry.type = @type.nil? ? nil : @type.downcase
entry.seq = seq.gsub(/\s/, '')
entry.seq_name = seq_name.sub(/^>/, '').rstrip
+ entry.type = nil
raise FastaError, "Bad FASTA format" if entry.seq_name.empty?
raise FastaError, "Bad FASTA format" if entry.seq.empty?
qual = @io.gets.chomp!
entry = Seq.new
- entry.type = @type.nil? ? nil : @type.downcase
entry.seq = seq
entry.seq_name = seq_name[1 .. seq_name.length]
entry.qual = qual
+ entry.type = nil
entry
rescue
end
end
- # TODO figure out what type is for.
- def initialize(io, type=nil)
- @io = io
- @type = type
+ def initialize(io)
+ @io = io
end
# Method to close ios.
assert_equal("ATCG", fasta.get_entry.seq)
end
- def test_Fasta_get_entry_obtains_the_correct_type
- fasta = Fasta.new(StringIO.new(">test\nATCG\n"), 'DNA')
- assert_equal("dna", fasta.get_entry.type)
- end
-
def test_Fasta_get_entry_rstrips_whitespace_from_seq_name
fasta = Fasta.new(StringIO.new(">test\n\r\t ATCG\n"))
assert_equal("test", fasta.get_entry.seq_name)
assert_equal("test1", @fastq.get_entry.seq_name)
end
- def test_Fasta_get_entry_obtains_the_correct_type
- fastq = Fastq.new(@io, 'DNA')
- assert_equal("dna", fastq.get_entry.type)
- end
-
def test_Fastq_get_entry_with_two_entries_obtain_correct
assert_equal("ATCG", @fastq.get_entry.seq)
assert_equal("atcg", @fastq.get_entry.seq)