Class: NpSearch::ArgumentsValidators

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/npsearch/arg_validator.rb

Overview

A class that validates the command line opts

Class Method Summary collapse

Class Method Details

.run(opt) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/npsearch/arg_validator.rb', line 12

def run(opt)
  assert_file_present('input fasta file', opt[:input_file])
  opt[:input_file] = File.expand_path(opt[:input_file])
  assert_input_file_not_empty(opt[:input_file])
  assert_input_file_probably_fasta(opt[:input_file])
  opt[:type]        = assert_input_sequence(opt[:input_file])
  opt[:num_threads] = check_num_threads(opt[:num_threads])
  assert_binaries('SignalP 4.1 Script', opt[:signalp_path])
  logger.debug "The validated OPT hash contains: #{opt}"
  opt
end