Method: Bio::Iprscan::Report.parse_txt

Defined in:
lib/bio/appl/iprscan/report.rb

.parse_txt(io) ⇒ Object

Splits the entry stream.

Usage

Bio::Iprscan::Report.reports_txt(File.open("merged.txt")) do |report|
  report.class #=> Bio::Iprscan::Report
end


130
131
132
133
134
135
136
137
138
139
140
# File 'lib/bio/appl/iprscan/report.rb', line 130

def self.parse_txt(io)
  io.each("\n\nSequence") do |entry|
    if entry =~ /Sequence$/
      entry = entry.sub(/Sequence$/, '')
    end
    unless entry =~ /^Sequence/
      entry = 'Sequence' + entry
    end
    yield self.parse_txt_entry(entry)
  end
end