BACKGROUND
although there are many potential applications, we developed ontologywidget to help microarray researchers use ontologies and controlled vocabularies to describe and annotate their experiments.
using biomedical ontologies to annotate experimental designs, experimental variables and biological samples helps to achieve consistency, to provide the opportunity for complex searches and to allow computational access to the annotations.
however, in the process of annotating a single investigation, a researcher might require several large and complex ontologies.
for example, the ncbi taxonomy might be used to describe the organism used as the source of the biological sample being studied, while an anatomy ontology might be used to describe the tissue that was sampled.
because most experimental annotations are best provided by the researcher who conducted the experiments, and it is unlikely that bench biologists would have had the time to become power users of several ontologies, we wanted to provide an easier method to use ontologies that would be rapid and require no expert knowledge of the ontology.
thus, in an attempt to ease the experimental annotation process and decrease the burden of entering high-quality annotations, we developed the ontologywidget.
ontologywidget fulfilled our requirements to  provide a graphical, web-based tool,  have a fast auto-complete term search,  enable users to view and browse ontology structures,  provide a simple means to search more than one ontology,  provide the means of collecting ontology terms to post to another web page or to another program and  be deployed by our collaborators and others with a minimum of effort.
as of august  <dig>  there were  <dig> ontologies listed on the open biomedical ontologies web site  <cit> , describing biological concepts that range from development to anatomy to taxonomy to experimental approaches.
several tools already exist to search and browse ontologies, such as the amigo browser and the ontology lookup service  from the ebi.
the amigo browser  <cit>  is a web-based tool that allows a user to browse, query and visualize terms from any ontology formatted in the obo format.
it can be installed as a perl application, provides a normal text search as well as a convenient means to browse and explore trees.
however, amigo does not allow one to select terms that can then be posted to another web form, its installation is fairly complex, and it does not allow users to dynamically find terms within the ontology while typing.
the ontology lookup service  <cit>  from the ebi, which was published while this work was in progress, supports many of the same ontologies that we do and has similar browse and auto-complete features.
the ols also identifies the relationship type between terms, gives associated information and descriptions for the terms where available.
it fulfills many of our needs, except that is part of a much larger software package.
its installation has a large footprint requiring around  <dig> java jar files.
therefore, the ols did not fulfill one of our requirements, that it is easy for our collaborators to install and use on their websites.
thus, we developed the ontologywidget, which can be embedded in a web page in a relatively straightforward fashion, and used with other web-based annotation applications.
RESULTS
features of ontologywidget
an instance of the ontologywidget in a web page can be used to search and browse a single ontology, but multiple instances of the ontologywidget can also be embedded in a single web page, allowing a user to rapidly annotate a biological entity with terms from several ontologies using the same web page.
in addition, the ontologywidget can be configured to use only a specific subsection of an ontology, by specifying a particular node to be used as a root.
in the example provided in figure  <dig>  three different ontologies are presented to the user: part of the mged ontology  <cit> , the biological process portion of the gene ontology  <cit>  and the ncbi taxonomy  <cit> .
in figure  <dig>  both the mged ontology  and the gene ontology are shown with different terms presented as the root terms.
in the case of the mged ontology, we have limited the widget to use "biologicalproperty" as the root term.
thus, the top widget could be used to annotate one aspect of the experimental approach that was used, as this subgraph of mo lists various experimental designs.
limiting terms provides accuracy and ease of use – users will not accidentally enter terms that are incorrect for a given context.
we can also specify a default selection for the ontology terms in the cases where a single term is commonly used in many situations , and potential completions of the typed in phrase are displayed in the drop down menu.
in this case, potential completions of 'esch' from the ncbi taxonomy are shown.
at other times, it is important for a user to explore the context of an ontology term to determine if a different term  would be more accurate for the given annotation.
figure  <dig> shows a screenshot of the ontology tree browser being displayed after a user entered a term into the text box and then clicked on the "search" button.
in this case, the term "cellular metabolic process" is highlighted among a nested set of parent terms all the way up to the gene ontology's biological process term.
in this ontology browser display, children of a given node can either be revealed using the "+" icon or hidden using the "-" icon.
note that while the ontology tree browser display shows the direct path  from the root term to the input term, other child terms of other nodes within those paths are not displayed.
instead, a "..." icon is used to indicate that additional children exist for that parent node.
when the user clicks the "..." icon, all the immediate child terms are displayed and the "..." icon disappears.
the use of the "..." icon allows the initial ontology tree browser display to remain relatively uncluttered, and easier to understand and navigate.
at this time, the widget does not display the details or description of an ontology term.
we maintain this information in our database, and it is provided via our web services api, so future updates to our software will make it possible to dynamically provide this information.
ontologywidget has been tested on both macosx and windows xp, and is known to run successfully in safari  <dig> .
<dig>  firefox  <dig> .
<dig>  firefox  <dig> .
<dig> , opera  <dig> , and mozilla  <dig> .
<dig> on macosx, and internet explorer  <dig> and  <dig>  firefox  <dig> .
<dig>  and opera  <dig>  on windows xp.
implementation
the user-interface of the ontologywidget is written in javascript and html with its dynamic content delivered with ajax  technology.
on the server side, java servlets receive the user requests, submit queries to a database, and return xml to the javascript interface.
in order to provide access to the widget across internet domains and to circumvent cross-site scripting issues, either a client-side servlet stub  must be installed on the implementer's web server, or a reverse proxy web server must be created .
although the javascript files on the smd site that provide the ontologywidget user interface can simply be included via http in the html of the implementing web page, they are also available for download and local deployment through our web site  <cit> .
the .war file for deploying the proxy servlet, documentation, and a sample html file are also available at the same web site.
figure  <dig> depicts the overall system architecture, showing how the javascript and ontology web services residing on our system can be used by web pages hosted elsewhere.
once the implementing web server has apache tomcat  <cit>  successfully installed and operational, the second step to use ontologywidget is to install the ontologywidget tomcat servlet stub provided in the .war file.
the tomcat servlet stub provides computers outside of our domain with access to the smd ontology server.
this enables users to create their own html pages that will call our javascript program, which communicate with the ontology server.
the servlet stub should be installed in the client's tomcat instance in the webapps directory.
client user interface via html
to incorporate the ontologywidget on one's own web page, an html file must be created that correctly implements the ontologywidget.
detailed instructions for incorporating the ontologywidget into web pages are provided in the help documentation at our website, but here we briefly describe some of the necessary steps, and their purposes.
first, the html file must initialize the smdservice module .
second, the html file must define ontologywidget parameters, and third, the html file must provide page locations for each ontologywidget used on the page, and provide the hidden fields which report the data selected upon submission.
lastly, the url for the location of the servlet proxy must be defined.
in the <head> section of the html file, the seven javascript files, which construct the ontologywidget plus icon image files and a cascading style sheet, are defined by the reference to each javascript file in lines beginning <link> and <script >.
the tree in the annotation widget is built using yahoo's public domain user interface code for widgets  <cit> .
the second part of the <head> section contains five javascript functions that define the widgets, start the smdservice module, and manage the query threads.
when the page loads, the window.onload function, initiates an interval checker that manages query threads, and starts the smdservice module that makes a connection to the smd ontology web services.
an instance of an ontologywidget simply requires six pieces of data to be initialized:
• title that will be displayed on the ontologywidget
• ontology id
• ontology name
• term name
• label
• unique identifier for the instance of the ontologywidget in the html file
the title and label provide context both to the user and to the author of the html file.
because one can put multiple ontologywidgets on a single web page, the unique identifier  is needed to keep queries and data directed to the correct instance of the ontologywidget.
in the body of the html file, the form and the url of the widget's action function are defined.
within the html form element, the location of each ontologywidget instance is defined.
when the page is posted, that is when a post or submit button is clicked, these data associated with each widget instance  will be submitted via an implementer-written submit function.
as an illustration, the example html file included in the ontologywidget download contains an example submit function that simply reports these fields in a table.
smd ontology server
the smd ontology server comprises a package of java classes that receive http requests, query a database that contains the supported ontologies, format the data into xml and return the xml to the interface.
the simplest way to use the service is through the proxy servlet that we supply as a .war file.
using this simple method, the proxy servlet is installed within a tomcat server running on the implementer's server and the location of the servlet is referenced in all html pages that contain an instance of the ontologywidget.
our web serviceapplication programming interfaces  are available, should the implementer wish to create their own software to use our web services.
while we do not allow unrestricted programmatic access to our implementation because our database houses a lot of other data, the code can be obtained in the smd code release.
the smd ontology service is implemented as a servlet and responds to eight requests: getontologylist, getchildren, getparents, gettermsbyname, getrootterms, getterm, getancestors and getdescendents.
a complete api description is available on our website.
each request is processed by parsing the arguments, performing the database query necessary to fulfill the function, converting the query result into an xml string, and returning this string as the reply to the request.
since performance is a paramount issue for this application, the ontology service diverges from typical web services in that soap marshalling and unmarshalling software are not used.
these systems, while generally applicable, typically incur a large amount of overhead and a performance cost.
we discovered that our ontology schemas that flattened the data caused unreasonable performance response for the type-in suggestion box.
the performance hit was particularly evident when we were displaying a partial ontology.
all terms that were suggested matches had to fall within the subtree of the selected root term.
to address this problem, we have implemented a data caching scheme for the smd ontology service on the server side.
we created a data structure that holds all the paths from an ontology's root term to all its child terms.
we serialized the path data structure into a binary large object .
when tomcat starts, a context listener class is notified that reads the blobs from the database and holds the data in memory for rapid access.
thus, some queries to the smd ontology service do not need to query the database directly, resulting in a significant performance improvement.
CONCLUSIONS
ontologywidget is an easy-to-use ontology search and display tool that can be used on any web page.
implementers will be able to take advantage of over  <dig> ontologies provided by our smd ontology services and will not have to store or update their own copies of ontology data.
because implementers using ontologywidget can simply include the javascript stored on our system, they will be able to benefit from bug fixes and incremental enhancements that we deploy, without having to download and install updated software.
ontologywidget has already been implemented by collaborators maintaining the nih neuroscience microarray consortium website  <cit> .
as implemented there, ontologywidget is used to help researchers describe the anatomical regions used to generate samples from mammals.
availability and requirements
project name: the ontology widget;
project home page: ;
operating system: platform independent;
programming language: javascript, java, html; other requirements: tomcat  <dig>  or higher;
license: mit open source license;
a web page that demonstrates the ontologywidget can be accessed from the project's home page  <cit> .
this example page allows users to use ontologywidget to explore a small subset of the mged ontology, the biological_process section of the gene ontology and the entire ncbi taxonomy.
documentation about the software and the war file that needs to be installed can be accessed by visiting the project home page  <cit> .
although it is not necessary to download or install the javascript source files, they are also available from the project website  <cit> .
ontologywidget uses the mit open source license that permits anyone to use, re-use, edit or redistribute the software for any purpose, as long as attribution is given to the authors.
authors' contributions
ccb implemented the ontologywidget, wrote the documentation, provided the example files and contributed to the writing of the manuscript.
fw implemented the smd ontology service, created the .war file and helped troubleshoot throughout the project.
mn and zkz worked on the server side caching and optimization of the ontologywidget performance.
hj created software that enters ontologies from the obo site into smd.
jhps provided use cases and evaluated several versions of the developing software.
cab and gs created the software specifications, created the testing document, tested software throughout the project and contributed to the writing of the manuscript and help document.
all authors read and approved the final manuscript.

 although there are many potential applications, we developed ontologywidget to help microarray researchers use ontologies and controlled vocabularies to describe and annotate their experiments. using biomedical ontologies to annotate experimental designs, experimental variables and biological samples helps to achieve consistency, to provide the opportunity for complex searches and to allow computational access to the annotations. however, in the process of annotating a single investigation, a researcher might require several large and complex ontologies. for example, the ncbi taxonomy might be used to describe the organism used as the source of the biological sample being studied, while an anatomy ontology might be used to describe the tissue that was sampled. because most experimental annotations are best provided by the researcher who conducted the experiments, and it is unlikely that bench biologists would have had the time to become power users of several ontologies, we wanted to provide an easier method to use ontologies that would be rapid and require no expert knowledge of the ontology. thus, in an attempt to ease the experimental annotation process and decrease the burden of entering high-quality annotations, we developed the ontologywidget. ontologywidget fulfilled our requirements to provide a graphical, web-based tool, have a fast auto-complete term search, enable users to view and browse ontology structures, provide a simple means to search more than one ontology, provide the means of collecting ontology terms to post to another web page or to another program and be deployed by our collaborators and others with a minimum of effort. as of august there were ontologies listed on the open biomedical ontologies web site, describing biological concepts that range from development to anatomy to taxonomy to experimental approaches. several tools already exist to search and browse ontologies, such as the amigo browser and the ontology lookup service from the ebi. the amigo browser is a web-based tool that allows a user to browse, query and visualize terms from any ontology formatted in the obo format. it can be installed as a perl application, provides a normal text search as well as a convenient means to browse and explore trees. however, amigo does not allow one to select terms that can then be posted to another web form, its installation is fairly complex, and it does not allow users to dynamically find terms within the ontology while typing. the ontology lookup service from the ebi, which was published while this work was in progress, supports many of the same ontologies that we do and has similar browse and auto-complete features. the ols also identifies the relationship type between terms, gives associated information and descriptions for the terms where available. it fulfills many of our needs, except that is part of a much larger software package. its installation has a large footprint requiring around java jar files. therefore, the ols did not fulfill one of our requirements, that it is easy for our collaborators to install and use on their websites. thus, we developed the ontologywidget, which can be embedded in a web page in a relatively straightforward fashion, and used with other web-based annotation applications.  features of ontologywidget an instance of the ontologywidget in a web page can be used to search and browse a single ontology, but multiple instances of the ontologywidget can also be embedded in a single web page, allowing a user to rapidly annotate a biological entity with terms from several ontologies using the same web page. in addition, the ontologywidget can be configured to use only a specific subsection of an ontology, by specifying a particular node to be used as a root. in the example provided in figure three different ontologies are presented to the user: part of the mged ontology, the biological process portion of the gene ontology and the ncbi taxonomy. in figure both the mged ontology and the gene ontology are shown with different terms presented as the root terms. in the case of the mged ontology, we have limited the widget to use "biologicalproperty" as the root term. thus, the top widget could be used to annotate one aspect of the experimental approach that was used, as this subgraph of mo lists various experimental designs. limiting terms provides accuracy and ease of use – users will not accidentally enter terms that are incorrect for a given context. we can also specify a default selection for the ontology terms in the cases where a single term is commonly used in many situations, and potential completions of the typed in phrase are displayed in the drop down menu. in this case, potential completions of'esch' from the ncbi taxonomy are shown. at other times, it is important for a user to explore the context of an ontology term to determine if a different term would be more accurate for the given annotation. figure shows a screenshot of the ontology tree browser being displayed after a user entered a term into the text box and then clicked on the "search" button. in this case, the term "cellular metabolic process" is highlighted among a nested set of parent terms all the way up to the gene ontology's biological process term. in this ontology browser display, children of a given node can either be revealed using the "+" icon or hidden using the "-" icon. note that while the ontology tree browser display shows the direct path from the root term to the input term, other child terms of other nodes within those paths are not displayed. instead, a "..." icon is used to indicate that additional children exist for that parent node. when the user clicks the "..." icon, all the immediate child terms are displayed and the "..." icon disappears. the use of the "..." icon allows the initial ontology tree browser display to remain relatively uncluttered, and easier to understand and navigate. at this time, the widget does not display the details or description of an ontology term. we maintain this information in our database, and it is provided via our web services api, so future updates to our software will make it possible to dynamically provide this information. ontologywidget has been tested on both macosx and windows xp, and is known to run successfully in safari. firefox. firefox., opera, and mozilla. on macosx, and internet explorer and firefox. and opera on windows xp. implementation the user-interface of the ontologywidget is written in javascript and html with its dynamic content delivered with ajax technology. on the server side, java servlets receive the user requests, submit queries to a database, and return xml to the javascript interface. in order to provide access to the widget across internet domains and to circumvent cross-site scripting issues, either a client-side servlet stub must be installed on the implementer's web server, or a reverse proxy web server must be created. although the javascript files on the smd site that provide the ontologywidget user interface can simply be included via http in the html of the implementing web page, they are also available for download and local deployment through our web site. the.war file for deploying the proxy servlet, documentation, and a sample html file are also available at the same web site. figure depicts the overall system architecture, showing how the javascript and ontology web services residing on our system can be used by web pages hosted elsewhere. once the implementing web server has apache tomcat successfully installed and operational, the second step to use ontologywidget is to install the ontologywidget tomcat servlet stub provided in the.war file. the tomcat servlet stub provides computers outside of our domain with access to the smd ontology server. this enables users to create their own html pages that will call our javascript program, which communicate with the ontology server. the servlet stub should be installed in the client's tomcat instance in the webapps directory. client user interface via html to incorporate the ontologywidget on one's own web page, an html file must be created that correctly implements the ontologywidget. detailed instructions for incorporating the ontologywidget into web pages are provided in the help documentation at our website, but here we briefly describe some of the necessary steps, and their purposes. first, the html file must initialize the smdservice module. second, the html file must define ontologywidget parameters, and third, the html file must provide page locations for each ontologywidget used on the page, and provide the hidden fields which report the data selected upon submission. lastly, the url for the location of the servlet proxy must be defined. in the <head> section of the html file, the seven javascript files, which construct the ontologywidget plus icon image files and a cascading style sheet, are defined by the reference to each javascript file in lines beginning <link> and <script >. the tree in the annotation widget is built using yahoo's public domain user interface code for widgets. the second part of the <head> section contains five javascript functions that define the widgets, start the smdservice module, and manage the query threads. when the page loads, the window.onload function, initiates an interval checker that manages query threads, and starts the smdservice module that makes a connection to the smd ontology web services. an instance of an ontologywidget simply requires six pieces of data to be initialized: • title that will be displayed on the ontologywidget • ontology id • ontology name • term name • label • unique identifier for the instance of the ontologywidget in the html file the title and label provide context both to the user and to the author of the html file. because one can put multiple ontologywidgets on a single web page, the unique identifier is needed to keep queries and data directed to the correct instance of the ontologywidget. in the body of the html file, the form and the url of the widget's action function are defined. within the html form element, the location of each ontologywidget instance is defined. when the page is posted, that is when a post or submit button is clicked, these data associated with each widget instance will be submitted via an implementer-written submit function. as an illustration, the example html file included in the ontologywidget download contains an example submit function that simply reports these fields in a table. smd ontology server the smd ontology server comprises a package of java classes that receive http requests, query a database that contains the supported ontologies, format the data into xml and return the xml to the interface. the simplest way to use the service is through the proxy servlet that we supply as a.war file. using this simple method, the proxy servlet is installed within a tomcat server running on the implementer's server and the location of the servlet is referenced in all html pages that contain an instance of the ontologywidget. our web serviceapplication programming interfaces are available, should the implementer wish to create their own software to use our web services. while we do not allow unrestricted programmatic access to our implementation because our database houses a lot of other data, the code can be obtained in the smd code release. the smd ontology service is implemented as a servlet and responds to eight requests: getontologylist, getchildren, getparents, gettermsbyname, getrootterms, getterm, getancestors and getdescendents. a complete api description is available on our website. each request is processed by parsing the arguments, performing the database query necessary to fulfill the function, converting the query result into an xml string, and returning this string as the reply to the request. since performance is a paramount issue for this application, the ontology service diverges from typical web services in that soap marshalling and unmarshalling software are not used. these systems, while generally applicable, typically incur a large amount of overhead and a performance cost. we discovered that our ontology schemas that flattened the data caused unreasonable performance response for the type-in suggestion box. the performance hit was particularly evident when we were displaying a partial ontology. all terms that were suggested matches had to fall within the subtree of the selected root term. to address this problem, we have implemented a data caching scheme for the smd ontology service on the server side. we created a data structure that holds all the paths from an ontology's root term to all its child terms. we serialized the path data structure into a binary large object. when tomcat starts, a context listener class is notified that reads the blobs from the database and holds the data in memory for rapid access. thus, some queries to the smd ontology service do not need to query the database directly, resulting in a significant performance improvement.  ontologywidget is an easy-to-use ontology search and display tool that can be used on any web page. implementers will be able to take advantage of over ontologies provided by our smd ontology services and will not have to store or update their own copies of ontology data. because implementers using ontologywidget can simply include the javascript stored on our system, they will be able to benefit from bug fixes and incremental enhancements that we deploy, without having to download and install updated software. ontologywidget has already been implemented by collaborators maintaining the nih neuroscience microarray consortium website. as implemented there, ontologywidget is used to help researchers describe the anatomical regions used to generate samples from mammals. availability and requirements project name: the ontology widget; project home page:; operating system: platform independent; programming language: javascript, java, html; other requirements: tomcat or higher; license: mit open source license; a web page that demonstrates the ontologywidget can be accessed from the project's home page. this example page allows users to use ontologywidget to explore a small subset of the mged ontology, the biological_process section of the gene ontology and the entire ncbi taxonomy. documentation about the software and the war file that needs to be installed can be accessed by visiting the project home page. although it is not necessary to download or install the javascript source files, they are also available from the project website. ontologywidget uses the mit open source license that permits anyone to use, re-use, edit or redistribute the software for any purpose, as long as attribution is given to the authors. authors' contributions ccb implemented the ontologywidget, wrote the documentation, provided the example files and contributed to the writing of the manuscript. fw implemented the smd ontology service, created the.war file and helped troubleshoot throughout the project. mn and zkz worked on the server side caching and optimization of the ontologywidget performance. hj created software that enters ontologies from the obo site into smd. jhps provided use cases and evaluated several versions of the developing software. cab and gs created the software specifications, created the testing document, tested software throughout the project and contributed to the writing of the manuscript and help document. all authors read and approved the final manuscript. 
