Module: HTS

Defined in:
lib/hts/bam/auxi.rb,
lib/htslib.rb,
lib/hts/bam.rb,
lib/hts/bcf.rb,
lib/hts/hts.rb,
lib/hts/faidx.rb,
lib/hts/tabix.rb,
lib/hts/libhts.rb,
lib/hts/version.rb,
lib/hts/bam/flag.rb,
lib/hts/bcf/info.rb,
lib/hts/bam/cigar.rb,
lib/hts/bam/header.rb,
lib/hts/bam/record.rb,
lib/hts/bcf/format.rb,
lib/hts/bcf/header.rb,
lib/hts/bcf/record.rb,
lib/hts/libhts/fai.rb,
lib/hts/libhts/hts.rb,
lib/hts/libhts/sam.rb,
lib/hts/libhts/tbx.rb,
lib/hts/libhts/vcf.rb,
lib/hts/libhts/bgzf.rb,
lib/hts/libhts/cram.rb,
lib/hts/libhts/hfile.rb,
lib/hts/libhts/kfunc.rb,
lib/hts/faidx/sequence.rb,
lib/hts/libhts/constants.rb,
lib/hts/libhts/sam_funcs.rb,
lib/hts/libhts/tbx_funcs.rb,
lib/hts/libhts/vcf_funcs.rb,
lib/hts/bam/header_record.rb,
lib/hts/bcf/header_record.rb,
lib/hts/libhts/thread_pool.rb

Overview

BGZF

Defined Under Namespace

Modules: LibHTS Classes: Bam, Bcf, Error, Faidx, Hts, Tabix

Constant Summary collapse

VERSION =
"0.2.9"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.lib_pathObject

Returns the value of attribute lib_path.



11
12
13
# File 'lib/htslib.rb', line 11

def lib_path
  @lib_path
end

Class Method Details

.search_htslib(name = nil) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/htslib.rb', line 13

def search_htslib(name = nil)
  name ||= "libhts.#{FFI::Platform::LIBSUFFIX}"
  lib_path = if ENV["HTSLIBDIR"]
               File.expand_path(name, ENV["HTSLIBDIR"])
             else
               File.expand_path("../vendor/#{name}", __dir__)
             end
  return lib_path if File.exist?(lib_path)

  begin
    require "pkg-config"
    lib_dir = PKGConfig.variable("htslib", "libdir")
    lib_path = File.expand_path(name, lib_dir)
  rescue PackageConfig::NotFoundError
    warn "htslib.pc was not found in the pkg-config search path."
  end
  return lib_path if File.exist?(lib_path)

  warn "htslib shared library '#{name}' not found."
end

.search_htslib_windowsObject



34
35
36
37
38
39
40
41
42
# File 'lib/htslib.rb', line 34

def search_htslib_windows
  ENV["HTSLIBDIR"] ||= [
    RubyInstaller::Runtime.msys2_installation.msys_path,
    RubyInstaller::Runtime.msys2_installation.mingwarch
  ].join(File::ALT_SEPARATOR)
  path = File.expand_path("bin/hts-3.dll", ENV["HTSLIBDIR"])
  RubyInstaller::Runtime.add_dll_directory(File.dirname(path))
  path
end