class Bio::SOSUI::Report

SOSUI output report parsing class

References

Constants

DELIMITER

Delimiter

RS

Attributes

entry_id[R]

Query entry_id

prediction[R]

Returns the prediction result whether “MEMBRANE PROTEIN” or “SOLUBLE PROTEIN”.

tmhs[R]

Transmembrane helixes ary

Public Class Methods

new(output_report) click to toggle source

Parser for SOSUI output report.

   # File lib/bio/appl/sosui/report.rb
44 def initialize(output_report)
45   entry       = output_report.split(/\n/)
46 
47   @entry_id   = entry[0].strip.sub(/^>/,'')
48   @prediction = entry[1].strip
49   @tms        = 0
50   @tmhs       = []
51   parse_tmh(entry) if /MEMBRANE/ =~ @prediction
52 end

Private Instance Methods

parse_tmh(entry) click to toggle source

Parser for TMH lines.

   # File lib/bio/appl/sosui/report.rb
57 def parse_tmh(entry)
58   entry.each do |line|
59     if /NUMBER OF TM HELIX = (\d+)/ =~ line
60       @tms = $1
61     elsif /TM (\d+) +(\d+)- *(\d+) (\w+) +(\w+)/ =~ line
62       #tmh  = $1.to_i
63       range = Range.new($2.to_i, $3.to_i)
64       grade = $4
65       seq   = $5
66       @tmhs.push(TMH.new(range, grade, seq))
67     end
68   end
69 end