htslib 0.4.0 → 0.4.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.
- checksums.yaml +4 -4
- data/lib/hts/bam/auxi.rb +21 -3
- data/lib/hts/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86838244ad390e04fb293d3db9fd639c837dcd7b2309cc0c83da0b5925e7185c
|
|
4
|
+
data.tar.gz: 547063279b934706efcf919d287217f4231fe76d2e8fb3ae6df8e4dd7b6040ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 787f9167abef88ddbd758d3155f1f3568bb99d8a5a340086a1cc677be46e0e77ec5a0ef56d201610f06143d0f54a20a1f2563ae3e080996564b5b5545e3e8a2a
|
|
7
|
+
data.tar.gz: d07ae5e437c9729a39e32adb12ff694560eaa33e44094679199bc8b742ccaab4c5a111c7e6391a314a8b6a19fae82acea549123b57497690678e1b2b1746f2c7
|
data/lib/hts/bam/auxi.rb
CHANGED
|
@@ -248,10 +248,9 @@ module HTS
|
|
|
248
248
|
end
|
|
249
249
|
end
|
|
250
250
|
|
|
251
|
-
# Iterate auxiliary tags
|
|
251
|
+
# Iterate auxiliary tags as key-value pairs.
|
|
252
252
|
#
|
|
253
253
|
# @yieldparam tag [String] 2-byte AUX tag name
|
|
254
|
-
# @yieldparam type [String] AUX type, e.g. "i", "Z", or "B:C"
|
|
255
254
|
# @yieldparam value [Object] Ruby representation of the AUX value
|
|
256
255
|
def each
|
|
257
256
|
return enum_for(__method__) unless block_given?
|
|
@@ -261,7 +260,7 @@ module HTS
|
|
|
261
260
|
|
|
262
261
|
loop do
|
|
263
262
|
tag = FFI::Pointer.new(aux_ptr.address - 2).read_string(2)
|
|
264
|
-
yield tag,
|
|
263
|
+
yield tag, get_ruby_aux(aux_ptr)
|
|
265
264
|
aux_ptr = LibHTS.bam_aux_next(@record.struct, aux_ptr)
|
|
266
265
|
break if aux_ptr.null?
|
|
267
266
|
end
|
|
@@ -269,6 +268,25 @@ module HTS
|
|
|
269
268
|
|
|
270
269
|
alias each_pair each
|
|
271
270
|
|
|
271
|
+
# Iterate auxiliary tags with their SAM/BAM type.
|
|
272
|
+
#
|
|
273
|
+
# @yieldparam tag [String] 2-byte AUX tag name
|
|
274
|
+
# @yieldparam type [String] AUX type, e.g. "i", "Z", or "B:C"
|
|
275
|
+
# @yieldparam value [Object] Ruby representation of the AUX value
|
|
276
|
+
def each_with_type
|
|
277
|
+
return enum_for(__method__) unless block_given?
|
|
278
|
+
|
|
279
|
+
aux_ptr = first_pointer
|
|
280
|
+
return nil if aux_ptr.null?
|
|
281
|
+
|
|
282
|
+
loop do
|
|
283
|
+
tag = FFI::Pointer.new(aux_ptr.address - 2).read_string(2)
|
|
284
|
+
yield tag, aux_type(aux_ptr), get_ruby_aux(aux_ptr)
|
|
285
|
+
aux_ptr = LibHTS.bam_aux_next(@record.struct, aux_ptr)
|
|
286
|
+
break if aux_ptr.null?
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
|
|
272
290
|
def to_h
|
|
273
291
|
h = {}
|
|
274
292
|
aux_ptr = first_pointer
|
data/lib/hts/version.rb
CHANGED