class GeneValidator::JsonToGVResults

produce GV results from a JSON previously produced from GV

Public Class Methods

init(opt) click to toggle source
# 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) click to toggle source
print_output_console(row) click to toggle source
run() click to toggle source
# 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

Private Class Methods

create_row_json_plot_files(row) click to toggle source
# File lib/genevalidator/json_to_gv_results.rb, line 58
def create_row_json_plot_files(row)
  config[:run_no] += 1
  fname = "#{dirs[:filename]}_#{row[:idx]}.json"
  json_file = File.join(dirs[:json_dir], fname)
  File.open(json_file, 'w') { |f| f.write(row.to_json) }
end
load_json_file() click to toggle source
# File lib/genevalidator/json_to_gv_results.rb, line 53
def load_json_file
  json_contents = File.read(File.expand_path(opt[:json_file]))
  JSON.parse(json_contents, symbolize_names: true)
end