Class: SequenceServer::BLAST::Formatter
- Inherits:
-
Object
- Object
- SequenceServer::BLAST::Formatter
- Extended by:
- Forwardable
- Defined in:
- lib/sequenceserver/blast/formatter.rb
Overview
Formatter is invoked during report generation or for results download to convert BLAST+ archive file to other formats. Formatter generates output in Job#dir. Output files persist till the job itself is deleted. Calling Formatter a second time (for the same input job and output format) will return saved ouput.
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#mime ⇒ Object
readonly
Returns the value of attribute mime.
-
#specifiers ⇒ Object
readonly
Returns the value of attribute specifiers.
Instance Method Summary collapse
- #filename ⇒ Object
- #filepath ⇒ Object
-
#initialize(job, type) ⇒ Formatter
constructor
A new instance of Formatter.
- #read_file ⇒ Object
- #size ⇒ Object
Constructor Details
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
26 27 28 |
# File 'lib/sequenceserver/blast/formatter.rb', line 26 def format @format end |
#mime ⇒ Object (readonly)
Returns the value of attribute mime.
26 27 28 |
# File 'lib/sequenceserver/blast/formatter.rb', line 26 def mime @mime end |
#specifiers ⇒ Object (readonly)
Returns the value of attribute specifiers.
26 27 28 |
# File 'lib/sequenceserver/blast/formatter.rb', line 26 def specifiers @specifiers end |
Instance Method Details
#filename ⇒ Object
36 37 38 |
# File 'lib/sequenceserver/blast/formatter.rb', line 36 def filename @filename ||= "sequenceserver-#{type}_report.#{mime}" end |
#filepath ⇒ Object
28 29 30 |
# File 'lib/sequenceserver/blast/formatter.rb', line 28 def filepath @filepath ||= File.join(job.dir, filename) end |
#read_file ⇒ Object
40 41 42 |
# File 'lib/sequenceserver/blast/formatter.rb', line 40 def read_file File.read(filepath) end |
#size ⇒ Object
32 33 34 |
# File 'lib/sequenceserver/blast/formatter.rb', line 32 def size File.size(filepath) end |