2.6. CGI for helicases

Exercise 2.16. Submit an helicase

Write a CGI that submits a protein as an helicase. The CGI should return either a message telling that the protein is not an helicase, or if the protein is accepted as an helicase, an html-formatted output of the helicase data. Define a tohtml method in the Helicase class for this purpose. The output could look like this.

Exercise 2.17. Use a persistent Helicase DB

Write a dump method in the HelicaseDB class, that stores a persistent version of an Helicase object:
import helicase
... (load the database with a fasta file) ...
helicasedb.dump(sys.argv[2])
       
(the database will be stored into the file provided by sys.argv[2]). For this purpose, you can use either the pickle or the shelve module:
import shelve
data = shelve.open(filename)
data['key'] = an_object
data.close()
       

Exercise 2.18. Use a persistent Helicase DB (2)

Write a load_db function in the helicase module, that restores a persistent version of an Helicase object.
import helicase
helicasedb = helicase.load_db(sys.argv[1])
       
For this purpose, you can use either the pickle or the shelve module (use the same as in Exercise 2.17):
import shelve
data = shelve.open(filename)
an_object = data['key']
data.close()
       
From now on, you will use this function to load the helicases.

Exercise 2.19. Load the database

Submit the sequences from the following file: helicasesbig.fasta to your class, and stores the resulting HelicaseDB instance for later use.

Exercise 2.20. Fetch an helicase

Write a CGI that returns an helicase according to its ID. Use load_db function written in Exercise 2.18.

Exercise 2.21. Browse helicases

Write a CGI that returns a list of helicases IDs, classified by family. The HTML output should enable the user to click on the ID to get the corresponding helicase displayed. The output could look like this.

Exercise 2.22. Search helicases by keyword

Write a CGI that returns a list of helicases matching a keyword. You will need to add a search method in the HelicaseDB class. The output could look like this.