Class: Bio::TargetP::Report

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

Overview

A parser and container class for TargetP report.

Constant Summary collapse

DELIMITER =

Delimiter

"\n \n"
RS =

Delimiter

DELIMITER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Report

Sets output report.



63
64
65
66
67
68
69
70
71
# File 'lib/bio/appl/targetp/report.rb', line 63

def initialize(str)
  @version                  = nil
  @query_sequences          = nil
  @cleavage_site_prediction = nil
  @networks                 = nil
  @prediction               = {}
  @cutoff                   = {}
  parse_entry(str)
end

Instance Attribute Details

#cleavage_site_predictionObject (readonly)

Returns 'included' or 'not included'. If the value is 'included', Bio::TargetP::Report#prediction contains a valid value.



41
42
43
# File 'lib/bio/appl/targetp/report.rb', line 41

def cleavage_site_prediction
  @cleavage_site_prediction
end

#cutoffObject (readonly)

Returns a Hash of cutoff values.



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

def cutoff
  @cutoff
end

#networksObject (readonly)

Returns “PLANT'' or “NON-PLANT'' networks.



44
45
46
# File 'lib/bio/appl/targetp/report.rb', line 44

def networks
  @networks
end

#predictionObject (readonly) Also known as: pred

Returns a Hash of the prediction results.

“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.



57
58
59
# File 'lib/bio/appl/targetp/report.rb', line 57

def prediction
  @prediction
end

#query_sequencesObject (readonly)

Returns the query sequences.



36
37
38
# File 'lib/bio/appl/targetp/report.rb', line 36

def query_sequences
  @query_sequences
end

#versionObject (readonly)

Returns the program version.



33
34
35
# File 'lib/bio/appl/targetp/report.rb', line 33

def version
  @version
end

Instance Method Details

#locObject

Returns the predicted localization signal:

  1. S (Signal peptide)

  2. M (mTP)

  3. C (cTP)

  4. *

  5. _



97
98
99
100
101
102
103
# File 'lib/bio/appl/targetp/report.rb', line 97

def loc
  if @prediction['Loc'] 
    @prediction['Loc']   # version 1.0
  else
    @prediction['Loc.']  # version 1.1
  end
end

#nameObject Also known as: entry_id

Returns the name of query sequence.



76
77
78
# File 'lib/bio/appl/targetp/report.rb', line 76

def name
  @prediction['Name']
end

#query_lenObject Also known as: length

Returns length of query sequence.



82
83
84
85
86
87
88
# File 'lib/bio/appl/targetp/report.rb', line 82

def query_len
  if @prediction['Len']
    @prediction['Len']
  else
    @prediction['Length']
  end
end

#rcObject

Returns RC.



106
107
108
# File 'lib/bio/appl/targetp/report.rb', line 106

def rc
  @prediction['RC']
end