Class: Unipept::BlastFormatter
Class Method Summary collapse
Instance Method Summary collapse
-
#convert(data, _first) ⇒ String
Converts the given input data to the Blast format.
- #footer ⇒ Object
- #header(_data, _fasta_mapper = nil) ⇒ Object
-
#type ⇒ String
The type of the current formatter: blast.
Methods inherited from Formatter
available, default, #format, formatters, #group_by_first_key, #integrate_fasta_headers, new_for_format, register
Class Method Details
.hidden? ⇒ Boolean
319 320 321 |
# File 'lib/formatters.rb', line 319 def self.hidden? true end |
Instance Method Details
#convert(data, _first) ⇒ String
Converts the given input data to the Blast format.
338 339 340 341 342 343 344 345 |
# File 'lib/formatters.rb', line 338 def convert(data, _first) data .reject { |o| o['refseq_protein_ids'].empty? } .map do |o| "#{o['peptide']}\tref|#{o['refseq_protein_ids']}|\t100\t10\t0\t0\t0\t10\t0\t10\t1e-100\t100\n" end .join end |
#footer ⇒ Object
327 328 329 |
# File 'lib/formatters.rb', line 327 def '' end |
#header(_data, _fasta_mapper = nil) ⇒ Object
323 324 325 |
# File 'lib/formatters.rb', line 323 def header(_data, _fasta_mapper = nil) '' end |
#type ⇒ String
Returns The type of the current formatter: blast.
315 316 317 |
# File 'lib/formatters.rb', line 315 def type 'blast' end |