Autocomplete widget for gene query

This Autocomplete widget for gene query provides suggestions while you type a gene symbol or name into the field. Here the gene suggestions are displayed as "<Symbol>:<Name>", automatically triggered when at least two characters are entered into the field.

This widget is powered by "mygene.info" web service. By default, the gene suggestions are limited to human genes only. We will enable more customization options to allow queries against other species soon.

To use this widget in your own website is very easy, just following these three steps:

  1. Copy/paste this line into your html file.
  2.                 <script src="//mygene.info/widget/autocomplete/js/mygene_query_min.js" type="text/javascript"></script>
                
  3. Add "mygene_query_target" class to your target input element.
  4.                 <input id="gene_query" style="width:250px" class="mygene_query_target">
                
  5. Define your own callback function, which is triggered after user selects a gene.
  6.                 <script type="text/javascript">
                        mygene_query_select_callback = function(event, ui){
                                alert( ui.item ?
                                    "Selected: " + ui.item.label + '('+ui.item._id+')':
                                    "Nothing selected, input was " + this.value);
                        };
                    </script>