Graphical overview of blast hits.

This patch adds the graphical overview feature to SequenseServer,
thereby allowing easy inspection of query hits and navigation. The
design is inspired by NCBI's Blast page and further improved upon for
better clarity.

 * A color gradient is used to indicate the importance of hits obtained.
 * Query sequence shown on top in thin red bar to indicate scale.
 * Hits are sorted and displayed according to increasing evalues.

...

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Adding strandedness of hits using arrow caps.

We add the strandedness of hits based on the value obtained from hframe.

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Can handle more than one hsp per hit.

* This patch fixes the earlier loophole which showed only one HSP per hit
  query.
* A critical bug causing only one query to show up in case of
  multi query blast with similar ID's was fixed.
* result.erb now incorporates the changes required to show multiple hsps
  per hit. However, a little formatting fixes might occur later.

[ap: re-indent to two spaces instead of four]

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Resinstate tabular view of alignments

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Removed extra decimal digits in E value

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Moved total score and min evalue computation to blast.rb

[ap: indentation fixes]

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Can show multiple HSP(s) in overview graph.

* Changes to blast.rb which carry out the conversion of parsed strings
  suitable number formats. Removes to_i kind of code for result.erb.
* Can now display all HSP(s) per hit in overview graphic. The color for
  HSP(s) remain same, and we follow the same gradient display scheme as
  before.

[ap: indentation fixes]

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Revert: Accession no, Remove: defline from tabular view.

Also, changed the display color of hits to follow grey gradient than
blue. Legend/Key is now well spaced from other hit boxes. Arrow caps
are functional as before, though not very pretty in cases when hsps are
very close.

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Change semantics of the BLAST wrapper.

SequenceServer::Blast is now a module meant to be mixed with
SequenceServer::App.

Do BLAST param validation in blast.rb.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Request user to report 500 errors to admin or forum; remove not_found handler.

Any runtime error unless specifically handled is trapped as internal server
error (500) by SS and shown to the user with the full backtrace, requesting
them to report it to the admin of the SS installation or the public forum.

Removed not_found handler since it depended on 500.erb which I tweaked
specifically for 500 (internal server) errors.  Sinatra, in production, shows a
page with heading (and only a heading) "No Found" for 404 errors which is
almost as good as what we previously had.  We can install a more helpful 400
page later.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Inform users about network and server timeout errors.

Timeout or network errors previously appeared to the user as "a flicker of
spinner followed by no results or an empty modal", leaving them to figure
out for themselves what exactly happened. Not good.

Detecting timeout errors is tricky. We can be sure that the response will be
empty if server timed-out. But empty response can be caused due to myriad of
network issues.

So we check for empty response and notify users that either the server timed
out (and hence she should contact admin), or there's a temporary network issue
(and hence she should try again later). As a laster resort, the user should
seek help on the forum.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Round off bit score during display.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Pretty print evalue and right align numbers in tabular view.

Numbers look better when right aligned.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>