| Class | Bio::PSORT::PSORT1::Report |
| In: |
lib/bio/appl/psort/report.rb
|
| Parent: | Object |
| entry_id | [RW] | |
| final_result | [RW] | |
| origin | [RW] | |
| raw | [RW] | |
| reasoning | [RW] | |
| result_info | [RW] | |
| sequence | [RW] | |
| title | [RW] |
Returns aBio::PSORT::PSORT1::Report.
# File lib/bio/appl/psort/report.rb, line 36
36: def self.default_parser(output_report)
37: rpt = self.new
38: rpt.raw = output_report
39: query_info = output_report.scan(/^Query Information\n\n(.+?)\n\n/m)[0][0].split(/\n/)
40: result_info = output_report.scan(/^Result Information\n\n(.+?)\n\n\*/m)[0][0]
41: step1 = output_report.scan(/^\*\*\* Reasoning Step: 1\n\n(.+?)\n\n/m)[0][0]
42: step2 = output_report.scan(/^\*\*\* Reasoning Step: 2\n\n(.+?)\n\n/m)[0][0]
43: final_result = output_report.scan(/\n\n----- Final Results -----\n\n(.+?)\n\n\n/m)[0][0]
44:
45: rpt.entry_id = query_info[2].scan(/^>(\S+) */).to_s
46: rpt.origin = query_info[0].scan(/ORIGIN (\w+)/).to_s
47: rpt.sequence = Bio::Sequence::AA.new(query_info[3..query_info.size].to_s)
48: # rpt.reasoning
49:
50: rpt.final_result = final_result.split(/\n/).map {|x|
51: x = x.strip.split(/---/).map {|y| y.strip }
52: { 'prediction' => x[0],
53: 'certainty' => x[1].scan(/Certainty= (\d\.\d{3})/).to_s,
54: 'comment' => x[1].scan(/\((\w+)\)/).to_s
55: }
56: }
57: return rpt
58: end
Constructs aBio::PSORT::PSORT1::Report object.
# File lib/bio/appl/psort/report.rb, line 72
72: def initialize(entry_id = '', origin = '', title = '', sequence = '',
73: result_info = '', reasoning = {}, final_result = [])
74: @entry_id = entry_id
75: @origin = origin
76: @title = title
77: @sequence = sequence
78: @result_info = result_info
79: @reasoning = reasoning
80: @final_result = final_result
81: @raw = ''
82: end
Returns aBio::PSORT::PSORT1::Report.
# File lib/bio/appl/psort/report.rb, line 31
31: def self.parser(output_report)
32: self.default_parser(output_report)
33: end