Class: GeneValidator::JsonToGVResults
- Inherits:
-
Object
- Object
- GeneValidator::JsonToGVResults
- Extended by:
- Forwardable
- Defined in:
- lib/genevalidator/json_to_gv_results.rb
Overview
produce GV results from a JSON previously produced from GV
Class Method Summary collapse
- .init(opt) ⇒ Object
- .print_console_header(first_row) ⇒ Object
- .print_output_console(row) ⇒ Object
- .run ⇒ Object
Class Method Details
.init(opt) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/genevalidator/json_to_gv_results.rb', line 14 def init(opt) GeneValidator.opt = opt GeneValidator.config = { output_max: 2500, run_no: 0, json_output: load_json_file } GeneValidator.dirs = GeneValidator.setup_dirnames(opt[:json_file]) end |
.print_console_header(first_row) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/genevalidator/json_to_gv_results.rb', line 31 def print_console_header(first_row) return unless opt[:output_formats].include? 'stdout' return if config[:console_header_printed] config[:console_header_printed] = true warn '' # blank line c_fmt = "%3s\t%5s\t%20s\t%7s\t" print format(c_fmt, 'No', 'Score', 'Identifier', 'No_Hits') puts first_row[:validations].keys.join("\t") end |
.print_output_console(row) ⇒ Object
41 42 43 44 45 46 47 48 49 |
# File 'lib/genevalidator/json_to_gv_results.rb', line 41 def print_output_console(row) return unless opt[:output_formats].include? 'stdout' c_fmt = "%3s\t%5s\t%20s\t%7s\t" short_def = row[:definition].split(' ')[0] print format(c_fmt, row[:idx], row[:overall_score], short_def, row[:no_hits]) puts row[:validations].values.map { |e| e[:print] }.join("\t") .gsub(' ', ' ') end |
.run ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/genevalidator/json_to_gv_results.rb', line 21 def run warn '==> Parsing input JSON results' print_console_header(config[:json_output][0]) config[:json_output].each do |row| print_output_console(row) create_row_json_plot_files(row) end GeneValidator.produce_output end |