Class: MiGA::MiGA

Inherits:
Object
  • Object
show all
Extended by:
Common::Format, Common::Path
Includes:
MiGA, Common
Defined in:
lib/miga/common.rb,
lib/miga/version.rb,
lib/miga/common/base.rb

Overview

Generic class used to handle system-wide information and methods, and parent of all other MiGA::* classes.

Constant Summary

Constants included from MiGA

CITATION, VERSION, VERSION_DATE, VERSION_NAME

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common::Path

root_path, script_path

Methods included from Common::Format

clean_fasta_file, seqs_length, tabulate

Class Method Details

.CITATIONObject

Reference of MiGA.



56
# File 'lib/miga/version.rb', line 56

def self.CITATION ; CITATION ; end

.DEBUG(*args) ⇒ Object

Send debug message.



29
30
31
32
33
# File 'lib/miga/common/base.rb', line 29

def DEBUG(*args)
  $stderr.puts(*args) if @@DEBUG
  $stderr.puts(
        caller.map{ |v| v.gsub(/^/,'     ') }.join("\n") ) if @@DEBUG_TRACE
end

.DEBUG_OFFObject

Turn off debugging.



12
# File 'lib/miga/common/base.rb', line 12

def DEBUG_OFF ; @@DEBUG=false end

.DEBUG_ONObject

Turn on debugging.



8
# File 'lib/miga/common/base.rb', line 8

def DEBUG_ON ; @@DEBUG=true end

.DEBUG_TRACE_OFFObject

Turn off debug tracing (but not debugging).



23
24
25
# File 'lib/miga/common/base.rb', line 23

def DEBUG_TRACE_OFF
  @@DEBUG_TRACE=false
end

.DEBUG_TRACE_ONObject

Turn on debug tracing (and debugging).



16
17
18
19
# File 'lib/miga/common/base.rb', line 16

def DEBUG_TRACE_ON
  @@DEBUG_TRACE=true
  DEBUG_ON()
end

.FULL_VERSIONObject

Complete version as string.



42
# File 'lib/miga/version.rb', line 42

def self.FULL_VERSION ; VERSION.join(".") ; end

.initialized?Boolean

Has MiGA been initialized?

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/miga/common.rb', line 24

def self.initialized?
  File.exist?(File.expand_path('.miga_rc', ENV['MIGA_HOME'])) and
    File.exist?(File.expand_path('.miga_daemon.json', ENV['MIGA_HOME']))
end

.LONG_VERSIONObject

Complete version with nickname and date as string.



46
47
48
# File 'lib/miga/version.rb', line 46

def self.LONG_VERSION
  "MiGA #{VERSION.join(".")} - #{VERSION_NAME} - #{VERSION_DATE}"
end

.VERSIONObject

Major.minor version as Float.



38
# File 'lib/miga/version.rb', line 38

def self.VERSION ; VERSION[0] ; end

.VERSION_DATEObject

Date of the current gem release.



52
# File 'lib/miga/version.rb', line 52

def self.VERSION_DATE ; VERSION_DATE ; end

Instance Method Details

#result_files_exist?(base, ext) ⇒ Boolean

Check if the result files exist with base name (String) followed by the ext values (Array of String).

Returns:

  • (Boolean)


32
33
34
35
36
37
# File 'lib/miga/common.rb', line 32

def result_files_exist?(base, ext)
  ext = [ext] unless ext.is_a? Array
  ext.all? do |f|
    File.exist?(base + f) or File.exist?("#{base}#{f}.gz")
  end
end