Flatfile splitter for RPS-BLAST reports. It is internally used when reading RPS-BLAST report. Normally, users do not need to use it directly.
Note for Windows: RPS-BLAST results generated in Microsoft Windows may not be parsed correctly due to the line feed code problem. For a workaroud, convert line feed codes from Windows(DOS) to UNIX.
Delimiter used for IO#gets
Separator used to distinguish start of each report
gets an entry
# File lib/bio/appl/blast/rpsblast.rb, line 73 def get_entry p0 = stream_pos() pieces = [] flag_head = false # reached to start of header flag_body = false # reached to start of body (Query=...) while x = stream.gets(Delimiter) if ReportHead =~ x then case $1 when 'RPS-BLAST' if pieces.empty? then @entry_head = nil flag_head = true else stream.ungets(x) break end when 'Query=' if flag_body then stream.ungets(x) break else @entry_head = pieces.join('') if flag_head flag_body = true end else raise 'Bug: should not reach here' end end #if ReportHead... pieces.push x end #while p1 = stream_pos() self.entry_start_pos = p0 self.entry = if pieces.empty? then nil elsif !flag_head and @entry_head then @entry_head + pieces.join('') else pieces.join('') end self.entry_ended_pos = p1 return self.entry end
Generated with the Darkfish Rdoc Generator 2.