Class: Bio::TMHMM::Report
Overview
TMHMM report parser class.
Instance Attribute Summary collapse
-
#entry_id ⇒ Object
readonly
Returns.
-
#exp_aas_in_tmhs ⇒ Object
readonly
Returns.
-
#exp_first_60aa ⇒ Object
readonly
Returns.
-
#predicted_tmhs ⇒ Object
readonly
Returns.
-
#query_len ⇒ Object
(also: #length)
readonly
Returns.
-
#tmhs ⇒ Object
readonly
Returns an Array of Bio::TMHMM::TMH.
-
#total_prob_of_N_in ⇒ Object
readonly
Returns.
Instance Method Summary collapse
-
#helix ⇒ Object
Returns an Array of Bio::TMHMM::TMH including only “TMhelix”.
-
#initialize(entry = nil) ⇒ Report
constructor
A new instance of Report.
- #to_s ⇒ Object
Constructor Details
#initialize(entry = nil) ⇒ Report
Returns a new instance of Report.
85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/bio/appl/tmhmm/report.rb', line 85 def initialize(entry = nil) begin str = entry.to_str rescue NoMethodError end if str then entry = str.enum_for(:each_line) end parse_header(entry) @tmhs = parse_tmhs(entry) end |
Instance Attribute Details
#entry_id ⇒ Object (readonly)
Returns
65 66 67 |
# File 'lib/bio/appl/tmhmm/report.rb', line 65 def entry_id @entry_id end |
#exp_aas_in_tmhs ⇒ Object (readonly)
Returns
74 75 76 |
# File 'lib/bio/appl/tmhmm/report.rb', line 74 def exp_aas_in_tmhs @exp_aas_in_tmhs end |
#exp_first_60aa ⇒ Object (readonly)
Returns
77 78 79 |
# File 'lib/bio/appl/tmhmm/report.rb', line 77 def exp_first_60aa @exp_first_60aa end |
#predicted_tmhs ⇒ Object (readonly)
Returns
71 72 73 |
# File 'lib/bio/appl/tmhmm/report.rb', line 71 def predicted_tmhs @predicted_tmhs end |
#query_len ⇒ Object (readonly) Also known as: length
Returns
68 69 70 |
# File 'lib/bio/appl/tmhmm/report.rb', line 68 def query_len @query_len end |
#tmhs ⇒ Object (readonly)
Returns an Array of Bio::TMHMM::TMH.
62 63 64 |
# File 'lib/bio/appl/tmhmm/report.rb', line 62 def tmhs @tmhs end |
#total_prob_of_N_in ⇒ Object (readonly)
Returns
80 81 82 |
# File 'lib/bio/appl/tmhmm/report.rb', line 80 def total_prob_of_N_in @total_prob_of_N_in end |
Instance Method Details
#helix ⇒ Object
Returns an Array of Bio::TMHMM::TMH including only “TMhelix”.
98 99 100 |
# File 'lib/bio/appl/tmhmm/report.rb', line 98 def helix @tmhs.map {|t| t if t.status == 'TMhelix' }.compact end |
#to_s ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/bio/appl/tmhmm/report.rb', line 103 def to_s [ [ ["Length:", @query_len], ["Number of predicted TMHs:", @predicted_tmhs], ["Exp number of AAs in THMs:", @exp_aas_in_tmhs], ["Exp number, first 60 AAs:", @exp_first_60aa], ["Total prob of N-in:", @total_prob_of_N_in] ].map {|e| "\# " + [@entry_id, e].flatten.join("\t") }, tmhs.map {|ent| ent.to_s } ].flatten.join("\n") end |