]> git.donarmstrong.com Git - biopieces.git/commitdiff
fixed assemblers
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 13 Oct 2011 12:11:20 +0000 (12:11 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 13 Oct 2011 12:11:20 +0000 (12:11 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1563 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/analyze_assembly
bp_bin/assemble_seq_idba
bp_bin/assemble_seq_ray
bp_bin/assemble_seq_velvet

index 7fe7bd69dee9d09b1347cd66ebda462a81d9e448..3b9748db523c20c412ea21e52edd9c206402b25b 100755 (executable)
@@ -54,12 +54,14 @@ Fasta.open(infile, mode="w") do |fasta_output|
   Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
     input.each_record do |record|
       if record.has_key? :SEQ
+        seq = Seq.new_bp(record)
+
         total   += record[:SEQ].length
         lengths << record[:SEQ].length
       end
 
       output.puts record unless options[:no_stream]
-      fasta_output.puts record
+      fasta_output.puts seq.to_fasta
     end
   end
 end
index 1f392e91184b94de637b43e7e4a4b32648db5085..2b655431a8a0154c4af8bc7005a8cf527668d24a 100755 (executable)
@@ -53,17 +53,21 @@ count = 0
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
        Fasta.open(file_fasta, mode="w") do |fasta_io|
                input.each_record do |record|
-      if options[:scaffold] # we need to fix the sequence name for mate-pair IDBA
-        if record[:SEQ_NAME] =~ /1$/
-          record[:SEQ_NAME] = "read#{count}/1"
-        else
-          record[:SEQ_NAME] = "read#{count}/2"
+      if record[:SEQ_NAME] and record[:SEQ]
+        seq = Seq.new_bp(record)
 
-          count += 1
+        if options[:scaffold] # we need to fix the sequence name for mate-pair IDBA
+          if seq.seq_name =~ /1$/
+            seq.seq_name = "read#{count}/1"
+          else
+            seq.seq_name = "read#{count}/2"
+
+            count += 1
+          end
         end
-      end
 
-                       fasta_io.puts record
+        fasta_io.puts seq.to_fasta
+      end
                end
        end
 
index 441fb507ede8c228fbcad32c6ff242504926a538..fbef82aedd72fba3bc268adaba38fba6eed4eaa0 100755 (executable)
@@ -141,7 +141,11 @@ file_fasta = File.join(options[:directory], "sequence_in.fasta")
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
        Fasta.open(file_fasta, mode="w") do |fasta_io|
                input.each_record do |record|
-                       fasta_io.puts record
+      if record[:SEQ_NAME] and record[:SEQ]
+        seq = Seq.new_bp(record)
+
+                         fasta_io.puts seq.to_fasta
+      end
                end
        end
 
index 71fc5c129c9972320fdc3d8d79976eca32fcfc58..98c0ba4486a23d47b6969cd9d56d2a4e1902f24b 100755 (executable)
@@ -161,10 +161,13 @@ Dir.mkdir(options[:directory]) unless Dir.exists?(options[:directory])
 file_fasta = File.join(options[:directory], "sequence_in.fna")
 
 Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
-       Fasta.open(file_fasta, mode="w") do |fasta_io|
-               input.each_record do |record|
-                       fasta_io.puts record
-               end
+  Fasta.open(file_fasta, mode="w") do |fasta_io|
+    input.each_record do |record|
+      if record[:SEQ_NAME] and record[:SEQ]
+        seq = Seq.new_bp(record)
+        fasta_io.puts seq.to_fasta
+      end
+    end
        end
 
        unless File.size(file_fasta) == 0