Class: Bio::TMHMM::Report

Inherits:
Object show all
Defined in:
lib/bio/appl/tmhmm/report.rb

Overview

TMHMM report parser class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry = nil) ⇒ Report

Returns a new instance of Report.



83
84
85
86
# File 'lib/bio/appl/tmhmm/report.rb', line 83

def initialize(entry = nil)
  parse_header(entry)
  @tmhs = parse_tmhs(entry)
end

Instance Attribute Details

#entry_idObject (readonly)

Returns



63
64
65
# File 'lib/bio/appl/tmhmm/report.rb', line 63

def entry_id
  @entry_id
end

#exp_aas_in_tmhsObject (readonly)

Returns



72
73
74
# File 'lib/bio/appl/tmhmm/report.rb', line 72

def exp_aas_in_tmhs
  @exp_aas_in_tmhs
end

#exp_first_60aaObject (readonly)

Returns



75
76
77
# File 'lib/bio/appl/tmhmm/report.rb', line 75

def exp_first_60aa
  @exp_first_60aa
end

#predicted_tmhsObject (readonly)

Returns



69
70
71
# File 'lib/bio/appl/tmhmm/report.rb', line 69

def predicted_tmhs
  @predicted_tmhs
end

#query_lenObject (readonly) Also known as: length

Returns



66
67
68
# File 'lib/bio/appl/tmhmm/report.rb', line 66

def query_len
  @query_len
end

#tmhsObject (readonly)

Returns an Array of Bio::TMHMM::TMH.



60
61
62
# File 'lib/bio/appl/tmhmm/report.rb', line 60

def tmhs
  @tmhs
end

#total_prob_of_N_inObject (readonly)

Returns



78
79
80
# File 'lib/bio/appl/tmhmm/report.rb', line 78

def total_prob_of_N_in
  @total_prob_of_N_in
end

Instance Method Details

#helixObject

Returns an Array of Bio::TMHMM::TMH including only “TMhelix”.



89
90
91
# File 'lib/bio/appl/tmhmm/report.rb', line 89

def helix
  @tmhs.map {|t| t if t.status == 'TMhelix' }.compact
end

#to_sObject



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/bio/appl/tmhmm/report.rb', line 94

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