we have developed ontologywidget, an easy-to-use ontology search and display tool that can be used on any web page by creating a simple html description. we have developed a web service layer that communicates between the web page interface and a database of ontology terms. however, due to their size and complexity, annotating data with appropriate terms from an ontology is often challenging for experts and non-experts alike, because there exist few tools that allow one to quickly find relevant ontology terms to easily populate a web form. as a user enters characters into the search box, the appropriate ontology is queried remotely for terms that match the typed-in text, and the query results populate a drop-down list with all potential matches. we have produced a tool, ontologywidget, which allows users to rapidly search for and browse ontology terms. we have implemented web services at the stanford microarray database, which provide the ontologywidget with access to over ontologies from the open biological ontology website. adopters of the ontologywidget can either use smd's web services, or elect to rely on their own. deploying the ontologywidget can be accomplished in three simple steps: install apache tomcat on one's web server, download and install the ontologywidget servlet stub that provides access to the smd ontology web services, and create an html file that refers to the ontologywidget using a simple, well-defined format. ontologywidget can be used in any web-based application to take advantage of the ontologies we provide via web services or any other ontology that is provided elsewhere in the correct format. biomedical ontologies are being widely used to annotate biological data in a computer-accessible, consistent and well-defined manner.
 biomedical ontologies are being widely used to annotate biological data in a computer-accessible, consistent and well-defined manner. however, due to their size and complexity, annotating data with appropriate terms from an ontology is often challenging for experts and non-experts alike, because there exist few tools that allow one to quickly find relevant ontology terms to easily populate a web form.  we have produced a tool, ontologywidget, which allows users to rapidly search for and browse ontology terms. ontologywidget can easily be embedded in other web-based applications. ontologywidget is written using ajax and has two related elements. the first is a dynamic auto-complete ontology search feature. as a user enters characters into the search box, the appropriate ontology is queried remotely for terms that match the typed-in text, and the query results populate a drop-down list with all potential matches. upon selection of a term from the list, the user can locate this term within a generic and dynamic ontology browser, which comprises the second element of the tool. the ontology browser shows the paths from a selected term to the root as well as parent/child tree hierarchies. we have implemented web services at the stanford microarray database, which provide the ontologywidget with access to over ontologies from the open biological ontology website. each ontology is updated weekly. adopters of the ontologywidget can either use smd's web services, or elect to rely on their own. deploying the ontologywidget can be accomplished in three simple steps: install apache tomcat on one's web server, download and install the ontologywidget servlet stub that provides access to the smd ontology web services, and create an html file that refers to the ontologywidget using a simple, well-defined format.  we have developed ontologywidget, an easy-to-use ontology search and display tool that can be used on any web page by creating a simple html description. ontologywidget provides a rapid auto-complete search function paired with an interactive tree display. we have developed a web service layer that communicates between the web page interface and a database of ontology terms. we currently store of the ontologies from the obo website, as well as a several others. these ontologies are automatically updated on a weekly basis. ontologywidget can be used in any web-based application to take advantage of the ontologies we provide via web services or any other ontology that is provided elsewhere in the correct format. the full source code for the javascript and description of the ontologywidget is available from. 