| Class | Bio::PTS1 |
| In: |
lib/bio/appl/pts1.rb
|
| Parent: | Object |
Bio::PTS1 class is a client of the PTS1 predictor.
require 'bio'
sp = Bio::SPTR.new(Bio::Fetch.query("sp", "p53_human"))
faa = sp.seq.to_fasta(sp.entry_id)
pts1 = Bio::PTS1.new
report = pts1.exec_remote(faa)
report.output #=> "<HTML>\n<HEAD><TITLE>PTS1 Prediction Server ..."
report.prediction #=> "Not targeted"
report.cterm #=> "KLMFKTEGPDSD"
report.score #=> "-79.881"
report.fp #=> "67.79%"
report.sppta #=> "-1.110"
report.spptna #=> "-41.937"
report.profile #=> "-36.834"
| FUNCTION | = | { 'METAZOA-specific' => 1, 'FUNGI-specific' => 2, 'GENERAL' => 3, } | Organism specific parameter value: function names. |
| function | [R] | Used function name (Integer). function_name = Bio::PTS1::FUNCTION.find_all {|k,v| v == pts1.function }[0][0] |
| output | [R] | Output report. |
Constructs Bio::PTS1 web service client.
serv_default_metazoa_specific = Bio::PTS1.new
serv_general_function = Bio::PTS1.new('GENERAL')
serv_fungi_specific = Bio::PTS1.new(2) # See Bio::PTS1::FUNCTION.
# File lib/bio/appl/pts1.rb, line 96
96: def initialize(func = 'METAZOA-specific')
97: @host = "mendel.imp.ac.at"
98: @cgi_path = "/sat/pts1/cgi-bin/pts1.cgi"
99: @output = nil
100: @function = function(func)
101: end
Short-cut for Bio::PTS1.new(Bio::PTS1::FUNCTION[‘FUNGI-specific’])
# File lib/bio/appl/pts1.rb, line 78
78: def self.new_with_fungi_function
79: self.new('FUNGI-specific')
80: end
Short-cut for Bio::PTS1.new(Bio::PTS1::FUNCTION[‘GENERAL’])
# File lib/bio/appl/pts1.rb, line 83
83: def self.new_with_general_function
84: self.new('GENERAL')
85: end
Short-cut for Bio::PTS1.new(Bio::PTS1::FUNCTION[‘METAZOA-specific’])
# File lib/bio/appl/pts1.rb, line 73
73: def self.new_with_metazoa_function
74: self.new('METAZOA-specific')
75: end
Executes the query request and returns result output in Bio::PTS1::Report. The query argument is available both aSting in fasta format text and aBio::FastaFormat.
require 'bio'
pts1 = Bio::PTS1.new
pts1.exec(">title\nKLMFKTEGPDSD")
pts1.exec(Bio::FastaFormat.new(">title\nKLMFKTEGPDSD"))
# File lib/bio/appl/pts1.rb, line 146
146: def exec(query)
147: seq = set_sequence_in_fastaformat(query)
148:
149: @form_data = {'function' => @function.values.join(''),
150: 'sequence' => seq.seq,
151: 'name' => seq.definition }
152: @uri = URI.parse(["http:/", @host, @cgi_path].join('/'))
153:
154: result = Bio::Command.post_form(@uri, @form_data)
155: @output = Report.new(result.body)
156:
157: return @output
158: end
Sets and shows the function parameter.
Organism specific parameter: function names (Bio::PTS1::FUNTION.keys).
# sets function name parameter.
serv = Bio::PTS1.new
serv.function('METAZOA-specific')
# shows function name parameter.
serv.function #=> "METAZOA-specific"
# File lib/bio/appl/pts1.rb, line 118
118: def function(func = nil)
119: return @function.keys.join('') if func == nil
120:
121: if FUNCTION.values.include?(func)
122: @function = Hash[*FUNCTION.find {|x| x[1] == func}]
123: elsif FUNCTION[func]
124: @function = {func => FUNCTION[func]}
125: else
126: raise ArgumentError,
127: "Invalid argument: #{func}",
128: "Available function names: #{FUNCTION.keys.inspect}"
129: end
130: @function
131: end