#!/usr/bin/perl -w use strict; use CGI qw(:standard); use NGD; ###################################################################### ###################################################################### # # This program displays a HTML form, allowing a user to enter the # terms for calculation of the NGD in a variety of ways and with # additional options, such as synonym search. # # NGD.pm is used as a utility module to provide an interface to # connect to the Google API and calc the NGD(s). # # The results are then displayed in a HTML table. # ##################################################################### ##################################################################### ############################## #Change Log ############################## # 20 May 2006 - Lucy # Removed synonym search ###################################################################### # # Nicely displays the distance matrix in a HTML table, when multiple # search terms are used. # ##################################################################### sub _displayTable($$$) { my ($firstTerms, $secondTerms, $results) = @_; print "
| "; foreach (@$secondTerms) { print " | $_ | "; } print "|
| ".$$firstTerms[$i]." | "; for (my $j = 0; $j < @$secondTerms; $j++) { if ( defined( $$results{$$firstTerms[$i].'-'.$$secondTerms[$j]}->{QueryString}) ) { print "{QueryString}."'>". $$results{$$firstTerms[$i].'-'.$$secondTerms[$j]}->{Distance}, " | "; } else { print "-- | "; } } print "
The distance for $term1 and $term2 is : $distance
"; $string .= "About these resultsNormalised Google Distances
This is a simplified version of a program I developed to measure the relationship between different terms using the Google search engine.
It will calculate the strength of a relationship based on the number of results returned by a Google search, feel free to experiment by entering some queries below (for example, try entering the terms 'horse' and 'rider' to discover their relationship). It uses the normlised google distance equation featured in this paper and was developed as part of a project during my bioinformatics masters course. Originally, it concentrated on mapping likely phenotypes to genes and was able to query a database of gene names to incorporate the synonyms of a gene name in the distance result, however it can also be applied more generally.
For more information about this software and the theory behind it, see here. If you experience any problems please read this.