Parser for the Genscan report output.
Parse a Genscan report output string.
# File lib/bio/appl/genscan/report.rb, line 67 def initialize(report) @predictions = [] @genscan_version = nil @date_run = nil @time = nil @query_name = nil @length = nil @gccontent = nil @isochore = nil @matrix = nil report.each_line("\n") do |line| case line when /^GENSCAN/ parse_headline(line) when /^Sequence/ parse_sequence(line) when /^Parameter/ parse_parameter(line) when /^Predicted genes/ break end end # rests i = report.index(/^Predicted gene/) j = report.index(/^Predicted peptide sequence/) # genes/exons genes_region = report[i...j] genes_region.each_line("\n") do |line| if /Init|Intr|Term|PlyA|Prom|Sngl/ =~ line gn, en = line.strip.split(" +")[0].split(/\./).map {|i| i.to_i } add_exon(gn, en, line) end end # sequences (peptide|CDS) sequence_region = report[j...report.size] sequence_region.gsub!(/^Predicted .+?:/, '') sequence_region.gsub!(/^\s*$/, '') sequence_region.split(Bio::FastaFormat::RS).each do |ff| add_seq(Bio::FastaFormat.new(ff)) end end
Generated with the Darkfish Rdoc Generator 2.