htslib 0.1.0 → 0.2.2

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.
@@ -6,13 +6,13 @@ module HTS
6
6
  attach_function \
7
7
  :hopen,
8
8
  %i[string string varargs],
9
- HFILE.by_ref
9
+ HFile.by_ref
10
10
 
11
11
  # Associate a stream with an existing open file descriptor
12
12
  attach_function \
13
13
  :hdopen,
14
14
  %i[int string],
15
- HFILE.by_ref
15
+ HFile.by_ref
16
16
 
17
17
  # Report whether the file name or URL denotes remote storage
18
18
  attach_function \
@@ -29,19 +29,19 @@ module HTS
29
29
  # Flush (for output streams) and close the stream
30
30
  attach_function \
31
31
  :hclose,
32
- [HFILE],
32
+ [HFile],
33
33
  :int
34
34
 
35
35
  # Close the stream, without flushing or propagating errors
36
36
  attach_function \
37
37
  :hclose_abruptly,
38
- [HFILE],
38
+ [HFile],
39
39
  :void
40
40
 
41
41
  # Reposition the read/write stream offset
42
42
  attach_function \
43
43
  :hseek,
44
- [HFILE, :off_t, :int],
44
+ [HFile, :off_t, :int],
45
45
  :off_t
46
46
 
47
47
  # Report the current stream offset
@@ -55,37 +55,55 @@ module HTS
55
55
  # Read from the stream until the delimiter, up to a maximum length
56
56
  attach_function \
57
57
  :hgetdelim,
58
- [:string, :size_t, :int, HFILE],
58
+ [:string, :size_t, :int, HFile],
59
59
  :ssize_t
60
60
 
61
61
  # Read a line from the stream, up to a maximum length
62
62
  attach_function \
63
63
  :hgets,
64
- [:string, :int, HFILE],
64
+ [:string, :int, HFile],
65
65
  :string
66
66
 
67
67
  # Peek at characters to be read without removing them from buffers
68
68
  attach_function \
69
69
  :hpeek,
70
- [HFILE, :pointer, :size_t],
70
+ [HFile, :pointer, :size_t],
71
71
  :ssize_t
72
72
 
73
73
  # For writing streams, flush buffered output to the underlying stream
74
74
  attach_function \
75
75
  :hflush,
76
- [HFILE],
76
+ [HFile],
77
77
  :int
78
78
 
79
79
  # For hfile_mem: get the internal buffer and it's size from a hfile
80
80
  attach_function \
81
81
  :hfile_mem_get_buffer,
82
- [HFILE, :pointer],
82
+ [HFile, :pointer],
83
83
  :string
84
84
 
85
85
  # For hfile_mem: get the internal buffer and it's size from a hfile.
86
86
  attach_function \
87
87
  :hfile_mem_steal_buffer,
88
- [HFILE, :pointer],
88
+ [HFile, :pointer],
89
89
  :string
90
+
91
+ # Fills out sc_list[] with the list of known URL schemes.
92
+ attach_function \
93
+ :hfile_list_schemes,
94
+ %i[string pointer pointer], # mutable string
95
+ :int
96
+
97
+ # Fills out plist[] with the list of known hFILE plugins.
98
+ attach_function \
99
+ :hfile_list_plugins,
100
+ %i[pointer pointer], # mutable string
101
+ :int
102
+
103
+ # Tests for the presence of a specific hFILE plugin.
104
+ attach_function \
105
+ :hfile_has_plugin,
106
+ [:string],
107
+ :int
90
108
  end
91
109
  end
@@ -6,7 +6,13 @@ module HTS
6
6
  # hts_expand3
7
7
  # hts_resize
8
8
 
9
- # hts_log.h
9
+ # Sets the selected log level.
10
+ attach_function \
11
+ :hts_set_log_level,
12
+ [HtsLogLevel],
13
+ :void
14
+
15
+ # Gets the selected log level.
10
16
  attach_function \
