#!/usr/bin/env ruby # you need install soap4r to run this program.Please make sure soap4r is installed. require 'soap/wsdlDriver' # read WSDL file wsdl = "http://www.bioinfo.tsinghua.edu.cn/~tigerchen/SubLoc.wsdl" # connect SOAP server serv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver serv.generate_explicit_type = true # if uncommented, you can see transactions for debug #serv.wiredump_dev = STDERR # name_search res = serv.name_search('p53') # get the number of matched entries print res.length # get each entry's content res.each do |each| print each["ID"] print each["OS"] print each["LC"] print each["CX"] print each["DE"] print each["SQ"] end #id_search res = serv.id_search("SWISSPROT","O03978") # get the number of matched entries print res.length # get each entry's content res.each do |each| print each["ID"] print each["OS"] print each["LC"] print each["CX"] print each["DE"] print each["SQ"] end res = serv.id_search("DBSubLoc","10043258") # get the number of matched entries print res.length # get each entry's content res.each do |each| print each["ID"] print each["OS"] print each["LC"] print each["CX"] print each["DE"] print each["SQ"] end # search by GO ID # Caution!Search by GO ID may return many many entries, please be patient, thanks #res = serv.id_search("GO","0005739") # get the number of matched entries print res.length # get each entry's content res.each do |each| print each["ID"] print each["OS"] print each["LC"] print each["CX"] print each["DE"] print each["SQ"] end #################### # blast_search seq="TKRFFNKNNRLNKGYAKTFSINEPDNNFYRKKFEHILPPVDLISEYESIYPGTLQELMHMAQKEQAHKHAIDLKNLKIQERIAKLTRICLLIFGIGLVVLIFLKLLK" res = serv.blast_search("all","full",seq,"1") # we provide two kinds of output formats: original BLAST output and parsed results by BioPerl's BPlite, users could choose one they like. #get the original output of BLAST program, you could use BioRuby to parse it quite easily. There are many example scripts on the Internet. print res["plain"] # or you can get the parsed result (using BioPerl's BPlite) # the parsed output's fields, every field is separated by a TAB. #HIT_NUM SCORE BITS PERCENT EXPECT SUBJECT_NAME IDENTITIES MATCH_LENGTH QUERY_START QUERY_END SUBJECT_START SUBJECT_END print res["parsed"] # the parsed output's fields #HIT_NUM SCORE BITS PERCENT EXPECT SUBJECT_NAME IDENTITIES MATCH_LENGTH QUERY_START QUERY_END SUBJECT_START SUBJECT_END ############### SubLoc prediction by SVM # for more details about the method, please see: #Hua, S. and Sun, Z. (2001). Support vector machine approach for protein subcellular localization prediction. Bioinformatics 17, 721-8. # for prokaryotic organisms seq="TKRFFNKNNRLNKGYAKTFSINEPDNNFYRKKFEHILPPVDLISEYESIYPGTLQELMHMAQKEQAHKHAIDLKNLKIQERIAKLTRICLLIFGIGLVVLIFLKLLK" pre= serv.pro_predict(seq) # get sequence #print pre["Seq"] # get predicted location print pre["Prediction"] print "\t" # get expected accuracy print pre["ExpectAcc"] print "\t" # get reliability index print pre["RI"] print "\t" # for eukaryotic organisms pre= serv.eu_predict(seq) # get sequence #print pre["Seq"] # get predicted location print pre["Prediction"] print "\t" # get expected accuracy print pre["ExpectAcc"] print "\t" # get reliability index print pre["RI"] print "\t" ###################################################################### ################# SubLoc prediction by PSORT # for more details about PSORT, please refer: # Nakai, K. and Horton, P. (1999). PSORT: a program for detecting sorting signals in proteins and # predicting their subcellular localization. Trends Biochem Sci 24, 34-6. pre= serv.psort_predict(seq) # get predicted location print pre["Prediction"] # get all output information of PSORT print pre["Detail"] ######################################################################## ################## Submit new entries by users ID="test" DE="pseudo-entry for test" OS="human" LC="cytoplasmic" CX="unknown" SQ="XXXXXXXXXXXXXXXXXX" feed = serv.feed_entry(ID,DE,OS,LC,CX,SQ) print feed