Class: ViennaRna::Package::Spectral

Inherits:
Base
  • Object
show all
Defined in:
lib/vienna_rna/package/spectral.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#data, #flags, #response, #runtime

Instance Method Summary collapse

Methods inherited from Base

bootstrap, #debugger, #initialize, #inspect, #serialize

Methods included from Global::ChainExtensions

included

Methods included from Global::RunExtensions

included

Constructor Details

This class inherits a constructor from ViennaRna::Package::Base

Instance Attribute Details

#eigenvaluesObject (readonly)

Returns the value of attribute eigenvalues.



6
7
8
# File 'lib/vienna_rna/package/spectral.rb', line 6

def eigenvalues
  @eigenvalues
end

#time_kineticsObject (readonly)

Returns the value of attribute time_kinetics.



6
7
8
# File 'lib/vienna_rna/package/spectral.rb', line 6

def time_kinetics
  @time_kinetics
end

Instance Method Details

#post_processObject



15
16
17
18
19
20
21
# File 'lib/vienna_rna/package/spectral.rb', line 15

def post_process
  if flags.keys.include?(:eigen_only)
    @eigenvalues = response.split(?\n).map(&:to_f).sort_by(&:abs)
  else
    @time_kinetics = response.split(?\n).map { |line| line.split(?\t).map(&:to_f) }
  end
end

#run_command(flags) ⇒ Object



8
9
10
11
12
13
# File 'lib/vienna_rna/package/spectral.rb', line 8

def run_command(flags)
  "%s %s" % [
    exec_name, 
    stringify_flags(flags)
  ]
end