htslib 0.0.10 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/hts/libhts.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "ffi_ext/struct"
4
+ require_relative "ffi_ext/pointer"
4
5
 
5
6
  module HTS
7
+ # A Module for working with native C HTSlib structures and functions.
6
8
  module LibHTS
7
9
  extend FFI::Library
8
10
 
@@ -12,6 +14,9 @@ module HTS
12
14
  raise LoadError, "#{e}\nCould not find #{HTS.lib_path}"
13
15
  end
14
16
 
17
+ # @!macro attach_function
18
+ # @!method $1(${2--2})
19
+ # @return [${-1}] the return value of $0
15
20
  def self.attach_function(*)
16
21
  super
17
22
  rescue FFI::NotFoundError => e
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "../htslib"
2
4
 
3
5
  require_relative "hts"
4
6
 
5
7
  module HTS
6
- class Tabix < Hts
8
+ class Tbx < Hts
7
9
  include Enumerable
8
10
 
9
11
  attr_reader :file_name
@@ -22,7 +24,7 @@ module HTS
22
24
 
23
25
  def initialize(file_name, threads: nil)
24
26
  if block_given?
25
- message = "HTS::Tabix.new() dose not take block; Please use HTS::Tabix.open() instead"
27
+ message = "HTS::Tbx.new() dose not take block; Please use HTS::Tbx.open() instead"
26
28
  raise message
27
29
  end
28
30
 
@@ -35,19 +37,9 @@ module HTS
35
37
 
36
38
  raise Errno::ENOENT, "Failed to open #{@file_name}" if @hts_file.null?
37
39
 
38
- if threads&.> 0
39
- r = LibHTS.hts_set_threads(@hts_file, threads)
40
- raise "Failed to set number of threads: #{threads}" if r < 0
41
- end
42
- end
43
-
44
- def close
45
- LibHTS.hts_close(@hts_file)
46
- @hts_file = nil
47
- end
40
+ set_threads(threads) if threads
48
41
 
49
- def closed?
50
- @hts_file.nil?
42
+ super # do nothing
51
43
  end
52
44
  end
53
45
  end
data/lib/hts/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTS
4
- VERSION = "0.0.10"
4
+ VERSION = "0.2.1"
5
5
  end
data/lib/htslib.rb CHANGED
@@ -40,6 +40,6 @@ module HTS
40
40
 
41
41
  autoload :Bam, "hts/bam"
42
42
  autoload :Bcf, "hts/bcf"
43
- autoload :Tabix, "hts/tabix"
43
+ autoload :Tbx, "hts/tbx"
44
44
  autoload :Faidx, "hts/faidx"
45
45
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htslib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kojix2
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-15 00:00:00.000000000 Z
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description:
125
+ description:
126
126
  email:
127
127
  - 2xijok@gmail.com
128
128
  executables: []
@@ -132,6 +132,7 @@ files:
132
132
  - LICENSE.txt
133
133
  - README.md
134
134
  - lib/hts/bam.rb
135
+ - lib/hts/bam/aux.rb
135
136
  - lib/hts/bam/cigar.rb
136
137
  - lib/hts/bam/flag.rb
137
138
  - lib/hts/bam/header.rb
@@ -139,10 +140,12 @@ files:
139
140
  - lib/hts/bcf.rb
140
141
  - lib/hts/bcf/format.rb
141
142
  - lib/hts/bcf/header.rb
143
+ - lib/hts/bcf/header_record.rb
142
144
  - lib/hts/bcf/info.rb
143
145
  - lib/hts/bcf/record.rb
144
146
  - lib/hts/faidx.rb
145
147
  - lib/hts/ffi_ext/README.md
148
+ - lib/hts/ffi_ext/pointer.rb
146
149
  - lib/hts/ffi_ext/struct.rb
147
150
  - lib/hts/hts.rb
148
151
  - lib/hts/libhts.rb
@@ -159,14 +162,15 @@ files:
159
162
  - lib/hts/libhts/thread_pool.rb
160
163
  - lib/hts/libhts/vcf.rb
161
164
  - lib/hts/libhts/vcf_funcs.rb
162
- - lib/hts/tabix.rb
165
+ - lib/hts/tbx.rb
163
166
  - lib/hts/version.rb
164
167
  - lib/htslib.rb
168
+ - vendor/libhts.dylib
165
169
  homepage: https://github.com/kojix2/ruby-htslib
166
170
  licenses:
167
171
  - MIT
168
172
  metadata: {}
169
- post_install_message:
173
+ post_install_message:
170
174
  rdoc_options: []
171
175
  require_paths:
172
176
  - lib
@@ -174,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
178
  requirements:
175
179
  - - ">="
176
180
  - !ruby/object:Gem::Version
177
- version: '2.7'
181
+ version: '3.1'
178
182
  required_rubygems_version: !ruby/object:Gem::Requirement
179
183
  requirements:
180
184
  - - ">="
@@ -182,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
186
  version: '0'
183
187
  requirements: []
184
188
  rubygems_version: 3.3.7
185
- signing_key:
189
+ signing_key:
186
190
  specification_version: 4
187
191
  summary: HTSlib bindings for Ruby
188
192
  test_files: []