class Bio::Genscan::Report
Bio::Genscan::Report
- Class for Genscan
report output.¶ ↑
Parser for the Genscan
report output.
Attributes
date_run[R]
Returns
gccontent[R]
Returns C+G content of the query sequence.
genes[R]
Returns Array of Bio::Genscan::Report::Gene
.
genscan_version[R]
Returns Genscan
version.
isochore[R]
Returns
length[R]
Returns Length of the query sequence.
matrix[R]
Returns
name[R]
Returns Name of query sequence.
prediction[R]
Returns Array of Bio::Genscan::Report::Gene
.
predictions[R]
Returns Array of Bio::Genscan::Report::Gene
.
query_name[R]
Returns Name of query sequence.
sequence_name[R]
Returns Name of query sequence.
time[R]
Returns
Public Class Methods
new(report)
click to toggle source
Parse a Genscan
report output string.
# File lib/bio/appl/genscan/report.rb 66 def initialize(report) 67 @predictions = [] 68 @genscan_version = nil 69 @date_run = nil 70 @time = nil 71 @query_name = nil 72 @length = nil 73 @gccontent = nil 74 @isochore = nil 75 @matrix = nil 76 77 report.each_line("\n") do |line| 78 case line 79 when /^GENSCAN/ 80 parse_headline(line) 81 when /^Sequence/ 82 parse_sequence(line) 83 when /^Parameter/ 84 parse_parameter(line) 85 when /^Predicted genes/ 86 break 87 end 88 end 89 90 # rests 91 i = report.index(/^Predicted gene/) 92 j = report.index(/^Predicted peptide sequence/) 93 94 # genes/exons 95 genes_region = report[i...j] 96 genes_region.each_line("\n") do |line| 97 if /Init|Intr|Term|PlyA|Prom|Sngl/ =~ line 98 gn, en = line.strip.split(" +")[0].split(/\./).map {|ii| ii.to_i } 99 add_exon(gn, en, line) 100 end 101 end 102 103 # sequences (peptide|CDS) 104 sequence_region = report[j...report.size] 105 sequence_region.gsub!(/^Predicted .+?:/, '') 106 sequence_region.gsub!(/^\s*$/, '') 107 sequence_region.split(Bio::FastaFormat::RS).each do |ff| 108 add_seq(Bio::FastaFormat.new(ff)) 109 end 110 end