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.
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 111 |
# 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 |
Instance Attribute Details
#date_run ⇒ Object (readonly)
Returns
36 37 38 |
# File 'lib/bio/appl/genscan/report.rb', line 36 def date_run @date_run end |
#gccontent ⇒ Object (readonly)
Returns C+G content of the query sequence.
50 51 52 |
# File 'lib/bio/appl/genscan/report.rb', line 50 def gccontent @gccontent end |
#genscan_version ⇒ Object (readonly)
Returns Genscan version.
33 34 35 |
# File 'lib/bio/appl/genscan/report.rb', line 33 def genscan_version @genscan_version end |
#isochore ⇒ Object (readonly)
Returns
53 54 55 |
# File 'lib/bio/appl/genscan/report.rb', line 53 def isochore @isochore end |
#length ⇒ Object (readonly)
Returns Length of the query sequence.
47 48 49 |
# File 'lib/bio/appl/genscan/report.rb', line 47 def length @length end |
#matrix ⇒ Object (readonly)
Returns
56 57 58 |
# File 'lib/bio/appl/genscan/report.rb', line 56 def matrix @matrix end |
#predictions ⇒ Object (readonly) Also known as: prediction, genes
Returns Array of Bio::Genscan::Report::Gene.
59 60 61 |
# File 'lib/bio/appl/genscan/report.rb', line 59 def predictions @predictions end |
#query_name ⇒ Object (readonly) Also known as: sequence_name, name
Returns Name of query sequence.
42 43 44 |
# File 'lib/bio/appl/genscan/report.rb', line 42 def query_name @query_name end |
#time ⇒ Object (readonly)
Returns
39 40 41 |
# File 'lib/bio/appl/genscan/report.rb', line 39 def time @time end |