[BioPython] Pise client

Catherine Letondal letondal at pasteur.fr
Fri Aug 29 10:16:38 EDT 2003


Hi,

The SAX parser (xml.sax.handler) that is used in the Pise/Python modules raises an 
exception, with some versions of this parser, when provided with a wrong url for the DTD.
Indeed, the url provided in Pise for the XHTML DTD has changed more or less recently.
So, it was quite impossible to use the Pise/Python module.
Thanks to Josh Cherry for having reported the bug.

Catherine Letondal wrote:
> 
> Hi,
> 
> I have written a Python package to run jobs on a Pise Web server from a python 
> program (Pise is a tool to generate user interfaces for programs running under Unix
> described here: http://www.pasteur.fr/recherche/unites/sis/Pise).
> 
> For example, the following script run a toppred job on a SeqRecord instance, displays
> the standard output of this job, and save the graphical output in a file. Sequences 
> or alignments can be input either as Seq, SeqRecord, files or just strings.
> 
> from Pise import PiseFactory
> import Bio.Fasta
> import sys
> 
> factory = PiseFactory(email='user at domain')
> program = factory.program("toppred",
>                           graph_output=1,
>                           profile_format="ps")
> 
> handle = open(sys.argv[1])
> it = Bio.Fasta.Iterator(handle, Bio.Fasta.SequenceParser())
> seq = it.next()
> 
> job = program.run(query=seq)
> 
> if job.error():
>       print job.error_message()
> else:
>       print "url of the job: " + job.jobid()
>       print job.stdout()
>       print "Results: ", job.get_results()
>       job.save('.ps')
> 
> 
> The package is available at: http://www.pasteur.fr/recherche/unites/sis/Pise/#pisepython
> 
> The package is organized in 4 main classes (the package is organized about the same 
> way as in the bioperl API in fact):
> 
>        PiseFactory
>        -----------
>        builds PiseApplication
>        instances
>        program()
>          |
>          |
>          v
> 
>        PiseApplication       PiseJob               PiseJobParser
>        ---------------       -------               -------------
>        object          -->   actual job            (an xml.sax.handler) to parse 
>        to set                (methods to           XHTML server output
>        parameters            actually submit  
>        and launch            the http request
>        jobs                  via httplib,
>                              get job state
>          |                   and results)
>          |
>        +----------------------------------------------+
>        | toppred fasta hmmbuild nnssp blast2 clustalw |
>        | genscan tacg dnapars wublast2 ...            |
>        |                                              |
>        +----------------------------------------------+
> 
> 
> I'm aware about the Bio.Application framework, but I have understood it's more for local
> run. For instance, AbstractCommandline would have been useful on a server, but
> there is no such thing in the client, which does not deal with command lines.
> It should be possible to wrap PiseApplication classes in Bio.Application classes though
> (and ApplicationResult sub-class could re-use PiseJob methods for instance).
> 
> 
> I have tried to put the minimum information in the numerous files that belongs to this
> package (there is a small file for each program, and there are about 287 programs). 
> 
> 
> I would be very happy to get some feedback about this code!
> 
> 


--
Catherine Letondal -- Pasteur Institute Computing Center


More information about the BioPython mailing list