Class: Bio::Genscan::Report
Overview
Bio::Genscan::Report - Class for Genscan report output.
Parser for the Genscan report output.
-
Genscan genes.mit.edu/GENSCAN.html
Defined Under Namespace
Instance Attribute Summary collapse
-
#date_run ⇒ Object
readonly
Returns.
-
#gccontent ⇒ Object
readonly
Returns C+G content of the query sequence.
-
#genscan_version ⇒ Object
readonly
Returns Genscan version.
-
#isochore ⇒ Object
readonly
Returns.
-
#length ⇒ Object
readonly
Returns Length of the query sequence.
-
#matrix ⇒ Object
readonly
Returns.
-
#predictions ⇒ Object
(also: #prediction, #genes)
readonly
Returns Array of Bio::Genscan::Report::Gene.
-
#query_name ⇒ Object
(also: #sequence_name, #name)
readonly
Returns Name of query sequence.
-
#time ⇒ Object
readonly
Returns.
Instance Method Summary collapse
-
#initialize(report) ⇒ Report
constructor
Bio::Genscan::Report.new(str).
Constructor Details
#initialize(report) ⇒ Report
Bio::Genscan::Report.new(str)
Parse a Genscan report output string.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/bio/appl/genscan/report.rb', line 66 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 {|ii| ii.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 |
Instance Attribute Details
#date_run ⇒ Object (readonly)
Returns
35 36 37 |
# File 'lib/bio/appl/genscan/report.rb', line 35 def date_run @date_run end |
#gccontent ⇒ Object (readonly)
Returns C+G content of the query sequence.
49 50 51 |
# File 'lib/bio/appl/genscan/report.rb', line 49 def gccontent @gccontent end |
#genscan_version ⇒ Object (readonly)
Returns Genscan version.
32 33 34 |
# File 'lib/bio/appl/genscan/report.rb', line 32 def genscan_version @genscan_version end |
#isochore ⇒ Object (readonly)
Returns
52 53 54 |
# File 'lib/bio/appl/genscan/report.rb', line 52 def isochore @isochore end |
#length ⇒ Object (readonly)
Returns Length of the query sequence.
46 47 48 |
# File 'lib/bio/appl/genscan/report.rb', line 46 def length @length end |
#matrix ⇒ Object (readonly)
Returns
55 56 57 |
# File 'lib/bio/appl/genscan/report.rb', line 55 def matrix @matrix end |
#predictions ⇒ Object (readonly) Also known as: prediction, genes
Returns Array of Bio::Genscan::Report::Gene.
58 59 60 |
# File 'lib/bio/appl/genscan/report.rb', line 58 def predictions @predictions end |
#query_name ⇒ Object (readonly) Also known as: sequence_name, name
Returns Name of query sequence.
41 42 43 |
# File 'lib/bio/appl/genscan/report.rb', line 41 def query_name @query_name end |
#time ⇒ Object (readonly)
Returns
38 39 40 |
# File 'lib/bio/appl/genscan/report.rb', line 38 def time @time end |