class Bio::TargetP::Report
A parser and container class for TargetP
report.¶ ↑
Constants
- DELIMITER
Delimiter
- RS
Delimiter
Attributes
Returns 'included' or 'not included'. If the value is 'included', Bio::TargetP::Report#prediction['TPlen']
contains a valid value.
Returns a Hash of cutoff values.
Returns “PLANT'' or “NON-PLANT'' networks.
Returns a Hash of the prediction results.
{“Name”=>“MGI_2141503”, “Loc.”=>“_”, “RC”=>3, “SP”=>0.271,
"other"=>0.844, "mTP"=>0.161, "cTP"=>0.031, "Length"=>640}
Keys: Name, Len, SP, mTP, other, Loc, RC Optional key for PLANT networks: cTP Optional key in Cleavage site: TPlen
Use 'Length' and 'Loc.' instead of 'Len' and 'Loc' respectively for the version 1.0 report.
Returns a Hash of the prediction results.
{“Name”=>“MGI_2141503”, “Loc.”=>“_”, “RC”=>3, “SP”=>0.271,
"other"=>0.844, "mTP"=>0.161, "cTP"=>0.031, "Length"=>640}
Keys: Name, Len, SP, mTP, other, Loc, RC Optional key for PLANT networks: cTP Optional key in Cleavage site: TPlen
Use 'Length' and 'Loc.' instead of 'Len' and 'Loc' respectively for the version 1.0 report.
Returns the query sequences.
Returns the program version.
Public Class Methods
Sets output report.
# File lib/bio/appl/targetp/report.rb 63 def initialize(str) 64 @version = nil 65 @query_sequences = nil 66 @cleavage_site_prediction = nil 67 @networks = nil 68 @prediction = {} 69 @cutoff = {} 70 parse_entry(str) 71 end
Public Instance Methods
Returns the predicted localization signal:
-
S (Signal peptide)
-
M (mTP)
-
C (cTP)
-
*
-
_
# File lib/bio/appl/targetp/report.rb 97 def loc 98 if @prediction['Loc'] 99 @prediction['Loc'] # version 1.0 100 else 101 @prediction['Loc.'] # version 1.1 102 end 103 end
Returns the name of query sequence.
# File lib/bio/appl/targetp/report.rb 76 def name 77 @prediction['Name'] 78 end
Returns length of query sequence.
# File lib/bio/appl/targetp/report.rb 82 def query_len 83 if @prediction['Len'] 84 @prediction['Len'] 85 else 86 @prediction['Length'] 87 end 88 end
Returns RC.
# File lib/bio/appl/targetp/report.rb 106 def rc 107 @prediction['RC'] 108 end
Private Instance Methods
# File lib/bio/appl/targetp/report.rb 113 def parse_entry(str) 114 labels = [] 115 cutoff = [] 116 values = [] 117 118 str.split("\n").each {|line| 119 case line 120 when /targetp v(\d+.\d+)/,/T A R G E T P\s+(\d+.\d+)/ 121 @version = $1 122 123 when /Number of (query|input) sequences:\s+(\d+)/ 124 @query_sequences = $1.to_i 125 126 when /Cleavage site predictions (\w.+)\./ 127 @cleavage_site_prediction = $1 128 129 when /Using (\w+.+) networks/ 130 @networks = $1 131 when /Name +Len/ 132 labels = line.sub(/^\#\s*/,'').split(/\s+/) 133 134 when /cutoff/ 135 cutoff = line.split(/\s+/) 136 cutoff.shift 137 labels[2, 4].each_with_index {|loc, i| 138 next if loc =~ /Loc/ 139 @cutoff[loc] = cutoff[i].to_f 140 } 141 when /-----$/ 142 when /^ +$/, '' 143 else 144 values = line.sub(/^\s*/,'').split(/\s+/) 145 values.each_with_index {|val, i| 146 label = labels[i] 147 case label 148 when 'RC', /Len/ 149 val = val.to_i 150 when 'SP','mTP','cTP','other' 151 val = val.to_f 152 end 153 @prediction[label] = val 154 } 155 end 156 } 157 end