11
17
  :hts_get_log_level,
12
18
  [],
@@ -58,10 +64,33 @@ module HTS
58
64
  [],
59
65
  :string
60
66
 
67
+ # Introspection on the features enabled in htslib
68
+ attach_function \
69
+ :hts_features,
70
+ [],
71
+ :uint
72
+
73
+ attach_function \
74
+ :hts_test_feature,
75
+ [:uint],
76
+ :string
77
+
78
+ # Introspection on the features enabled in htslib, string form
79
+ attach_function \
80
+ :hts_feature_string,
81
+ [],
82
+ :string
83
+
61
84
  # Determine format by peeking at the start of a file
62
85
  attach_function \
63
86
  :hts_detect_format,
64
- [HFILE, HtsFormat],
87
+ [HFile, HtsFormat],
88
+ :int
89
+
90
+ # Determine format primarily by peeking at the start of a file
91
+ attach_function \
92
+ :hts_detect_format2,
93
+ [HFile, :string, HtsFormat],
65
94
  :int
66
95
 
67
96
  # Get a human-readable description of the file format
@@ -86,7 +115,7 @@ module HTS
86
115
  # Open an existing stream as a SAM/BAM/CRAM/VCF/BCF/etc file
87
116
  attach_function \
88
117
  :hts_hopen,
89
- [HFILE, :string, :string],
118
+ [HFile, :string, :string],
90
119
  HtsFile.by_ref
91
120
 
92
121
  # For output streams, flush any buffered data
@@ -160,6 +189,12 @@ module HTS
160
189
  [HtsFile, :string],
161
190
  :int
162
191
 
192
+ # Sets a filter expression
193
+ attach_function \
194
+ :hts_set_filter_expression,
195
+ [HtsFile, :string],
196
+ :int
197
+
163
198
  # Determine whether a given htsFile contains a valid EOF block
164
199
  attach_function \
165
200
  :hts_check_EOF,
@@ -264,11 +299,26 @@ module HTS
264
299
  [HtsIdx],
265
300
  :uint64
266
301
 
302
+ # Return a list of target names from an index
303
+ attach_function \
304
+ :hts_idx_seqnames,
305
+ [HtsIdx, :pointer, :pointer, :pointer],
306
+ :pointer
307
+
308
+ # Return the number of targets from an index
309
+ attach_function \
310
+ :hts_idx_nseq,
311
+ [HtsIdx],
312
+ :int
313
+
314
+ # Parse a numeric string
267
315
  attach_function \
268
316
  :hts_parse_decimal,
269
317
  %i[string pointer int],
270
318
  :long_long
271
319
 
320
+ callback :hts_name2id_f, %i[pointer string], :int
321
+
272
322
  # Parse a "CHR:START-END"-style region string
273
323
  attach_function \
274
324
  :hts_parse_reg64,
@@ -284,7 +334,7 @@ module HTS
284
334
  # Parse a "CHR:START-END"-style region string
285
335
  attach_function \
286
336
  :hts_parse_region,
287
- %i[string pointer pointer pointer pointer pointer int],
337
+ %i[string pointer pointer pointer hts_name2id_f pointer int],
288
338
  :string
289
339
 
290
340
  # Create a single-region iterator
@@ -302,7 +352,7 @@ module HTS
302
352
  # Create a single-region iterator from a text region specification
303
353
  attach_function \
304
354
  :hts_itr_querys,
305
- [HtsIdx, :string, :pointer, :pointer, :pointer, :pointer],
355
+ [HtsIdx, :string, :hts_name2id_f, :pointer, :pointer, :pointer],
306
356
  HtsItr.by_ref
307
357
 
308
358
  # Return the next record from an iterator
@@ -312,27 +362,110 @@ module HTS
312
362
  :int
313
363
 
314
364
  attach_function \
