Class: Bio::SignalP::Version4::Result

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/bio/appl/signalp4.rb

Overview

The result of a SignalP program. Create using the output from -format short output and create_from_line()

Constant Summary collapse

@@output_fields =
[
                   :Cmax, :Cmax_position,
                   :Ymax, :Ymax_position,
                   :Smax, :Smax_position,
                   :Smean,
                   :D,
                   :prediction,
                   :Dmaxcut,
                   :networks_used,
]

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

#cleave, #to_bool

Class Method Details

.create_from_line(line) ⇒ Object

Create a new SignalpResult using a line from the signal p ‘short’ output format,



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/bio/appl/signalp4.rb', line 29

def self.create_from_line(line)
  # e.g.
  #$ ~/bioinfo/signalp-4.0/signalp /tmp/acp 
  ## SignalP-4.0 euk predictions
  ## name                     Cmax  pos  Ymax  pos  Smax  pos  Smean   D     ?  Dmaxcut    Networks-used
  #acp                        0.871  17  0.863  17  0.886   1  0.844   0.853 Y  0.450      SignalP-noTM
  matches = line.split(/[ \t]+/)
  if matches.length != Bio::SignalP::NUM_FIELDS_IN_VERSION4_SHORT_OUTPUT
    raise Exception, "Bad SignalP Short Line Found (#{matches.length}): '#{line}'"
  end
  
  i = 1
  result = Result.new
  result.Cmax = matches[i].to_f; i += 1
  result.Cmax_position = matches[i].to_i; i += 1
  result.Ymax = matches[i].to_f; i += 1
  result.Ymax_position = matches[i].to_i; i += 1
  result.Smax = matches[i].to_f; i += 1
  result.Smax_position = matches[i].to_i; i += 1
  result.Smean = matches[i].to_f; i += 1
  result.D = matches[i].to_f; i += 1
  result.prediction = result.to_bool matches[i]; i += 1
  result.Dmaxcut = matches[i].to_f; i += 1
  result.networks_used = matches[i]; i += 1
  
  return result
end

Instance Method Details

#cleavage_siteObject

Return the number of the residue after the cleavage site ie. the first residue of the mature protein Taken from the Y score, as it was decided this is the best prediction



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

def cleavage_site
  @Ymax_position
end

#signal?(clazz = self) ⇒ Boolean

Does it have a signal peptide? It can be this class (default), or another class that responds to :nn_D_prediction and :hmm_Sprob_prediction

Returns:

  • (Boolean)


59
60
61
# File 'lib/bio/appl/signalp4.rb', line 59

def signal?(clazz=self)
  return clazz.send(:prediction)
end