Permalink
Browse files

fixed quality parsing

  • Loading branch information...
1 parent 7cd6508 commit f0e7cabcb8bd15aa746f020bc5a2f9fcfbe29586 @fstrozzi fstrozzi committed Jan 12, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/bio-assembly/caf.rb
View
@@ -48,15 +48,14 @@ def parse_blocks(line,feat)
def parse_dna(feat)
feat[:seq] = @file.gets("\n\n").tr("\n","")
newline = @file.gets
- feat[:qual] = @file.gets("\n\n").tr("\n","") if newline.start_with?("BaseQuality")
+ feat[:qual] = @file.gets("\n\n").tr("\n"," ").rstrip if newline.start_with?("BaseQuality")
feat[:parsed] = true if feat[:type] == :contig
end
def parse_seq(feat,line)
feat[:name] = line.split(":")[1].tr("\s|\n","")
sequence_block = @file.gets("\n\n")
sequence_block.split("\n").each do |l|
- puts l
case true
when l.start_with?("Clipping") then parse_clipping(feat,l)
when l.start_with?("Strand") then parse_strand(feat,l)
@@ -101,9 +100,8 @@ def convert_to_contig(contig,feature)
contig.name = feature[:name]
contig.seq = feature[:seq]
contig.quality = feature[:qual]
- # fixing reads ranges using Assembled_from lines in Contig
+ # assign reads ranges using Assembled_from lines in Contig
feature[:af].each do |af|
- puts af
val = af.split("\s")
contig.reads[val[-5]].from = val[-4]
contig.reads[val[-5]].to = val[-3]

0 comments on commit f0e7cab

Please sign in to comment.