[MOBY-guts] biomoby commit

Yan Wong yanwong at pub.open-bio.org
Wed Dec 8 14:53:40 UTC 2004


yanwong
Wed Dec  8 09:53:40 EST 2004
Update of /home/repository/moby/moby-live/Python/tutorials/webservices
In directory pub.open-bio.org:/tmp/cvs-serv29748

Added Files:
	Clustalw-mod_python.py Clustalw.py blastpgp.py wsStride.py 
Log Message:

wsStride is an example of wrapping Stride as a webservice:


to query it, just give a PDB id like namespace="PDB" id="1AKQ"
the service queries the PDB and calculate stride with it

moby-live/Python/tutorials/webservices Clustalw-mod_python.py,1.2,1.3 Clustalw.py,1.2,1.3 blastpgp.py,NONE,1.1 wsStride.py,NONE,1.1
===================================================================
RCS file: /home/repository/moby/moby-live/Python/tutorials/webservices/Clustalw-mod_python.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Python/tutorials/webservices/Clustalw-mod_python.py	2004/12/08 11:15:31	1.2
+++ /home/repository/moby/moby-live/Python/tutorials/webservices/Clustalw-mod_python.py	2004/12/08 14:53:40	1.3
@@ -36,7 +36,11 @@
     d=Dispatcher(mobyContent, LocalInvocator, _toParameters)
     
     return d.execute()
-    
+
+from ZSI import dispatch
+from mod_python import apache
+from bioMoby.webservice import TCBioMoby
+
 def handler(req):
 	if req.method=='GET':
 		if req.args=='wsdl':
@@ -50,6 +54,6 @@
 				req.write("<html><head><title>Clustalw</title></head><body>Clustalw</body></html>")
 
 	else:
-		dispatch.AsHandler(modules=(Clustalw,),request=req)
+		dispatch.AsHandler(modules=(Clustalw,),request=req, typesmodule=TCBioMoby)
 
 	return apache.OK

===================================================================
RCS file: /home/repository/moby/moby-live/Python/tutorials/webservices/Clustalw.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Python/tutorials/webservices/Clustalw.py	2004/12/08 11:15:31	1.2
+++ /home/repository/moby/moby-live/Python/tutorials/webservices/Clustalw.py	2004/12/08 14:53:40	1.3
@@ -31,12 +31,21 @@
             
     return (commandName, " type=p -align "+" ".join(parameters), tempfiles, outputfiles)
     
+def ClustalFormatter(results):
+    def ClustalFormatter(results):
+    """Return the results in a MobyClustalAlnFormattedText object
+    """
+    from bioMoby import MobyClustalAlnFormattedText
+    
+    return [MobyClustalAlnFormattedText(content=results)]
+    
 def clustalw(mobyContent):
     from bioMoby import Dispatcher, LocalInvocator
     
-    d=Dispatcher(mobyContent, LocalInvocator, commandBuilder)
+    d=Dispatcher(mobyContent, LocalInvocator, commandBuilder, formatter=ClustalFormatter)
     
     return d.execute()
     
 from ZSI import dispatch
-dispatch.asCGI()
\ No newline at end of file
+from bioMoby.webservice import TCBioMoby
+dispatch.asCGI(typesmodule=TCBioMoby)




More information about the MOBY-guts mailing list