Module: NpSearch

Defined in:
lib/npsearch.rb,
lib/npsearch/logger.rb,
lib/npsearch/output.rb,
lib/npsearch/signalp.rb,
lib/npsearch/version.rb,
lib/npsearch/sequence.rb,
lib/npsearch/arg_validator.rb,
lib/npsearch/scoresequence.rb

Overview

Top level module / namespace.

Defined Under Namespace

Classes: ArgumentsValidators, Logger, Output, ScoreSequence, Sequence, Signalp

Constant Summary collapse

VERSION =
'2.1.8'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject

Returns the value of attribute logger.



17
18
19
# File 'lib/npsearch.rb', line 17

def logger
  @logger
end

.optObject

Returns the value of attribute opt.



18
19
20
# File 'lib/npsearch.rb', line 18

def opt
  @opt
end

.sequencesObject

Returns the value of attribute sequences.



19
20
21
# File 'lib/npsearch.rb', line 19

def sequences
  @sequences
end

.sorted_sequencesObject (readonly)

Returns the value of attribute sorted_sequences.



20
21
22
# File 'lib/npsearch.rb', line 20

def sorted_sequences
  @sorted_sequences
end

Class Method Details

.init(opt) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/npsearch.rb', line 22

def init(opt)
  @opt = opt
  ArgumentsValidators.run(opt)
  @sequences        = []
  @sorted_sequences = nil
  @pool             = initialise_thread_pool
  create_temp_directory
  extract_orf
end

.runObject



32
33
34
35
36
37
38
39
# File 'lib/npsearch.rb', line 32

def run
  input_file = @opt[:type] == :genetic ? @opt[:orf] : @opt[:input_file]
  iterate_input_file(input_file)
  @sorted_sequences = @sequences.sort_by(&:score).reverse
  Output.to_fasta(@opt[:input_file], @sorted_sequences, @opt[:type])
  Output.to_html(@opt[:input_file])
  remove_temp_dir
end