Skip to main content
Figure 5 | Source Code for Biology and Medicine

Figure 5

From: Inmembrane, a bioinformatic workflow for annotation of bacterial cell-surface proteomes

Figure 5

An example of interfacing with the BOMP ß-barrel outer membrane protein predictor (Berven et al., 2004) web site using twill on the Python interactive commandline. twill essentially behaves like a headless web-browser. Lines with >>> denote inputs to the Python interactive command line, while other lines are output from twill (1) First the appropriate commands from the twill library are imported. (2) We navigate to the BOMP website, which silently downloads the HTML page and (3) show a summary of the forms on that page, including field names and input types. (4) We then use the formfile function to associate a local file with the queryfile FILE input field. Calling submit() (5) is equivalent to clicking the SUBMIT button defined in the form. After a short delay, an intermediate page is returned, and we can list the hyperlinks on this page using (6) showlinks(), and assign them to a variable (links, a Python list). We can then navigate to the appropriate result page (7) and assign the HTML text of this page to a variable (out) (8) for downstream parsing using BeautifulSoup. This type of interactive exploration can be easily expanded into an inmembrane plugin to programmically interface with the web service.

Back to article page