Class: Bio::BWA::Library

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/bwa/library.rb

Class Method Summary collapse

Class Method Details

.lib_extensionObject



7
8
9
10
11
12
13
# File 'lib/bio/bwa/library.rb', line 7

def self.lib_extension
  case Config::CONFIG['host_os']
    when /linux/ then return 'so'
    when /darwin/ then return 'dylib'
    when /mswin|mingw/ then raise NotImplementedError, "BWA library is not available for Windows platform"  
  end
end

.loadString

Note:

this method is called automatically when the module is loaded

Load the correct library for the OS system in use

Returns:

  • (String)

    the absolute path for the filename of the shared library



18
19
20
21
22
23
# File 'lib/bio/bwa/library.rb', line 18

def self.load
  warn "BWA library should be run on a 64bit system" if arch_type == "32bit"
  path = File.expand_path File.dirname(__FILE__)
  path.gsub!(/lib\/bio\/bwa/,'ext')
  File.join(path,"libbwa.#{self.lib_extension}")
end