The HGNC Database Download script serves as a front end for a PostgreSQL database it provides a web-based interface which will allow users to select columns of data for output, execute limited SQL queries and save searches for future reference
Bookmark Title: field allows you to name any HTML table the script generates
- Select columns to display from the checkboxes at the top of the page, or select a predefined set using the Column presets pulldown menu (see Column definitions for more information about what the columns represent).
- Select Status to be displayed
- Approved - these genes have HGNC-approved gene symbols
- Approved non-human - these entries have been approved in order to maintain the orthologous symbol in the human gene family series. It is quite likely that most of these genes will ultimately be found in the human genome
- Entry withdrawn - these previously approved genes are no longer thought to exist
- Select Chromosomes to display data on (if no individual chromosomes are selectd all chromosomes are displayed (ie 'Select all Chromosomes' is the default setting)
- 'reserved' are symbols we have not publicly associated with a chromosome location.
- The WHERE field enables you to specify an SQL query see Pattern Matching and also the Postgres Documentation for more information
- ORDER BY sets which column is used to order the data (this defaults to Approved Symbol)
- LIMIT takes an interger and restricts the number of lines returned by the script
- Output format specifies how the data is displayed
- Text displays the data as a tab delimited text file (Misc IDs are returned as HTML links to indicate which database they came from) Example
- HTML displays the data in an HTML table with some hyperlinks to other databases Example
- Show SQL displays the SQL query without executing it (this is a useful debugging option when using the WHERE field) Example
- Make PHP code (HTML) generates a fragment of PHP code which allows the HTML table to be embedded in any PHP document on any web server (see Embedding tables into PHP below) Example
- Make PHP code (Gene Report) similar to Make PHP code (Gene Report) except it uses the Gene Report table format (see below) for display
- Make perl code generates a short perl program that uses LWP simple to download a text version of the selected data Example
- Gene Report table this is a compact table showing the main details from a gene record Example
On submission this form is replaced by the script output; if you bookmark that page every time you return to it the search is rerun and the new output displayed. The Bookmark Title field allows any HTML table the script generates to be given a name (which will be picked up by your browser if the page is bookmarked.
If you want to change the column order in the HTML or Text outputs this can be done by directly editing the URL, the order of the 'col' parameters in the URL defines the column order. If a column is required more than once simply add an extra col parameter.
Embedding tables into PHP
Assuming your server supports PHP, create a page using .php instead of .html or .htm, copy paste in the output from 'Make PHP code' into the document
<html><body>
<table border="1">
<tr><th>HGNC ID</th> <th>Approved Symbol</th> <th>Approved Name</th> <th>Status</th> <th>Locus Type</th></tr>
<?php
$url = "http://www.genenames.org/cgi-bin/hgnc_downloads.cgi?".
"title=Genew%20output%20data&col=gd_hgnc_id&col=gd_app_sym&col=gd_app_name&col=gd_status&".
"col=gd_locus_type&status=Approved&=on&where=&".
"order_by=gd_app_sym_sort&status_opt=3&limit=20&format=include&submit=submit&".
".cgifields=status&.cgifields=&.cgifields=chr"
include("$url")
?>
</table></body></html>
Future development
- The URLs generated by the program are much too long, these could be shrunk using tinyurl.com or a similar service however; ultimately I'll sort out storing queries locally so they can be rerun via an ID number.
- Since the data returned is defined by the saved URL, text outputs will remain stable. The HTML format will only change to keep the URLs up-to-date. The Gene Report table will maintain its general layout but I will add new fields and links to it as they become available.