|
Perl/SQL Practical Exercise
You should now be familiar enough with Perl to parse input (from the keyboard
or from files) and process the input to do some work. You should also be familiar
with how SQL (and databases) work.
In this exercise, you will read in a list of genes with accession number from
different organisms. You will then add the accession numbers and gene descriptions
to a database.
The list of genes can be found in /users/golharam/courses/5004/triples.id.
First, create a table in mySQL. The table will contain the gene descriptions
and the accession numbers from the organisms that correspond
to the description.
Next, write a perl script that will read in the file and populate the mySQL
table with the information from the file. Note, that your perl script should
take the input file as a command-line parameter.
Write a perl script that allows the user to enter an accession number and list the
gene description that contains the accession and associated accessions.
Create a web page that allows
a user to input an accession and list the gene description that contains the accession and assocaited accesions.
For the homework, you will hand in the statements you used to create the SQL
tables, the perl script to populate the tables, and the perl script to query
the database, the html file, the cgi script used for searching.
For example,
if the user types in "AF188842, the output should look like:
8. platelet-derived growth factor receptor alpha
[C:AF188842] [H:M21574] [M:M84607]
As an extra credit exercise, modify the search to allow the user to enter a keyword. Using this keyword you can search for the gene description. For example, if the user enters "growth factor", you should see the same output above as if the user typed in "AF188842". |