315
- :hts_idx_seqnames,
316
- [HtsIdx, :pointer, :pointer, :pointer],
365
+ :hts_itr_multi_bam,
366
+ [HtsIdx, HtsItr],
367
+ :int
368
+
369
+ attach_function \
370
+ :hts_itr_multi_cram,
371
+ [HtsIdx, HtsItr],
372
+ :int
373
+
374
+ # Create a multi-region iterator from a region list
375
+ attach_function \
376
+ :hts_itr_regions,
377
+ [HtsIdx,
378
+ :pointer, # hts_reglist_t *
379
+ :int,
380
+ :hts_name2id_f,
381
+ :pointer,
382
+ :pointer, # hts_itr_multi_query_func
383
+ :pointer, # hts_readrec_func
384
+ :pointer, # hts_seek_func
385
+ :pointer # hts_tell_func
386
+ ],
387
+ HtsItr.by_ref
388
+
389
+ # Return the next record from an iterator
390
+ attach_function \
391
+ :hts_itr_multi_next,
392
+ [HtsFile, HtsItr, :pointer],
393
+ :int
394
+
395
+ # Create a region list from a char array
396
+ attach_function \
397
+ :hts_reglist_create,
398
+ %i[pointer int pointer pointer hts_name2id_f],
399
+ HtsReglist.by_ref
400
+
401
+ # Free a region list
402
+ attach_function \
403
+ :hts_reglist_free,
404
+ [HtsReglist, :int],
405
+ :void
406
+
407
+ # Deprecated
408
+ # Convenience function to determine file type
409
+ # attach_function \
410
+ # :hts_file_type,
411
+ # [:string],
412
+ # :int
413
+
414
+ attach_function \
415
+ :errmod_init,
416
+ [:double],
317
417
  :pointer
318
418
 
319
- # hts_itr_multi_bam
320
- # hts_itr_multi_cram
321
- # hts_itr_regions
322
- # hts_itr_multi_next
323
- # hts_reglist_create
324
- # hts_reglist_free
325
- # errmod_init
326
- # errmod_destroy
327
- # errmod_call
328
- # proabln_glocal
329
- # hts_md5_context
330
- # hts_md5_update
331
- # hts_md5_final
332
- # hts_md5_reset
333
- # hts_md5_hex
334
- # hts_md5_destroy
335
-
336
- # attach_function :sam_hdr_tid2name, [:pointer, :int], :string
419
+ attach_function \
420
+ :errmod_destroy,
421
+ [:pointer],
422
+ :void
423
+
424
+ attach_function \
425
+ :errmod_cal,
426
+ %i[pointer int int pointer pointer],
427
+ :int
428
+
429
+ # Perform probabilistic banded glocal alignment
430
+ attach_function \
431
+ :probaln_glocal,
432
+ %i[pointer int pointer int pointer pointer pointer pointer],
433
+ :int
434
+
435
+ # Initialises an MD5 context.
436
+ attach_function \
437
+ :hts_md5_init,
438
+ [],
439
+ :pointer # hts_md5_context
440
+
441
+ # Updates the context with the MD5 of the data.
442
+ attach_function \
443
+ :hts_md5_update,
444
+ %i[pointer pointer ulong],
445
+ :void
446
+
447
+ # Computes the final 128-bit MD5 hash from the given context
448
+ attach_function \
449
+ :hts_md5_final,
450
+ %i[pointer pointer], # unsinged char
451
+ :void
452
+
453
+ # Resets an md5_context to the initial state, as returned by hts_md5_init().
454
+ attach_function \
455
+ :hts_md5_reset,
456
+ [:pointer],
457
+ :void
458
+
459
+ # Converts a 128-bit MD5 hash into a 33-byte nul-termninated by string.
460
+ attach_function \
461
+ :hts_md5_hex,
462
+ %i[string pointer],
463
+ :void
464
+
465
+ # Deallocates any memory allocated by hts_md5_init.
466
+ attach_function \
467
+ :hts_md5_destroy,
468
+ [:pointer],
469
+ :void
337
470
  end
338
471
  end