dasmoth / dalliance

Interactive web-based genome browser.
http://www.biodalliance.org/
BSD 2-Clause "Simplified" License
226 stars 68 forks source link

More flexible search API #76

Open dasmoth opened 10 years ago

dasmoth commented 10 years ago

Browser.search is only really suitable as a hook for the Browser chrome. A final API should:

        - Return match data to the caller, rather than triggering immediate browser navigation.
        - Allow control of which track(s) are queried.
        - Provide better support for ambiguous matches.
moritzschaefer commented 6 years ago

Where is Browser.search documented?

dasmoth commented 6 years ago

Per the original message, the current Browser.search is fairly specifically a hook for the "genome browser chrome" core, rather than a flexible API for running arbitrary searches. I'm still interested in replacing/augmenting it.

If you're interested, the currrent API takes two parameters:

      - A search string
      - A callback that's invoked in case of error.

If there's an error or no matches, you'll get a message returned to the callback. Otherwise, the browser will interrogate all currently-active tracks which provide a search capability (in practice, generally bigBed tracks with extra indices), and navigate directly to the region matching the search query. The "direct navigation" aspect is annoying, hence interest in a new API which returns search results rather than triggering navigation.