Change semantics of the BLAST wrapper.

SequenceServer::Blast is now a module meant to be mixed with
SequenceServer::App, and takes full responsibility of BLAST.

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>
Re-instate sequence retrieval.

We provide a link to FASTA for each hit like before. But we don't provide a
link to FASTA for all hits like before. Instead, we provide a link to FASTA
of all hits per query now.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Send Blast::Report instance to result.erb.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Use database id to construct sequence retrieval link.

Database id is almost always shorter than absolute path to BLAST database name.
This reduces the size of sequence retrieval URLs.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Display retrieved sequences in GenBank style.

And overall polish to the UI of sequence retrieval and code.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Minor refactoring of index generation code

... with the aim of resolving slow scrolling in Chrome (which didn't work out).

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Limit index entires to 30 chars.

Rest is shown in tooltip.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Fixed precision issue in HSPs.

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Fixed critical bug showing qend, send erroneously

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Disable download button when no sequences

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Fix for when no hits found.

Broke in SHA: cc4295a1.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Alias Hit#length and HSP#length to Hit#len and HSP#len respectively.

Thus fixing incorrect display of hit length in BLAST results.

Hit#length and HSP#length would otherwise delegate to Struct#length, giving
unexpected results.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Remove G+ script.

Removed G+ button in SHA: 5ca85a2, but forgot to remove the script.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Add HTML5 shive for IE 8 and below.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Randomise what to Tweet.

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

Previously SequenceServer would assume 1 thread if num_threads wasn't set, or
set incorrectly in the config file. I think we should use a default value only
if one wasn't provided by the user. If the user explicitly sets a configuration
value, and it's incorrect, we should alert the user instead. Additionally, we
warn the user if num_threads is greater than 256.

Explicit validation caught an error in our code where num_threads, if not set
in config file, was assumed to be 0 in Ruby 1.8.7.

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