]> git.donarmstrong.com Git - biopieces.git/commitdiff
got rid of type in filesys.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 22 Nov 2011 14:56:12 +0000 (14:56 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 22 Nov 2011 14:56:12 +0000 (14:56 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1676 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/lib/maasha/fasta.rb
code_ruby/lib/maasha/fastq.rb
code_ruby/lib/maasha/filesys.rb
code_ruby/test/maasha/test_fasta.rb
code_ruby/test/maasha/test_fastq.rb

index 05655f67c86d609e8e4ab666347df228ad246c50..d4c443b0824301eda7dd8f397413fcba1285d92d 100644 (file)
@@ -42,9 +42,9 @@ class Fasta < Filesys
     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?
index a6b3610e88c6d3abd632c47b46aa31519594591d..e2a96ea86c69bf2f97712c2c0b6fa7c73995b4cd 100644 (file)
@@ -39,10 +39,10 @@ class Fastq < Filesys
       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
index 00530d655720eaa7e82f51f6ece33353527ae8d8..bed11f023d13506d84df3ec7ea1b81058612269d 100644 (file)
@@ -65,10 +65,8 @@ class Filesys
     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.
index a8ba01c492fe1e603e0e6eb97468d36368fced18..e52440d0c0f6cbb9c16cc9aa031bf5067145fad7 100755 (executable)
@@ -46,11 +46,6 @@ class FastaTest < Test::Unit::TestCase
     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)
index 2316fc7483330f978dee6d5283f1c20453484e34..84322072f72bf71d871d7f80592fa22068ed2036 100755 (executable)
@@ -40,11 +40,6 @@ class FastqTest < Test::Unit::TestCase
     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)