BLAST to XML.

Previously SequenceServer BLASTed query sequences to HTML format. Subsequently
the HTML was parsed, using regular expressions, to get hit id and coordinates,
prettified and presented to the user. It was a nightmare to maintain and extend.

We now BLAST to XML, parse the XML using Ox -- a self contained, Ruby 1.8.7
compatible, fast XML parser -- to create an object representation of BLAST
results. Subsequently we render an ERb template to generate HTML report.

We are thus able to take fine-grained control over HTML report generated. To
begin with, we generate NCBI like HTML report. Later, we will make data from
BLAST result available in browser via data- attributes or JSON, thus paving way
for generating graphical overview and filtering of results based on e-value etc.

And the code feels manageable and extendable now.

[ap: commit message]

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Re-indent result.erb to use 2 spaces.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Enclose result for each query in a panel of its own.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Structured result navigation via index.

Index running of the bottom of the page when too many hits is handled crudely -
the idea is there, but needs very fine-grained polish.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Make navbar scrollable with the rest of the page.

Fixed navbar means all URL fragment accessible elements on the page must have
padding-top = height of the navbar or a part of that element will hide behind
navbar. Fixed navbar also means adjustment to affix and scrollspy. Persistent
navbar doesn't add value to the end users either. So made it scrollable with
the rest of the page.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Assign an id to the panel containing the hit.

Previously id was assigned only to the collapsible body of the panel containing
a hit. So clicking on the corresponding link in the index would jump to the hit,
but the hit def would be hidden.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
De-emphasise rest of hit def line over hit id.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
We don't want hit score in the header.

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

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Query#hits will now return an empty array if no hits found.

Thus ensuring that return value of Query#hits is always an array.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Move BLAST citation from results to footer.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Re-indent blast.rb to use 2 spaces.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Add Blast::Query#id and Blast::Query#meta.

id   -> FASTA id
meta -> everything in FASTA def line except id

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Rename Blast::Query#internal_id to Blast::Query#number, Blast::Hit#index to

Blast::Hit#number, and Blast::HSP#num to Blast::HSP#number. Thus making the
API more consistent.

Accordingly make changes to result.erb.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Slightly change id generation scheme in result.erb.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Remove format_blast_results method and code for custom hit hyperlinks.

These were outdated by recent changes, SHA: d377d3bc in particular. Custom hit
hyperlinks will be back. format_blast_results isn't needed anymore.

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

to_fasta was meant to add a def line to query sequence, if missing; and
uniquify query sequence ids by appending a number to duplicates.

Older versions of BLAST+ used to crash if query didn't have def line. BLAST+
2.2.25 (SequenceServer's minimum requirement) and higher handle missing def
line in query sequence gracefully. Thus adding def line to the query isn't
needed anymore.

Uniquification of query sequence ids came as a fix for #109. However, recent
changes (SHA: d377d3bc in particular ) obsoletes the fix. BLAST+ internally
numbers the query sequences 1, 2, 3, ..., n. Numbering done by BLAST+ is
available in XML output, on which our HTML result is now based. We use the
numbering done by BLAST+ to created unique HTML ids and thus index doesn't fail
anymore.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Lessen clutter in BLAST results.

* Use padding instead of boxes to lend structure to the content.
* Databases searched is now shown for each query. This my change further.
* Index of hits (SHA: 9c8d0229) adds limited value but introduces
  several complications. We will revert to tabular view of hits as before.

Unrelated: Refactored custom.css as it made the job easy.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Apply error class around query sequence textarea.

Had broken in SHA: 5ca85a2a.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Regression: Pre-select if only one database present.

Looks like this was broken for a very long time (SHA: db9f3dfc).

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