本文整理汇总了Python中SOAPpy.SOAPProxy.findPathwaysByXref方法的典型用法代码示例。如果您正苦于以下问题:Python SOAPProxy.findPathwaysByXref方法的具体用法?Python SOAPProxy.findPathwaysByXref怎么用?Python SOAPProxy.findPathwaysByXref使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SOAPpy.SOAPProxy
的用法示例。
在下文中一共展示了SOAPProxy.findPathwaysByXref方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetWikiPaths4IDs
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import findPathwaysByXref [as 别名]
def GetWikiPaths4IDs(idList,SC):
# Function that uses a list of IDs and a systm code as input and
# returns a string with all the WikiPathways where th IDs exist (including the new lines) as tab separated fields:
# No, ID, Species, Pathway ID, Pathway Name
# Load SOAPpy and dependent modules (fpconst) and access the remote
# SOAP server through a proxy class, SOAPProxy - see:
# (http://diveintopython.org/soap_web_services/first_steps.html)
from SOAPpy import SOAPProxy
url = 'http://www.wikipathways.org/wpi/webservice/webservice.php'
namespace = 'http://www.wikipathways.org/webservice'
server = SOAPProxy(url, namespace)
# Define the order of args: needed for this service
server.config.argsOrdering = {'findPathwaysByXref': ('ids', 'codes') }
index=1 # index of the result lines
print_output = '' # output of the function
# For each ID findPathwaysByXref (multiple args; returns list of dictionary references)
for gi in idList:
# checking any erors
try:
probeset_containing = server.findPathwaysByXref(codes=SC, ids=gi)
NoPaths = len(probeset_containing)
#Loops through a list of dictionary items if results
if NoPaths > 0 :
for object in probeset_containing:
#calls select dictionary keys to print out values
print_output += str(int(index))+'\t'+str(gi)+'\t'+str(object['species'])+'\t'+str(object['id'])+'\t'+str(object['name'])+'\n'
index+=1
else:
print gi, "can't be found in WikiPathways!"
except:
#pass # if error do nothing
print gi, 'has', NoPaths, 'pathways but it can be processed!'
return print_output
示例2: results
# 需要导入模块: from SOAPpy import SOAPProxy [as 别名]
# 或者: from SOAPpy.SOAPProxy import findPathwaysByXref [as 别名]
# Print out function for query results (see code below function first)
def printOutput(ws_output):
#Loops through a list of dictionary items
index=1
for object in ws_output:
#calls select dictionary keys to print out values
print_output = ' '+str(index)+')'+'species:'+object['species']+'\t '
print_output+= 'id:'+object['id']+'\t '+'name:'+object['name']
print print_output
index+=1
# Load SOAPpy and dependent modules (fpconst) and access the remote
# SOAP server through a proxy class, SOAPProxy - see:
# (http://diveintopython.org/soap_web_services/first_steps.html)
from SOAPpy import SOAPProxy
url = 'http://www.wikipathways.org/wpi/webservice/webservice.php'
namespace = 'http://www.wikipathways.org/webservice'
server = SOAPProxy(url, namespace)
# Define the order of args: needed for this service
server.config.argsOrdering = {'findPathwaysByXref': ('ids', 'codes') }
# findPathwaysByXref (multiple args; returns list of dictionary references)
sc = 'S'; gi = 'P00488'
probeset_containing = server.findPathwaysByXref(codes=sc, ids=gi )
print '\nPathways containing the gene ID "%s" for system code "%s"' % (gi,sc)
printOutput(probeset_containing)