adding custom links per hit

Hi Simon,

Please accept my sincerest apologies for responding to your email after almost two months. Things were really hectic on my end.

We always had the ability to add custom links per hit, but we exposed a powerful, clean, public API only with today’s pre-release (https://groups.google.com/forum/#!topic/sequenceserver/vuuRHmqg6Y). It’s very simple:

  1. You create a .rb file defining function(s) that will return data from which the link will be constructed.
  2. Then get SequenceServer to load it using the -r cli switch or ‘require’ key in the config file.

We use the same API to generate ‘[View] Sequence’, ‘[Download] FASTA’, and ‘NCBI’ link and you can follow the same pattern to construct custom links for your own. Here’s the code - https://github.com/yannickwurm/sequenceserver/blob/master/lib/sequenceserver/links.rb

We also include a Uniprot link generator for the bundled fire and protein sequences to serve as a sample. You can find the code for that here - https://github.com/yannickwurm/sequenceserver/blob/master/spec/database/sample/links.rb

To test it, run:

$ cd sequenceserver
$ sequenceserver -d spec/database/sample -r spec/database/sample/links.rb

To create your own,

  1. Copy spec/database/sample/links.rb somewhere.
  2. Change uniprot method to suit your logic for generating links.
  3. Add more methods on the same lines.

I hope that helps. Let me know if any questions.

– Priyam