Module: HTS::LibHTS

Extended by:
FFI::Library
Defined in:
lib/hts/libhts.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/libhts/constants.rb,
lib/hts/libhts/sam_funcs.rb,
lib/hts/libhts/tbx_funcs.rb,
lib/hts/libhts/vcf_funcs.rb,
lib/hts/libhts/thread_pool.rb

Overview

Module for working with C HTSlib.

Defined Under Namespace

Classes: BGZF, Bam1, Bam1Core, BamPileup1, BamPileupCd, Bcf1, BcfDec, BcfFmt, BcfHdr, BcfHrec, BcfIdinfo, BcfIdpair, BcfInfo, BcfVariant, Faidx, HFile, HtsFile, HtsFormat, HtsIdx, HtsItr, HtsOpt, HtsReglist, HtsTpool, KSeq, KString, SamHdr, Tbx, TbxConf

Constant Summary collapse

HtsLogLevel =

hts

enum(
  :off,            # All logging disabled.
  :error,          # Logging of errors only.
  :warning, 3,     # Logging of errors and warnings.
  :info,           # Logging of errors, warnings, and normal but significant events.
  :debug,          # Logging of all except the most detailed debug events.
  :trace           # All logging enabled.
)
HtsFormatCategory =
enum(
  :unknown_category,
  :sequence_data,    # Sequence data -- SAM, BAM, CRAM, etc
  :variant_data,     # Variant calling data -- VCF, BCF, etc
  :index_file,       # Index file associated with some data file
  :region_list,      # Coordinate intervals or regions -- BED, etc
  :category_maximum, 32_767
)
HtsExactFormat =
enum(
  :unknown_format,
  :binary_format, :text_format,
  :sam, :bam, :bai, :cram, :crai, :vcf, :bcf, :csi, :gzi, :tbi, :bed,
  :htsget, :json,
  :empty_format,
  :fasta_format, :fastq_format, :fai_format, :fqi_format,
  :hts_crypt4gh_format,
  :format_maximum, 32_767
)
HtsCompression =
enum(
  :no_compression, :gzip, :bgzf, :custom,
  :compression_maximum, 32_767
)
HtsFmtOption =
enum(
  :CRAM_OPT_DECODE_MD,
  :CRAM_OPT_PREFIX,
  :CRAM_OPT_VERBOSITY,   # obsolete, use hts_set_log_level() instead
  :CRAM_OPT_SEQS_PER_SLICE,
  :CRAM_OPT_SLICES_PER_CONTAINER,
  :CRAM_OPT_RANGE,
  :CRAM_OPT_VERSION,     # rename to :CRAM_version?
  :CRAM_OPT_EMBED_REF,
  :CRAM_OPT_IGNORE_MD5,
  :CRAM_OPT_REFERENCE,   # make general
  :CRAM_OPT_MULTI_SEQ_PER_SLICE,
  :CRAM_OPT_NO_REF,
  :CRAM_OPT_USE_BZIP2,
  :CRAM_OPT_SHARED_REF,
  :CRAM_OPT_NTHREADS,    # deprecated, use HTS_OPT_NTHREADS
  :CRAM_OPT_THREAD_POOL, # make general
  :CRAM_OPT_USE_LZMA,
  :CRAM_OPT_USE_RANS,
  :CRAM_OPT_REQUIRED_FIELDS,
  :CRAM_OPT_LOSSY_NAMES,
  :CRAM_OPT_BASES_PER_SLICE,
  :CRAM_OPT_STORE_MD,
  :CRAM_OPT_STORE_NM,
  :CRAM_OPT_RANGE_NOSEEK, # CRAM_OPT_RANGE minus the seek
  # General purpose
  :HTS_OPT_COMPRESSION_LEVEL, 100,
  :HTS_OPT_NTHREADS,
  :HTS_OPT_THREAD_POOL,
  :HTS_OPT_CACHE_SIZE,
  :HTS_OPT_BLOCK_SIZE
)
BamHdr =
SamHdr
SamFile =
HtsFile
FaiFormatOptions =

faidx

enum(:FAI_NONE, :FAI_FASTA, :FAI_FASTQ)
CramContentType =
enum(
  :ct_error,           -1,
  :file_header,        0,
  :compression_header, 1,
  :mapped_slice,       2,
  :unmapped_slice,     3, # cram v1.0 only
  :external,           4,
  :core,               5
)
CramBlockMethod =
enum(
  :unknown,      -1,
  :raw,          0,
  :gzip,         1,
  :bzip2,        2,
  :lzma,         3,
  :rans4x8,      4,
  :ransnx16,     5,
  :arith,        6,
  :fqz,          7,
  :tok3,         8
)
BAM_CMATCH =

constants

0
BAM_CINS =
1
BAM_CDEL =
2
BAM_CREF_SKIP =
3
BAM_CSOFT_CLIP =
4
BAM_CHARD_CLIP =
5
BAM_CPAD =
6
BAM_CEQUAL =
7
BAM_CDIFF =
8
BAM_CBACK =
9
BAM_CIGAR_STR =
"MIDNSHP=XB"
BAM_CIGAR_SHIFT =
4
BAM_CIGAR_MASK =
0xf
BAM_CIGAR_TYPE =
0x3C1A7
BAM_FPAIRED =
1
BAM_FPROPER_PAIR =
2
BAM_FUNMAP =
4
BAM_FMUNMAP =
8
BAM_FREVERSE =
16
BAM_FMREVERSE =
32
BAM_FREAD1 =
64
BAM_FREAD2 =
128
BAM_FSECONDARY =
256
BAM_FQCFAIL =
512
BAM_FDUP =
1024
BAM_FSUPPLEMENTARY =
2048
BAM_USER_OWNS_STRUCT =
1
BAM_USER_OWNS_DATA =
2
BCF_HL_FLT =

constants

0
BCF_HL_INFO =

header line

1
BCF_HL_FMT =
2
BCF_HL_CTG =
3
BCF_HL_STR =

structured header line TAG=<A=..,B=..>

4
BCF_HL_GEN =

generic header line

5
BCF_HT_FLAG =

header type

0
BCF_HT_INT =
1
BCF_HT_REAL =
2
BCF_HT_STR =
3
BCF_HT_LONG =

BCF_HT_INT, but for int64_t values; VCF only!

(BCF_HT_INT | 0x100)
BCF_VL_FIXED =

variable length

0
BCF_VL_VAR =
1
BCF_VL_A =
2
BCF_VL_G =
3
BCF_VL_R =
4
BCF_DT_ID =

dictionary type

0
BCF_DT_CTG =
1
BCF_DT_SAMPLE =
2
BCF_BT_NULL =
0
BCF_BT_INT8 =
1
BCF_BT_INT16 =
2
BCF_BT_INT32 =
3
BCF_BT_INT64 =

Unofficial, for internal use only.

4
BCF_BT_FLOAT =
5
BCF_BT_CHAR =
7
VCF_REF =
0
VCF_SNP =
1
VCF_MNP =
2
VCF_INDEL =
4
VCF_OTHER =
8
VCF_BND =

breakend

16
VCF_OVERLAP =

overlapping deletion, ALT=*

32
BCF1_DIRTY_ID =
1
BCF1_DIRTY_ALS =
2
BCF1_DIRTY_FLT =
4
BCF1_DIRTY_INF =
8
BCF_ERR_CTG_UNDEF =
1
BCF_ERR_TAG_UNDEF =
2
BCF_ERR_NCOLS =
4
BCF_ERR_LIMITS =
8
BCF_ERR_CHAR =
16
BCF_ERR_CTG_INVALID =
32
BCF_ERR_TAG_INVALID =
64
BCF_UN_STR =

up to ALT inclusive

1
BCF_UN_FLT =

up to FILTER

2
BCF_UN_INFO =

up to INFO

4
BCF_UN_SHR =

all shared information

(BCF_UN_STR | BCF_UN_FLT | BCF_UN_INFO)
BCF_UN_FMT =

unpack format and each sample

8
BCF_UN_IND =

a synonym of BCF_UN_FMT

BCF_UN_FMT
BCF_UN_ALL =

everything

(BCF_UN_SHR | BCF_UN_FMT)
BCF_MAX_BT_INT8 =

INT8_MAX */

0x7f
BCF_MAX_BT_INT16 =

INT16_MAX */

0x7fff
BCF_MAX_BT_INT32 =

INT32_MAX */

0x7fffffff
BCF_MIN_BT_INT8 =

INT8_MIN + 8 */

-120           # INT8_MIN  + 8 */
BCF_MIN_BT_INT16 =

INT16_MIN + 8 */

-32_760        # INT16_MIN + 8 */
BCF_MIN_BT_INT32 =

INT32_MIN + 8 */

-2_147_483_640 # INT32_MIN + 8 */
HtsTpoolProcess =

FIXME: struct

:pointer
HtsTpoolResult =
:pointer
@@tbx_name2id =
proc do |tbx, ss|
  LibHTS.tbx_name2id(tbx, ss)
end
@@bcf_hdr_name2id =
proc do |hdr, id|
  LibHTS.bcf_hdr_name2id(hdr, id)
end

Class Method Summary collapse

Class Method Details

.attach_functionObject



21
22
23
24
25
# File 'lib/hts/libhts.rb', line 21

def self.attach_function(*)
  super
rescue FFI::NotFoundError => e
  warn e.message if $VERBOSE
end

.bam_aux2A(pointer) ⇒ char

Get a character aux value

Returns:

  • (char)

    the return value of attach_function



474
475
476
477
# File 'lib/hts/libhts/sam.rb', line 474

attach_function \
:bam_aux2A,
[:pointer],
:char

.bam_aux2f(pointer) ⇒ double

Get an integer aux value

Returns:

  • (double)

    the return value of attach_function



468
469
470
471
# File 'lib/hts/libhts/sam.rb', line 468

attach_function \
:bam_aux2f,
[:pointer],
:double

.bam_aux2i(pointer) ⇒ int64

Get an integer aux value

Returns:

  • (int64)

    the return value of attach_function



462
463
464
465
# File 'lib/hts/libhts/sam.rb', line 462

attach_function \
:bam_aux2i,
[:pointer],
:int64

.bam_aux2Z(pointer) ⇒ string

Get a string aux value

Returns:

  • (string)

    the return value of attach_function



480
481
482
483
# File 'lib/hts/libhts/sam.rb', line 480

attach_function \
:bam_aux2Z,
[:pointer],
:string

.bam_aux_append(string) ⇒ int

Append tag data to a bam record

Returns:

  • (int)

    the return value of attach_function



504
505
506
507
# File 'lib/hts/libhts/sam.rb', line 504

attach_function \
:bam_aux_append,
[Bam1, :string, :string, :int, :pointer],
:int

.bam_aux_del(pointer) ⇒ int

Delete tag data from a bam record

Returns:

  • (int)

    the return value of attach_function



510
511
512
513
# File 'lib/hts/libhts/sam.rb', line 510

attach_function \
:bam_aux_del,
[Bam1, :pointer],
:int

.bam_aux_first([Bam1]) ⇒ pointer

Return a pointer to a BAM record’s first aux field

Returns:

  • (pointer)

    the return value of attach_function



444
445
446
447
# File 'lib/hts/libhts/sam.rb', line 444

attach_function \
:bam_aux_first,
[Bam1],
:pointer

.bam_aux_get(string) ⇒ pointer

Return a pointer to an aux record

Returns:

  • (pointer)

    the return value of attach_function



456
457
458
459
# File 'lib/hts/libhts/sam.rb', line 456

attach_function \
:bam_aux_get,
[Bam1, :string], # const char tag[2]
:pointer

.bam_aux_next(pointer) ⇒ pointer

Return a pointer to a BAM record’s next aux field

Returns:

  • (pointer)

    the return value of attach_function



450
451
452
453
# File 'lib/hts/libhts/sam.rb', line 450

attach_function \
:bam_aux_next,
[Bam1, :pointer],
:pointer

.bam_aux_remove(pointer) ⇒ pointer

Delete an aux field from a BAM record. Identical to @c bam_aux_del() apart from the return value

Returns:

  • (pointer)

    the return value of attach_function



516
517
518
519
# File 'lib/hts/libhts/sam.rb', line 516

attach_function \
:bam_aux_remove,
[Bam1, :pointer],
:pointer

.bam_aux_update_array(string) ⇒ int

Update or add an array tag

Returns:

  • (int)

    the return value of attach_function



540
541
542
543
# File 'lib/hts/libhts/sam.rb', line 540

attach_function \
:bam_aux_update_array,
[Bam1, :string, :uint8, :uint32, :pointer],
:int

.bam_aux_update_float(string) ⇒ int

Update or add a floating-point tag

Returns:

  • (int)

    the return value of attach_function



534
535
536
537
# File 'lib/hts/libhts/sam.rb', line 534

attach_function \
:bam_aux_update_float,
[Bam1, :string, :float],
:int

.bam_aux_update_int(string) ⇒ int

Update or add an integer tag

Returns:

  • (int)

    the return value of attach_function



528
529
530
531
# File 'lib/hts/libhts/sam.rb', line 528

attach_function \
:bam_aux_update_int,
[Bam1, :string, :int64],
:int

.bam_aux_update_str(string) ⇒ int

Update or add a string-type tag

Returns:

  • (int)

    the return value of attach_function



522
523
524
525
# File 'lib/hts/libhts/sam.rb', line 522

attach_function \
:bam_aux_update_str,
[Bam1, :string, :int, :string],
:int

.bam_auxB2f(pointer) ⇒ double

Get a floating-point value from an array-type tag

Returns:

  • (double)

    the return value of attach_function



498
499
500
501
# File 'lib/hts/libhts/sam.rb', line 498

attach_function \
:bam_auxB2f,
%i[pointer uint],
:double

.bam_auxB2i(pointer) ⇒ int64

Get an integer value from an array-type tag

Returns:

  • (int64)

    the return value of attach_function



492
493
494
495
# File 'lib/hts/libhts/sam.rb', line 492

attach_function \
:bam_auxB2i,
%i[pointer uint],
:int64

.bam_auxB_len(pointer) ⇒ uint

Get the length of an array-type (‘B’) tag

Returns:

  • (uint)

    the return value of attach_function



486
487
488
489
# File 'lib/hts/libhts/sam.rb', line 486

attach_function \
:bam_auxB_len,
[:pointer],
:uint

.bam_cigar2qlen(int) ⇒ int64

Calculate query length from CIGAR data

Returns:

  • (int64)

    the return value of attach_function



261
262
263
264
# File 'lib/hts/libhts/sam.rb', line 261

attach_function \
:bam_cigar2qlen,
%i[int pointer],
:int64

.bam_cigar2rlen(int) ⇒ hts_pos_t

Calculate reference length from CIGAR data

Returns:

  • (hts_pos_t)

    the return value of attach_function



267
268
269
270
# File 'lib/hts/libhts/sam.rb', line 267

attach_function \
:bam_cigar2rlen,
%i[int pointer],
:hts_pos_t

.bam_cigar_gen(l, o) ⇒ Object



36
37
38
# File 'lib/hts/libhts/sam_funcs.rb', line 36

def bam_cigar_gen(l, o)
  (l << BAM_CIGAR_SHIFT) | o
end

.bam_cigar_op(c) ⇒ Object



24
25
26
# File 'lib/hts/libhts/sam_funcs.rb', line 24

def bam_cigar_op(c)
  c & BAM_CIGAR_MASK
end

.bam_cigar_opchr(c) ⇒ Object



32
33
34
# File 'lib/hts/libhts/sam_funcs.rb', line 32

def bam_cigar_opchr(c)
  "#{BAM_CIGAR_STR}??????"[bam_cigar_op(c)]
end

.bam_cigar_oplen(c) ⇒ Object



28
29
30
# File 'lib/hts/libhts/sam_funcs.rb', line 28

def bam_cigar_oplen(c)
  c >> BAM_CIGAR_SHIFT
end

.bam_cigar_type(o) ⇒ Object



40
41
42
# File 'lib/hts/libhts/sam_funcs.rb', line 40

def bam_cigar_type(o)
  (BAM_CIGAR_TYPE >> (o << 1)) & 3
end

.bam_copy1([Bam1, Bam1]) ⇒ by_ref

Copy alignment record data

Returns:

  • (by_ref)

    the return value of attach_function



228
229
230
231
# File 'lib/hts/libhts/sam.rb', line 228

attach_function \
:bam_copy1,
[Bam1, Bam1],
Bam1.by_ref

.bam_destroy1([Bam1]) ⇒ void

This method returns an undefined value.

Destroy a bam1_t structure



210
211
212
213
# File 'lib/hts/libhts/sam.rb', line 210

attach_function \
:bam_destroy1,
[Bam1],
:void

.bam_dup1([Bam1]) ⇒ by_ref

Create a duplicate alignment record

Returns:

  • (by_ref)

    the return value of attach_function



234
235
236
237
# File 'lib/hts/libhts/sam.rb', line 234

attach_function \
:bam_dup1,
[Bam1],
Bam1.by_ref

.bam_endpos([Bam1]) ⇒ hts_pos_t

Calculate the rightmost base position of an alignment on the reference genome.

Returns:

  • (hts_pos_t)

    the return value of attach_function



273
274
275
276
# File 'lib/hts/libhts/sam.rb', line 273

attach_function \
:bam_endpos,
[Bam1],
:hts_pos_t

.bam_flag2str(int) ⇒ string

Returns the return value of attach_function.

Returns:

  • (string)

    the return value of attach_function



283
284
285
286
# File 'lib/hts/libhts/sam.rb', line 283

attach_function \
:bam_flag2str,
[:int],
:string

.bam_get_aux(b) ⇒ Object

Get auxiliary data



92
93
94
# File 'lib/hts/libhts/sam_funcs.rb', line 92

def bam_get_aux(b)
  b[:data] + (b[:core][:n_cigar] << 2) + b[:core][:l_qname] + ((b[:core][:l_qseq] + 1) >> 1) + b[:core][:l_qseq]
end

.bam_get_cigar(b) ⇒ Object

Get the CIGAR array



77
78
79
# File 'lib/hts/libhts/sam_funcs.rb', line 77

def bam_get_cigar(b)
  b[:data] + b[:core][:l_qname]
end

.bam_get_l_aux(b) ⇒ Object

Get length of auxiliary data



97
98
99
# File 'lib/hts/libhts/sam_funcs.rb', line 97

def bam_get_l_aux(b)
  b[:l_data] - (b[:core][:n_cigar] << 2) - b[:core][:l_qname] - b[:core][:l_qseq] - ((b[:core][:l_qseq] + 1) >> 1)
end

.bam_get_qname(b) ⇒ Object

Get the name of the query



72
73
74
# File 'lib/hts/libhts/sam_funcs.rb', line 72

def bam_get_qname(b)
  b[:data]
end

.bam_get_qual(b) ⇒ Object

Get query quality



87
88
89
# File 'lib/hts/libhts/sam_funcs.rb', line 87

def bam_get_qual(b)
  b[:data] + (b[:core][:n_cigar] << 2) + b[:core][:l_qname] + ((b[:core][:l_qseq] + 1) >> 1)
end

.bam_get_seq(b) ⇒ Object

Get query sequence



82
83
84
# File 'lib/hts/libhts/sam_funcs.rb', line 82

def bam_get_seq(b)
  b[:data] + (b[:core][:n_cigar] << 2) + b[:core][:l_qname]
end

.bam_hdr_read([BGZF]) ⇒ by_ref

Read the header from a BAM compressed file.

Returns:

  • (by_ref)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/sam.rb', line 12

attach_function \
:bam_hdr_read,
[BGZF],
SamHdr.by_ref

.bam_hdr_write([BGZF, SamHdr]) ⇒ int

Writes the header to a BAM file.

Returns:

  • (int)

    the return value of attach_function



18
19
20
21
# File 'lib/hts/libhts/sam.rb', line 18

attach_function \
:bam_hdr_write,
[BGZF, SamHdr],
:int

.bam_index_load(fn) ⇒ Object

Load/build .csi or .bai BAM index file. Does not work with CRAM. It is recommended to use the sam_index_* functions below instead.



141
142
143
# File 'lib/hts/libhts/sam_funcs.rb', line 141

def bam_index_load(fn)
  hts_idx_load(fn, HTS_FMT_BAI)
end

.bam_init1([]) ⇒ by_ref

Create a new bam1_t alignment structure

Returns:

  • (by_ref)

    the return value of attach_function



204
205
206
207
# File 'lib/hts/libhts/sam.rb', line 204

attach_function \
:bam_init1,
[],
Bam1.by_ref

.bam_is_mrev(b) ⇒ Object

Get whether the query’s mate is on the reverse strand



67
68
69
# File 'lib/hts/libhts/sam_funcs.rb', line 67

def bam_is_mrev(b)
  b[:core][:flag] & BAM_FMREVERSE != 0
end

.bam_is_rev(b) ⇒ Object

Get whether the query is on the reverse strand



62
63
64
# File 'lib/hts/libhts/sam_funcs.rb', line 62

def bam_is_rev(b)
  b[:core][:flag] & BAM_FREVERSE != 0
end

.bam_mods_at_next_pos(pointer) ⇒ int

Returns modification status for the next base position in the query seq.

Returns:

  • (int)

    the return value of attach_function



696
697
698
699
# File 'lib/hts/libhts/sam.rb', line 696

attach_function \
:bam_mods_at_next_pos,
[Bam1, :pointer, :pointer, :int],
:int

.bam_mods_at_qpos(int) ⇒ int

Returns modification status for a specific query position.

Returns:

  • (int)

    the return value of attach_function



708
709
710
711
# File 'lib/hts/libhts/sam.rb', line 708

attach_function \
:bam_mods_at_qpos,
[Bam1, :int, :pointer, :pointer, :int],
:int

.bam_mods_query_type(pointer) ⇒ int

Returns data about a specific modification type for the alignment record.

Returns:

  • (int)

    the return value of attach_function



714
715
716
717
# File 'lib/hts/libhts/sam.rb', line 714

attach_function \
:bam_mods_query_type,
%i[pointer int pointer pointer string],
:int

.bam_mods_queryi(pointer) ⇒ int

Returns data about the i^th modification type for the alignment record.

Returns:

  • (int)

    the return value of attach_function



720
721
722
723
# File 'lib/hts/libhts/sam.rb', line 720

attach_function \
:bam_mods_queryi,
%i[pointer int pointer pointer string],
:int

.bam_mods_recorded(pointer) ⇒ int

Returns the list of base modification codes provided for this

Returns:

  • (int)

    the return value of attach_function



726
727
728
729
# File 'lib/hts/libhts/sam.rb', line 726

attach_function \
:bam_mods_recorded,
%i[pointer pointer],
:int

.bam_mplp64_auto(bam_mplp) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



641
642
643
644
# File 'lib/hts/libhts/sam.rb', line 641

attach_function \
:bam_mplp64_auto,
%i[bam_mplp pointer pointer pointer pointer], # BamPileup1T
:int

.bam_mplp_auto(bam_mplp) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



636
637
638
639
# File 'lib/hts/libhts/sam.rb', line 636

attach_function \
:bam_mplp_auto,
%i[bam_mplp pointer pointer pointer pointer], # BamPileup1T
:int

.bam_mplp_constructor(bam_mplp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



651
652
653
654
# File 'lib/hts/libhts/sam.rb', line 651

attach_function \
:bam_mplp_constructor,
%i[bam_mplp bam_plp_callback_function],
:void

.bam_mplp_destroy(bam_mplp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



626
627
628
629
# File 'lib/hts/libhts/sam.rb', line 626

attach_function \
:bam_mplp_destroy,
[:bam_mplp],
:void

.bam_mplp_destructor(bam_mplp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



656
657
658
659
# File 'lib/hts/libhts/sam.rb', line 656

attach_function \
:bam_mplp_destructor,
%i[bam_mplp bam_plp_callback_function],
:void

.bam_mplp_init(int) ⇒ bam_mplp

Returns the return value of attach_function.

Returns:

  • (bam_mplp)

    the return value of attach_function



616
617
618
619
# File 'lib/hts/libhts/sam.rb', line 616

attach_function \
:bam_mplp_init,
%i[int bam_plp_auto_f pointer],
:bam_mplp

.bam_mplp_init_overlaps(bam_mplp) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



621
622
623
624
# File 'lib/hts/libhts/sam.rb', line 621

attach_function \
:bam_mplp_init_overlaps,
[:bam_mplp],
:int

.bam_mplp_reset(bam_mplp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



646
647
648
649
# File 'lib/hts/libhts/sam.rb', line 646

attach_function \
:bam_mplp_reset,
[:bam_mplp],
:void

.bam_mplp_set_maxcnt(bam_mplp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



631
632
633
634
# File 'lib/hts/libhts/sam.rb', line 631

attach_function \
:bam_mplp_set_maxcnt,
%i[bam_mplp int],
:void

.bam_next_basemod(pointer) ⇒ int

Finds the next location containing base modifications and returns them

Returns:

  • (int)

    the return value of attach_function



702
703
704
705
# File 'lib/hts/libhts/sam.rb', line 702

attach_function \
:bam_next_basemod,
[Bam1, :pointer, :pointer, :int, :pointer],
:int

.bam_parse_basemod(pointer) ⇒ int

Parses the MM and ML tags out of a bam record.

Returns:

  • (int)

    the return value of attach_function



684
685
686
687
# File 'lib/hts/libhts/sam.rb', line 684

attach_function \
:bam_parse_basemod,
[Bam1, :pointer],
:int

.bam_parse_basemod2(pointer) ⇒ int

Parses the MM and ML tags out of a bam record.

Returns:

  • (int)

    the return value of attach_function



690
691
692
693
# File 'lib/hts/libhts/sam.rb', line 690

attach_function \
:bam_parse_basemod2,
[Bam1, :pointer, :uint32],
:int

.bam_parse_cigar(string) ⇒ ssize_t

Parse a CIGAR string into a bam1_t struct

Returns:

  • (ssize_t)

    the return value of attach_function



301
302
303
304
# File 'lib/hts/libhts/sam.rb', line 301

attach_function \
:bam_parse_cigar,
[:string, :pointer, Bam1],
:ssize_t

.bam_plp64_auto(bam_plp) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



576
577
578
579
# File 'lib/hts/libhts/sam.rb', line 576

attach_function \
:bam_plp64_auto,
%i[bam_plp pointer pointer pointer],
BamPileup1.by_ref

.bam_plp64_next(bam_plp) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



571
572
573
574
# File 'lib/hts/libhts/sam.rb', line 571

attach_function \
:bam_plp64_next,
%i[bam_plp pointer pointer pointer],
BamPileup1.by_ref

.bam_plp_auto(bam_plp) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



566
567
568
569
# File 'lib/hts/libhts/sam.rb', line 566

attach_function \
:bam_plp_auto,
%i[bam_plp pointer pointer pointer],
BamPileup1.by_ref

.bam_plp_constructor(bam_plp) ⇒ void

This method returns an undefined value.

sets a callback to initialise any per-pileup1_t fields.



594
595
596
597
# File 'lib/hts/libhts/sam.rb', line 594

attach_function \
:bam_plp_constructor,
%i[bam_plp bam_plp_callback_function],
:void

.bam_plp_destroy(bam_plp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



551
552
553
554
# File 'lib/hts/libhts/sam.rb', line 551

attach_function \
:bam_plp_destroy,
[:bam_plp],
:void

.bam_plp_destructor(bam_plp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



599
600
601
602
# File 'lib/hts/libhts/sam.rb', line 599

attach_function \
:bam_plp_destructor,
%i[bam_plp bam_plp_callback_function],
:void

.bam_plp_init(bam_plp_auto_f) ⇒ bam_plp

sets an iterator over multiple

Returns:

  • (bam_plp)

    the return value of attach_function



546
547
548
549
# File 'lib/hts/libhts/sam.rb', line 546

attach_function \
:bam_plp_init,
%i[bam_plp_auto_f pointer],
:bam_plp

.bam_plp_insertion(pointer) ⇒ int

Get pileup padded insertion sequence

Returns:

  • (int)

    the return value of attach_function



605
606
607
608
# File 'lib/hts/libhts/sam.rb', line 605

attach_function \
:bam_plp_insertion,
[BamPileup1, KString, :pointer],
:int

.bam_plp_insertion_mod(pointer) ⇒ int

Get pileup padded insertion sequence, including base modifications

Returns:

  • (int)

    the return value of attach_function



611
612
613
614
# File 'lib/hts/libhts/sam.rb', line 611

attach_function \
:bam_plp_insertion_mod,
[BamPileup1, :pointer, KString, :pointer],
:int

.bam_plp_next(bam_plp) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



561
562
563
564
# File 'lib/hts/libhts/sam.rb', line 561

attach_function \
:bam_plp_next,
%i[bam_plp pointer pointer pointer],
BamPileup1.by_ref

.bam_plp_push(bam_plp) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



556
557
558
559
# File 'lib/hts/libhts/sam.rb', line 556

attach_function \
:bam_plp_push,
[:bam_plp, Bam1],
:int

.bam_plp_reset(bam_plp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



586
587
588
589
# File 'lib/hts/libhts/sam.rb', line 586

attach_function \
:bam_plp_reset,
[:bam_plp],
:void

.bam_plp_set_maxcnt(bam_plp) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



581
582
583
584
# File 'lib/hts/libhts/sam.rb', line 581

attach_function \
:bam_plp_set_maxcnt,
%i[bam_plp int],
:void

.bam_read1([BGZF, Bam1]) ⇒ int

Read a BAM format alignment record

Returns:

  • (int)

    the return value of attach_function



216
217
218
219
# File 'lib/hts/libhts/sam.rb', line 216

attach_function \
:bam_read1,
[BGZF, Bam1],
:int

.bam_seqi(s, i) ⇒ Object

Get a base on read



102
103
104
# File 'lib/hts/libhts/sam_funcs.rb', line 102

def bam_seqi(s, i)
  (s[i >> 1].read_uint8 >> ((~i & 1) << 2)) & 0xf
end

.bam_set1(size_t) ⇒ int

Set all components of an alignment structure

Returns:

  • (int)

    the return value of attach_function



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/hts/libhts/sam.rb', line 240

attach_function \
:bam_set1,
[Bam1,
 :size_t,
 :string,
 :uint16,
 :int32,
 :hts_pos_t,
 :uint8,
 :size_t,
 :pointer,
 :int32,
 :hts_pos_t,
 :hts_pos_t,
 :size_t,
 :string,
 :string,
 :size_t],
:int

.bam_set_qname(string) ⇒ int

Set the name of the query

Returns:

  • (int)

    the return value of attach_function



289
290
291
292
# File 'lib/hts/libhts/sam.rb', line 289

attach_function \
:bam_set_qname,
[Bam1, :string],
:int

.bam_set_seqi(s, i, b) ⇒ Object

Modifies a single base in the bam structure.



107
108
109
# File 'lib/hts/libhts/sam_funcs.rb', line 107

def bam_set_seqi(s, i, b)
  s[i >> 1] = (s[i >> 1] & (0xf0 >> ((~i & 1) << 2))) | ((b) << ((~i & 1) << 2))
end

.bam_str2flag(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



278
279
280
281
# File 'lib/hts/libhts/sam.rb', line 278

attach_function \
:bam_str2flag,
[:string],
:int

.bam_write1([BGZF, Bam1]) ⇒ int

Write a BAM format alignment record

Returns:

  • (int)

    the return value of attach_function



222
223
224
225
# File 'lib/hts/libhts/sam.rb', line 222

attach_function \
:bam_write1,
[BGZF, Bam1],
:int

.bcf_add_filter(int) ⇒ int

Adds to the FILTER column

Returns:

  • (int)

    the return value of attach_function



366
367
368
369
# File 'lib/hts/libhts/vcf.rb', line 366

attach_function \
:bcf_add_filter,
[BcfHdr, Bcf1, :int],
:int

.bcf_add_id(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



401
402
403
404
# File 'lib/hts/libhts/vcf.rb', line 401

attach_function \
:bcf_add_id,
[BcfHdr, Bcf1, :string],
:int

.bcf_alleles2gt(a, b) ⇒ Object

Conversion between alleles indexes to Number=G genotype index (assuming diploid, all 0-based)



169
170
171
# File 'lib/hts/libhts/vcf_funcs.rb', line 169

def bcf_alleles2gt(a, b)
  ((a) > (b) ? (a * (a + 1) / 2 + b) : (b * (b + 1) / 2 + a))
end

.bcf_clear([Bcf1]) ⇒ void Also known as: bcf_clear1

This method returns an undefined value.

Make the bcf1_t object ready for next read.



43
44
45
46
# File 'lib/hts/libhts/vcf.rb', line 43

attach_function \
:bcf_clear,
[Bcf1],
:void

.bcf_copy([Bcf1, Bcf1]) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



107
108
109
110
# File 'lib/hts/libhts/vcf.rb', line 107

attach_function \
:bcf_copy,
[Bcf1, Bcf1],
Bcf1.by_ref

.bcf_destroy([Bcf1]) ⇒ void Also known as: bcf_destroy1

This method returns an undefined value.

Deallocate a bcf1_t object



30
31
32
33
# File 'lib/hts/libhts/vcf.rb', line 30

attach_function \
:bcf_destroy,
[Bcf1],
:void

.bcf_dup([Bcf1]) ⇒ by_ref

Create a copy of BCF record.

Returns:

  • (by_ref)

    the return value of attach_function



102
103
104
105
# File 'lib/hts/libhts/vcf.rb', line 102

attach_function \
:bcf_dup,
[Bcf1],
Bcf1.by_ref

.bcf_empty([Bcf1]) ⇒ void Also known as: bcf_empty1

This method returns an undefined value.

Same as bcf_destroy() but frees only the memory allocated by bcf1_t, not the bcf1_t object itself.



37
38
39
40
# File 'lib/hts/libhts/vcf.rb', line 37

attach_function \
:bcf_empty,
[Bcf1],
:void

.bcf_enc_vchar(int) ⇒ int

Encode a variable-length char array in BCF format

Returns:

  • (int)

    the return value of attach_function



481
482
483
484
# File 'lib/hts/libhts/vcf.rb', line 481

attach_function \
:bcf_enc_vchar,
[KString, :int, :string],
:int

.bcf_enc_vfloat(int) ⇒ int

Encode a variable-length float array in BCF format

Returns:

  • (int)

    the return value of attach_function



493
494
495
496
# File 'lib/hts/libhts/vcf.rb', line 493

attach_function \
:bcf_enc_vfloat,
[KString, :int, :pointer],
:int

.bcf_enc_vint(int) ⇒ int

Encode a variable-length integer array in BCF format

Returns:

  • (int)

    the return value of attach_function



487
488
489
490
# File 'lib/hts/libhts/vcf.rb', line 487

attach_function \
:bcf_enc_vint,
[KString, :int, :pointer, :int],
:int

.bcf_float_missing([]) ⇒ uint32

Returns the return value of attach_function.

Returns:

  • (uint32)

    the return value of attach_function



547
548
549
550
# File 'lib/hts/libhts/vcf.rb', line 547

attach_function \
:bcf_float_missing,
[],
:uint32

.bcf_float_vector_end([]) ⇒ uint32

Returns the return value of attach_function.

Returns:

  • (uint32)

    the return value of attach_function



542
543
544
545
# File 'lib/hts/libhts/vcf.rb', line 542

attach_function \
:bcf_float_vector_end,
[],
:uint32

.bcf_fmt_array(int) ⇒ int

Convert BCF FORMAT data to string form

Returns:

  • (int)

    the return value of attach_function



470
471
472
473
# File 'lib/hts/libhts/vcf.rb', line 470

attach_function \
:bcf_fmt_array,
[KString, :int, :int, :pointer],
:int

.bcf_fmt_sized_array(pointer) ⇒ uint8

Returns the return value of attach_function.

Returns:

  • (uint8)

    the return value of attach_function



475
476
477
478
# File 'lib/hts/libhts/vcf.rb', line 475

attach_function \
:bcf_fmt_sized_array,
[KString, :pointer],
:uint8

.bcf_get_fmt(string) ⇒ by_ref

Returns pointer to FORMAT’s field data

Returns:

  • (by_ref)

    the return value of attach_function



424
425
426
427
# File 'lib/hts/libhts/vcf.rb', line 424

attach_function \
:bcf_get_fmt,
[BcfHdr, Bcf1, :string],
BcfFmt.by_ref

.bcf_get_fmt_id(int) ⇒ by_ref

Returns pointer to FORMAT/INFO field data given the header index instead of the string ID

Returns:

  • (by_ref)

    the return value of attach_function



435
436
437
438
# File 'lib/hts/libhts/vcf.rb', line 435

attach_function \
:bcf_get_fmt_id,
[Bcf1, :int],
BcfFmt.by_ref

.bcf_get_format_char(hdr, line, tag, dst, ndst) ⇒ Object

Get FORMAT values



204
205
206
# File 'lib/hts/libhts/vcf_funcs.rb', line 204

def bcf_get_format_char(hdr, line, tag, dst, ndst)
  bcf_get_format_values(hdr, line, tag, dst, ndst, BCF_HT_STR)
end

.bcf_get_format_float(hdr, line, tag, dst, ndst) ⇒ Object

Get FORMAT values



199
200
201
# File 'lib/hts/libhts/vcf_funcs.rb', line 199

def bcf_get_format_float(hdr, line, tag, dst, ndst)
  bcf_get_format_values(hdr, line, tag, dst, ndst, BCF_HT_REAL)
end

.bcf_get_format_int32(hdr, line, tag, dst, ndst) ⇒ Object

Get FORMAT values



194
195
196
# File 'lib/hts/libhts/vcf_funcs.rb', line 194

def bcf_get_format_int32(hdr, line, tag, dst, ndst)
  bcf_get_format_values(hdr, line, tag, dst, ndst, BCF_HT_INT)
end

.bcf_get_format_string(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



451
452
453
454
# File 'lib/hts/libhts/vcf.rb', line 451

attach_function \
:bcf_get_format_string,
[BcfHdr, Bcf1, :string, :pointer, :pointer],
:int

.bcf_get_format_values(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



456
457
458
459
# File 'lib/hts/libhts/vcf.rb', line 456

attach_function \
:bcf_get_format_values,
[BcfHdr, Bcf1, :string, :pointer, :pointer, :int],
:int

.bcf_get_genotypes(hdr, line, dst, ndst) ⇒ Object

Get FORMAT values



209
210
211
# File 'lib/hts/libhts/vcf_funcs.rb', line 209

def bcf_get_genotypes(hdr, line, dst, ndst)
  bcf_get_format_values(hdr, line, "GT", dst, ndst, BCF_HT_INT)
end

.bcf_get_info(string) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



429
430
431
432
# File 'lib/hts/libhts/vcf.rb', line 429

attach_function \
:bcf_get_info,
[BcfHdr, Bcf1, :string],
BcfInfo.by_ref

.bcf_get_info_flag(hdr, line, tag, dst, ndst) ⇒ Object

Get INFO values



189
190
191
# File 'lib/hts/libhts/vcf_funcs.rb', line 189

def bcf_get_info_flag(hdr, line, tag, dst, ndst)
  bcf_get_info_values(hdr, line, tag, dst, ndst, BCF_HT_FLAG)
end

.bcf_get_info_float(hdr, line, tag, dst, ndst) ⇒ Object

Get INFO values



179
180
181
# File 'lib/hts/libhts/vcf_funcs.rb', line 179

def bcf_get_info_float(hdr, line, tag, dst, ndst)
  bcf_get_info_values(hdr, line, tag, dst, ndst, BCF_HT_REAL)
end

.bcf_get_info_id(int) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



440
441
442
443
# File 'lib/hts/libhts/vcf.rb', line 440

attach_function \
:bcf_get_info_id,
[Bcf1, :int],
BcfInfo.by_ref

.bcf_get_info_int32(hdr, line, tag, dst, ndst) ⇒ Object

Get INFO values



174
175
176
# File 'lib/hts/libhts/vcf_funcs.rb', line 174

def bcf_get_info_int32(hdr, line, tag, dst, ndst)
  bcf_get_info_values(hdr, line, tag, dst, ndst, BCF_HT_INT)
end

.bcf_get_info_string(hdr, line, tag, dst, ndst) ⇒ Object

Get INFO values



184
185
186
# File 'lib/hts/libhts/vcf_funcs.rb', line 184

def bcf_get_info_string(hdr, line, tag, dst, ndst)
  bcf_get_info_values(hdr, line, tag, dst, ndst, BCF_HT_STR)
end

.bcf_get_info_values(string) ⇒ int

get INFO values

Returns:

  • (int)

    the return value of attach_function



446
447
448
449
# File 'lib/hts/libhts/vcf.rb', line 446

attach_function \
:bcf_get_info_values,
[BcfHdr, Bcf1, :string, :pointer, :pointer, :int],
:int

.bcf_get_variant_type(int) ⇒ int

Get variant type in a BCF record, for a given allele

Returns:

  • (int)

    the return value of attach_function



331
332
333
334
# File 'lib/hts/libhts/vcf.rb', line 331

attach_function \
:bcf_get_variant_type,
[Bcf1, :int],
:int

.bcf_get_variant_types([Bcf1]) ⇒ int

Get variant types in a BCF record

Returns:

  • (int)

    the return value of attach_function



325
326
327
328
# File 'lib/hts/libhts/vcf.rb', line 325

attach_function \
:bcf_get_variant_types,
[Bcf1],
:int

.bcf_gt_allele(val) ⇒ Object

Macro for setting genotypes correctly



164
165
166
# File 'lib/hts/libhts/vcf_funcs.rb', line 164

def bcf_gt_allele(val)
  ((val >> 1) - 1)
end

.bcf_gt_is_missing(val) ⇒ Object

Macro for setting genotypes correctly



154
155
156
# File 'lib/hts/libhts/vcf_funcs.rb', line 154

def bcf_gt_is_missing(val)
  (val >> 1 ? 0 : 1)
end

.bcf_gt_is_phased(idx) ⇒ Object

Macro for setting genotypes correctly



159
160
161
# File 'lib/hts/libhts/vcf_funcs.rb', line 159

def bcf_gt_is_phased(idx)
  (idx & 1)
end

.bcf_gt_missingObject

Macro for setting genotypes correctly



149
150
151
# File 'lib/hts/libhts/vcf_funcs.rb', line 149

def bcf_gt_missing
  0
end

.bcf_gt_phased(idx) ⇒ Object

Macro for setting genotypes correctly



139
140
141
# File 'lib/hts/libhts/vcf_funcs.rb', line 139

def bcf_gt_phased(idx)
  ((idx + 1) << 1 | 1)
end

.bcf_gt_unphased(idx) ⇒ Object

Macro for setting genotypes correctly



144
145
146
# File 'lib/hts/libhts/vcf_funcs.rb', line 144

def bcf_gt_unphased(idx)
  ((idx + 1) << 1)
end

.bcf_has_filter(string) ⇒ int

Returns 1 if present, 0 if absent, or -1 if filter does not exist. “PASS” and “.” can be used interchangeably.

Returns:

  • (int)

    the return value of attach_function



379
380
381
382
# File 'lib/hts/libhts/vcf.rb', line 379

attach_function \
:bcf_has_filter,
[BcfHdr, Bcf1, :string],
:int

.bcf_has_variant_type(int) ⇒ int

Check for presence of variant types in a BCF record, for a given allele

Returns:

  • (int)

    the return value of attach_function



343
344
345
346
# File 'lib/hts/libhts/vcf.rb', line 343

attach_function \
:bcf_has_variant_type,
[Bcf1, :int, :uint32],
:int

.bcf_has_variant_types(uint32) ⇒ int

Check for presence of variant types in a BCF record

Returns:

  • (int)

    the return value of attach_function



337
338
339
340
# File 'lib/hts/libhts/vcf.rb', line 337

attach_function \
:bcf_has_variant_types,
[Bcf1, :uint32, :int],
:int

.bcf_hdr_add_hrec([BcfHdr, BcfHrec]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



264
265
266
267
# File 'lib/hts/libhts/vcf.rb', line 264

attach_function \
:bcf_hdr_add_hrec,
[BcfHdr, BcfHrec],
:int

.bcf_hdr_add_sample(string) ⇒ int

Add a new sample.

Returns:

  • (int)

    the return value of attach_function



176
177
178
179
# File 'lib/hts/libhts/vcf.rb', line 176

attach_function \
:bcf_hdr_add_sample,
[BcfHdr, :string],
:int

.bcf_hdr_append(string) ⇒ int

Append new VCF header line

Returns:

  • (int)

    the return value of attach_function



201
202
203
204
# File 'lib/hts/libhts/vcf.rb', line 201

attach_function \
:bcf_hdr_append,
[BcfHdr, :string],
:int

.bcf_hdr_destroy([BcfHdr]) ⇒ void

This method returns an undefined value.

Destroy a BCF header struct



18
19
20
21
# File 'lib/hts/libhts/vcf.rb', line 18

attach_function \
:bcf_hdr_destroy,
[BcfHdr],
:void

.bcf_hdr_dup([BcfHdr]) ⇒ by_ref

Create a new header using the supplied template

Returns:

  • (by_ref)

    the return value of attach_function



157
158
159
160
# File 'lib/hts/libhts/vcf.rb', line 157

attach_function \
:bcf_hdr_dup,
[BcfHdr],
BcfHdr.by_ref

.bcf_hdr_format(int) ⇒ int

Appends formatted header text to str.

Returns:

  • (int)

    the return value of attach_function



188
189
190
191
# File 'lib/hts/libhts/vcf.rb', line 188

attach_function \
:bcf_hdr_format,
[BcfHdr, :int, KString],
:int

.bcf_hdr_get_hrec(int) ⇒ by_ref

Get header line info

Returns:

  • (by_ref)

    the return value of attach_function



270
271
272
273
# File 'lib/hts/libhts/vcf.rb', line 270

attach_function \
:bcf_hdr_get_hrec,
[BcfHdr, :int, :string, :string, :string],
BcfHrec.by_ref

.bcf_hdr_get_version([BcfHdr]) ⇒ string

VCF version, e.g. VCFv4.2

Returns:

  • (string)

    the return value of attach_function



212
213
214
215
# File 'lib/hts/libhts/vcf.rb', line 212

attach_function \
:bcf_hdr_get_version,
[BcfHdr],
:string

.bcf_hdr_id2coltype(hdr, type, int_id) ⇒ Object

Macro for accessing bcf_idinfo_t



261
262
263
264
265
266
# File 'lib/hts/libhts/vcf_funcs.rb', line 261

def bcf_hdr_id2coltype(hdr, type, int_id)
  LibHTS::BcfIdpair.new(
    hdr[:id][LibHTS::BCF_DT_ID].to_ptr +
    LibHTS::BcfIdpair.size * int_id # offset
  )[:val][:info][type] & 0xf
end

.bcf_hdr_id2int(int) ⇒ int

Translates string into numeric ID

Returns:

  • (int)

    the return value of attach_function



464
465
466
467
# File 'lib/hts/libhts/vcf.rb', line 464

attach_function \
:bcf_hdr_id2int,
[BcfHdr, :int, :string],
:int

.bcf_hdr_id2length(hdr, type, int_id) ⇒ Object

Macro for accessing bcf_idinfo_t



237
238
239
240
241
242
# File 'lib/hts/libhts/vcf_funcs.rb', line 237

def bcf_hdr_id2length(hdr, type, int_id)
  LibHTS::BcfIdpair.new(
    hdr[:id][LibHTS::BCF_DT_ID].to_ptr +
    LibHTS::BcfIdpair.size * int_id # offset
  )[:val][:info][type] >> 8 & 0xf
end

.bcf_hdr_id2name(hdr, rid) ⇒ Object

Translates numeric ID to sequence name



227
228
229
230
231
232
233
234
# File 'lib/hts/libhts/vcf_funcs.rb', line 227

def bcf_hdr_id2name(hdr, rid)
  return nil if hdr.null? || rid < 0 || rid >= hdr[:n][LibHTS::BCF_DT_CTG]

  LibHTS::BcfIdpair.new(
    hdr[:id][LibHTS::BCF_DT_CTG].to_ptr +
    LibHTS::BcfIdpair.size * rid # offset
  )[:key]
end

.bcf_hdr_id2number(hdr, type, int_id) ⇒ Object

Macro for accessing bcf_idinfo_t



245
246
247
248
249
250
# File 'lib/hts/libhts/vcf_funcs.rb', line 245

def bcf_hdr_id2number(hdr, type, int_id)
  LibHTS::BcfIdpair.new(
    hdr[:id][LibHTS::BCF_DT_ID].to_ptr +
    LibHTS::BcfIdpair.size * int_id # offset
  )[:val][:info][type] >> 12
end

.bcf_hdr_id2type(hdr, type, int_id) ⇒ Object

Macro for accessing bcf_idinfo_t



253
254
255
256
257
258
# File 'lib/hts/libhts/vcf_funcs.rb', line 253

def bcf_hdr_id2type(hdr, type, int_id)
  LibHTS::BcfIdpair.new(
    hdr[:id][LibHTS::BCF_DT_ID].to_ptr +
    LibHTS::BcfIdpair.size * int_id # offset
  )[:val][:info][type] >> 4 & 0xf
end

.bcf_hdr_init(string) ⇒ by_ref

Create an empty BCF header.

Returns:

  • (by_ref)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/vcf.rb', line 12

attach_function \
:bcf_hdr_init,
[:string],
BcfHdr.by_ref

.bcf_hdr_int2id(hdr, type, int_id) ⇒ Object

Translates numeric ID into string



214
215
216
217
218
219
# File 'lib/hts/libhts/vcf_funcs.rb', line 214

def bcf_hdr_int2id(hdr, type, int_id)
  LibHTS::BcfIdpair.new(
    hdr[:id][type].to_ptr +
    LibHTS::BcfIdpair.size * int_id # offsets
  )[:key]
end

.bcf_hdr_merge([BcfHdr, BcfHdr]) ⇒ by_ref

Copy header lines from src to dst, see also bcf_translate()

Returns:

  • (by_ref)

    the return value of attach_function



170
171
172
173
# File 'lib/hts/libhts/vcf.rb', line 170

attach_function \
:bcf_hdr_merge,
[BcfHdr, BcfHdr],
BcfHdr.by_ref

.bcf_hdr_name2id(hdr, id) ⇒ Object

Translates sequence names (chromosomes) into numeric ID



222
223
224
# File 'lib/hts/libhts/vcf_funcs.rb', line 222

def bcf_hdr_name2id(hdr, id)
  bcf_hdr_id2int(hdr, BCF_DT_CTG, id)
end

.bcf_hdr_nsamples(hdr) ⇒ Object

Get number of samples



91
92
93
# File 'lib/hts/libhts/vcf_funcs.rb', line 91

def bcf_hdr_nsamples(hdr)
  hdr[:n][BCF_DT_SAMPLE]
end

.bcf_hdr_parse(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



241
242
243
244
# File 'lib/hts/libhts/vcf.rb', line 241

attach_function \
:bcf_hdr_parse,
[BcfHdr, :string],
:int

.bcf_hdr_parse_line(string) ⇒ by_ref

parse a single line of VCF textual header

Returns:

  • (by_ref)

    the return value of attach_function



253
254
255
256
# File 'lib/hts/libhts/vcf.rb', line 253

attach_function \
:bcf_hdr_parse_line,
[BcfHdr, :string, :pointer],
BcfHrec.by_ref

.bcf_hdr_printf(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



206
207
208
209
# File 'lib/hts/libhts/vcf.rb', line 206

attach_function \
:bcf_hdr_printf,
[BcfHdr, :string, :varargs],
:int

.bcf_hdr_read([HtsFile]) ⇒ by_ref

Read a VCF or BCF header

Returns:

  • (by_ref)

    the return value of attach_function



49
50
51
52
# File 'lib/hts/libhts/vcf.rb', line 49

attach_function \
:bcf_hdr_read,
[HtsFile],
BcfHdr.by_ref

.bcf_hdr_remove(int) ⇒ void

This method returns an undefined value.

Remove VCF header tag



224
225
226
227
# File 'lib/hts/libhts/vcf.rb', line 224

attach_function \
:bcf_hdr_remove,
[BcfHdr, :int, :string],
:void

.bcf_hdr_seqnames(pointer) ⇒ pointer

Creates a list of sequence names.

Returns:

  • (pointer)

    the return value of attach_function



236
237
238
239
# File 'lib/hts/libhts/vcf.rb', line 236

attach_function \
:bcf_hdr_seqnames,
[BcfHdr, :pointer],
:pointer

.bcf_hdr_set(string) ⇒ int

Read VCF header from a file and update the header

Returns:

  • (int)

    the return value of attach_function



182
183
184
185
# File 'lib/hts/libhts/vcf.rb', line 182

attach_function \
:bcf_hdr_set,
[BcfHdr, :string],
:int

.bcf_hdr_set_samples(string) ⇒ int

for more efficient VCF parsing when only one/few samples are needed

Returns:

  • (int)

    the return value of attach_function



55
56
57
58
# File 'lib/hts/libhts/vcf.rb', line 55

attach_function \
:bcf_hdr_set_samples,
[BcfHdr, :string, :int],
:int

.bcf_hdr_set_version(string) ⇒ int

Set version in bcf header

Returns:

  • (int)

    the return value of attach_function



218
219
220
221
# File 'lib/hts/libhts/vcf.rb', line 218

attach_function \
:bcf_hdr_set_version,
[BcfHdr, :string],
:int

.bcf_hdr_subset(int) ⇒ by_ref

Creates a new copy of the header removing unwanted samples

Returns:

  • (by_ref)

    the return value of attach_function



230
231
232
233
# File 'lib/hts/libhts/vcf.rb', line 230

attach_function \
:bcf_hdr_subset,
[BcfHdr, :int, :pointer, :pointer],
BcfHdr.by_ref

.bcf_hdr_sync([BcfHdr]) ⇒ int

Synchronize internal header structures

Returns:

  • (int)

    the return value of attach_function



247
248
249
250
# File 'lib/hts/libhts/vcf.rb', line 247

attach_function \
:bcf_hdr_sync,
[BcfHdr],
:int

.bcf_hdr_write([HtsFile, BcfHdr]) ⇒ int

Write a VCF or BCF header

Returns:

  • (int)

    the return value of attach_function



66
67
68
69
# File 'lib/hts/libhts/vcf.rb', line 66

attach_function \
:bcf_hdr_write,
[HtsFile, BcfHdr],
:int

.bcf_hrec_add_key(string) ⇒ int

Add a new header record key

Returns:

  • (int)

    the return value of attach_function



282
283
284
285
# File 'lib/hts/libhts/vcf.rb', line 282

attach_function \
:bcf_hrec_add_key,
[BcfHrec, :string, :size_t],
:int

.bcf_hrec_destroy([BcfHrec]) ⇒ void

This method returns an undefined value.

Free up a header record and associated structures



305
306
307
308
# File 'lib/hts/libhts/vcf.rb', line 305

attach_function \
:bcf_hrec_destroy,
[BcfHrec],
:void

.bcf_hrec_dup([BcfHrec]) ⇒ by_ref

Duplicate a header record

Returns:

  • (by_ref)

    the return value of attach_function



276
277
278
279
# File 'lib/hts/libhts/vcf.rb', line 276

attach_function \
:bcf_hrec_dup,
[BcfHrec],
BcfHrec.by_ref

.bcf_hrec_find_key(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



293
294
295
296
# File 'lib/hts/libhts/vcf.rb', line 293

attach_function \
:bcf_hrec_find_key,
[BcfHrec, :string],
:int

.bcf_hrec_format([BcfHrec, KString]) ⇒ int

Convert a bcf header record to string form

Returns:

  • (int)

    the return value of attach_function



259
260
261
262
# File 'lib/hts/libhts/vcf.rb', line 259

attach_function \
:bcf_hrec_format,
[BcfHrec, KString],
:int

.bcf_hrec_set_val(int) ⇒ int

Set a header record value

Returns:

  • (int)

    the return value of attach_function



288
289
290
291
# File 'lib/hts/libhts/vcf.rb', line 288

attach_function \
:bcf_hrec_set_val,
[BcfHrec, :int, :string, :size_t, :int],
:int

.bcf_idx_init(int) ⇒ int

Initialise fp->idx for the current format type, for VCF and BCF files.

Returns:

  • (int)

    the return value of attach_function



531
532
533
534
# File 'lib/hts/libhts/vcf.rb', line 531

attach_function \
:bcf_idx_init,
[HtsFile, BcfHdr, :int, :string],
:int

.bcf_idx_save([HtsFile]) ⇒ int

Writes the index initialised with bcf_idx_init to disk.

Returns:

  • (int)

    the return value of attach_function



537
538
539
540
# File 'lib/hts/libhts/vcf.rb', line 537

attach_function \
:bcf_idx_save,
[HtsFile],
:int

.bcf_index_build(string) ⇒ int

Generate and save an index file

Returns:

  • (int)

    the return value of attach_function



513
514
515
516
# File 'lib/hts/libhts/vcf.rb', line 513

attach_function \
:bcf_index_build,
%i[string int],
:int

.bcf_index_build2(string) ⇒ int

Generate and save an index to a specific file

Returns:

  • (int)

    the return value of attach_function



519
520
521
522
# File 'lib/hts/libhts/vcf.rb', line 519

attach_function \
:bcf_index_build2,
%i[string string int],
:int

.bcf_index_build3(string) ⇒ int

Generate and save an index to a specific file

Returns:

  • (int)

    the return value of attach_function



525
526
527
528
# File 'lib/hts/libhts/vcf.rb', line 525

attach_function \
:bcf_index_build3,
%i[string string int int],
:int

.bcf_index_load(fn) ⇒ Object

Load a BCF index



287
288
289
# File 'lib/hts/libhts/vcf_funcs.rb', line 287

def bcf_index_load(fn)
  hts_idx_load(fn, HTS_FMT_CSI)
end

.bcf_index_load2(string) ⇒ by_ref

Load a BCF index from a given index file name

Returns:

  • (by_ref)

    the return value of attach_function



501
502
503
504
# File 'lib/hts/libhts/vcf.rb', line 501

attach_function \
:bcf_index_load2,
%i[string string],
HtsIdx.by_ref

.bcf_index_load3(string) ⇒ by_ref

Load a BCF index from a given index file name

Returns:

  • (by_ref)

    the return value of attach_function



507
508
509
510
# File 'lib/hts/libhts/vcf.rb', line 507

attach_function \
:bcf_index_load3,
%i[string string int],
HtsIdx.by_ref

.bcf_index_seqnames(idx, hdr, nptr) ⇒ Object

Load a BCF index



292
293
294
# File 'lib/hts/libhts/vcf_funcs.rb', line 292

def bcf_index_seqnames(idx, hdr, nptr)
  hts_idx_seqnames(idx, nptr, @@bcf_hdr_id2name, hdr)
end

.bcf_init([]) ⇒ by_ref Also known as: bcf_init1

Allocate and initialize a bcf1_t object.

Returns:

  • (by_ref)

    the return value of attach_function



24
25
26
27
# File 'lib/hts/libhts/vcf.rb', line 24

attach_function \
:bcf_init,
[],
Bcf1.by_ref

.bcf_int16_missingObject

INT16_MIN



309
310
# File 'lib/hts/libhts/vcf_funcs.rb', line 309

def bcf_int16_missing    = (-32_767 - 1)
# INT32_MIN

.bcf_int16_vector_endObject

INT16_MIN + 1



300
301
# File 'lib/hts/libhts/vcf_funcs.rb', line 300

def bcf_int16_vector_end = -32_767
# INT32_MIN + 1

.bcf_int32_missingObject

INT32_MIN



311
312
# File 'lib/hts/libhts/vcf_funcs.rb', line 311

def bcf_int32_missing    = (-2_147_483_647 - 1)
# INT64_MIN

.bcf_int32_vector_endObject

INT32_MIN + 1



302
303
# File 'lib/hts/libhts/vcf_funcs.rb', line 302

def bcf_int32_vector_end = -2_147_483_647
# INT64_MIN + 1

.bcf_int64_missingObject

INT64_MIN



313
# File 'lib/hts/libhts/vcf_funcs.rb', line 313

def bcf_int64_missing    = (-9_223_372_036_854_775_807 - 1)

.bcf_int64_vector_endObject

INT64_MIN + 1



304
# File 'lib/hts/libhts/vcf_funcs.rb', line 304

def bcf_int64_vector_end = -9_223_372_036_854_775_807

.bcf_int8_missingObject

INT8_MIN



307
308
# File 'lib/hts/libhts/vcf_funcs.rb', line 307

def bcf_int8_missing     = -128
# INT16_MIN

.bcf_int8_vector_endObject

Typed value I/O INT8_MIN + 1



298
299
# File 'lib/hts/libhts/vcf_funcs.rb', line 298

def bcf_int8_vector_end  = -127
# INT16_MIN + 1

.bcf_is_snp([Bcf1]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



354
355
356
357
# File 'lib/hts/libhts/vcf.rb', line 354

attach_function \
:bcf_is_snp,
[Bcf1],
:int

.bcf_itr_queryi(idx, tid, beg, _end) ⇒ Object



274
275
276
# File 'lib/hts/libhts/vcf_funcs.rb', line 274

def bcf_itr_queryi(idx, tid, beg, _end)
  hts_itr_query(idx, tid, beg, _end, @ffi_functions[:bcf_readrec])
end

.bcf_itr_querys(idx, hdr, s) ⇒ Object



282
283
284
# File 'lib/hts/libhts/vcf_funcs.rb', line 282

def bcf_itr_querys(idx, hdr, s)
  hts_itr_querys(idx, s, @@bcf_hdr_name2id, hdr, @ffi_functions[:hts_itr_query], @ffi_functions[:bcf_readrec])
end

.bcf_read([HtsFile, BcfHdr, Bcf1]) ⇒ int Also known as: bcf_read1

Read next VCF or BCF record

Returns:

  • (int)

    the return value of attach_function



90
91
92
93
# File 'lib/hts/libhts/vcf.rb', line 90

attach_function \
:bcf_read,
[HtsFile, BcfHdr, Bcf1],
:int

.bcf_readrec(pointer) ⇒ int

Helper function for the bcf_itr_next() macro

Returns:

  • (int)

    the return value of attach_function



143
144
145
146
# File 'lib/hts/libhts/vcf.rb', line 143

attach_function \
:bcf_readrec,
[BGZF, :pointer, :pointer, :pointer, :hts_pos_t, :hts_pos_t],
:int

.bcf_remove_filter(int) ⇒ int

Removes from the FILTER column

Returns:

  • (int)

    the return value of attach_function



372
373
374
375
# File 'lib/hts/libhts/vcf.rb', line 372

attach_function \
:bcf_remove_filter,
[BcfHdr, Bcf1, :int, :int],
:int

.bcf_str_missingObject



314
# File 'lib/hts/libhts/vcf_funcs.rb', line 314

def bcf_str_missing      = 0x07

.bcf_str_vector_endObject



305
306
# File 'lib/hts/libhts/vcf_funcs.rb', line 305

def bcf_str_vector_end   = 0
# INT8_MIN

.bcf_strerror(int) ⇒ string

Get error description for bcf error code

Returns:

  • (string)

    the return value of attach_function



6
7
8
9
# File 'lib/hts/libhts/vcf.rb', line 6

attach_function \
:bcf_strerror,
%i[int pointer size_t],
:string

.bcf_subset(int) ⇒ int

See the description of bcf_hdr_subset()

Returns:

  • (int)

    the return value of attach_function



313
314
315
316
# File 'lib/hts/libhts/vcf.rb', line 313

attach_function \
:bcf_subset,
[BcfHdr, Bcf1, :int, :pointer],
:int

.bcf_subset_format([BcfHdr, Bcf1]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



60
61
62
63
# File 'lib/hts/libhts/vcf.rb', line 60

attach_function \
:bcf_subset_format,
[BcfHdr, Bcf1],
:int

.bcf_translate([BcfHdr, BcfHdr, Bcf1]) ⇒ int

Translate tags ids to be consistent with different header.

Returns:

  • (int)

    the return value of attach_function



319
320
321
322
# File 'lib/hts/libhts/vcf.rb', line 319

attach_function \
:bcf_translate,
[BcfHdr, BcfHdr, Bcf1],
:int

.bcf_unpack(int) ⇒ int

unpack/decode a BCF record (fills the bcf1_t::d field)

Returns:

  • (int)

    the return value of attach_function



96
97
98
99
# File 'lib/hts/libhts/vcf.rb', line 96

attach_function \
:bcf_unpack,
[Bcf1, :int],
:int

.bcf_update_alleles(pointer) ⇒ int

Update REF and ALT column

Returns:

  • (int)

    the return value of attach_function



385
386
387
388
# File 'lib/hts/libhts/vcf.rb', line 385

attach_function \
:bcf_update_alleles,
[BcfHdr, Bcf1, :pointer, :int],
:int

.bcf_update_alleles_str(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



390
391
392
393
# File 'lib/hts/libhts/vcf.rb', line 390

attach_function \
:bcf_update_alleles_str,
[BcfHdr, Bcf1, :string],
:int

.bcf_update_filter(pointer) ⇒ int

Sets the FILTER column

Returns:

  • (int)

    the return value of attach_function



360
361
362
363
# File 'lib/hts/libhts/vcf.rb', line 360

attach_function \
:bcf_update_filter,
[BcfHdr, Bcf1, :pointer, :int],
:int

.bcf_update_format(string) ⇒ int

Functions for updating FORMAT fields

Returns:

  • (int)

    the return value of attach_function



418
419
420
421
# File 'lib/hts/libhts/vcf.rb', line 418

attach_function \
:bcf_update_format,
[BcfHdr, Bcf1, :string, :pointer, :int, :int],
:int

.bcf_update_format_char(hdr, line, key, values, n) ⇒ Object

Function for updating FORMAT fields



128
129
130
131
# File 'lib/hts/libhts/vcf_funcs.rb', line 128

def bcf_update_format_char(hdr, line, key, values, n)
  bcf_update_format(hdr, line, key, values, n,
                    BCF_HT_STR)
end

.bcf_update_format_float(hdr, line, key, values, n) ⇒ Object

Function for updating FORMAT fields



122
123
124
125
# File 'lib/hts/libhts/vcf_funcs.rb', line 122

def bcf_update_format_float(hdr, line, key, values, n)
  bcf_update_format(hdr, line, key, values, n,
                    BCF_HT_REAL)
end

.bcf_update_format_int32(hdr, line, key, values, n) ⇒ Object

Function for updating FORMAT fields



116
117
118
119
# File 'lib/hts/libhts/vcf_funcs.rb', line 116

def bcf_update_format_int32(hdr, line, key, values, n)
  bcf_update_format(hdr, line, key, values, n,
                    BCF_HT_INT)
end

.bcf_update_format_string(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



412
413
414
415
# File 'lib/hts/libhts/vcf.rb', line 412

attach_function \
:bcf_update_format_string,
[BcfHdr, Bcf1, :string, :pointer, :int],
:int

.bcf_update_genotypes(hdr, line, gts, n) ⇒ Object

Function for updating FORMAT fields



134
135
136
# File 'lib/hts/libhts/vcf_funcs.rb', line 134

def bcf_update_genotypes(hdr, line, gts, n)
  bcf_update_format(hdr, line, "GT", gts, n, BCF_HT_INT)
end

.bcf_update_id(string) ⇒ int

Sets new ID string

Returns:

  • (int)

    the return value of attach_function



396
397
398
399
# File 'lib/hts/libhts/vcf.rb', line 396

attach_function \
:bcf_update_id,
[BcfHdr, Bcf1, :string],
:int

.bcf_update_info(string) ⇒ int

Functions for updating INFO fields

Returns:

  • (int)

    the return value of attach_function



407
408
409
410
# File 'lib/hts/libhts/vcf.rb', line 407

attach_function \
:bcf_update_info,
[BcfHdr, Bcf1, :string, :pointer, :int, :int],
:int

.bcf_update_info_flag(hdr, line, key, string, n) ⇒ Object

Function for updating INFO fields



106
107
108
# File 'lib/hts/libhts/vcf_funcs.rb', line 106

def bcf_update_info_flag(hdr, line, key, string, n)
  bcf_update_info(hdr, line, key, string, n, BCF_HT_FLAG)
end

.bcf_update_info_float(hdr, line, key, values, n) ⇒ Object

Function for updating INFO fields



101
102
103
# File 'lib/hts/libhts/vcf_funcs.rb', line 101

def bcf_update_info_float(hdr, line, key, values, n)
  bcf_update_info(hdr, line, key, values, n, BCF_HT_REAL)
end

.bcf_update_info_int32(hdr, line, key, values, n) ⇒ Object

Function for updating INFO fields



96
97
98
# File 'lib/hts/libhts/vcf_funcs.rb', line 96

def bcf_update_info_int32(hdr, line, key, values, n)
  bcf_update_info(hdr, line, key, values, n, BCF_HT_INT)
end

.bcf_update_info_string(hdr, line, key, string) ⇒ Object

Function for updating INFO fields



111
112
113
# File 'lib/hts/libhts/vcf_funcs.rb', line 111

def bcf_update_info_string(hdr, line, key, string)
  bcf_update_info(hdr, line, key, string, 1, BCF_HT_STR)
end

.bcf_variant_length(int) ⇒ int

Return the number of bases affected by a variant, for a given allele

Returns:

  • (int)

    the return value of attach_function



349
350
351
352
# File 'lib/hts/libhts/vcf.rb', line 349

attach_function \
:bcf_variant_length,
[Bcf1, :int],
:int

.bcf_write([HtsFile, BcfHdr, Bcf1]) ⇒ int Also known as: bcf_write1

Write one VCF or BCF record.

Returns:

  • (int)

    the return value of attach_function



113
114
115
116
# File 'lib/hts/libhts/vcf.rb', line 113

attach_function \
:bcf_write,
[HtsFile, BcfHdr, Bcf1],
:int

.bgzf_block_write(pointer) ⇒ ssize_t

Write length bytes from data to the file, the index will be used to decide the amount of uncompressed data to be written to each bgzip block.

Returns:

  • (ssize_t)

    the return value of attach_function



45
46
47
48
# File 'lib/hts/libhts/bgzf.rb', line 45

attach_function \
:bgzf_block_write,
[BGZF, :pointer, :size_t],
:ssize_t

.bgzf_check_EOF([BGZF]) ⇒ int

Check if the BGZF end-of-file (EOF) marker is present

Returns:

  • (int)

    the return value of attach_function



90
91
92
93
# File 'lib/hts/libhts/bgzf.rb', line 90

attach_function \
:bgzf_check_EOF,
[BGZF],
:int

.bgzf_close([HFile]) ⇒ int

Close the BGZF and free all associated resources.

Returns:

  • (int)

    the return value of attach_function



25
26
27
28
# File 'lib/hts/libhts/bgzf.rb', line 25

attach_function \
:bgzf_close,
[HFile],
:int

.bgzf_compress(pointer) ⇒ int

Compress a single BGZF block.

Returns:

  • (int)

    the return value of attach_function



152
153
154
155
# File 'lib/hts/libhts/bgzf.rb', line 152

attach_function \
:bgzf_compress,
%i[pointer pointer pointer size_t int],
:int

.bgzf_compression([BGZF]) ⇒ int

Return the file’s compression format

Returns:

  • (int)

    the return value of attach_function



96
97
98
99
# File 'lib/hts/libhts/bgzf.rb', line 96

attach_function \
:bgzf_compression,
[BGZF],
:int

.bgzf_dopen(int) ⇒ by_ref

Open an existing file descriptor for reading or writing.

Returns:

  • (by_ref)

    the return value of attach_function



7
8
9
10
# File 'lib/hts/libhts/bgzf.rb', line 7

attach_function \
:bgzf_dopen,
%i[int string],
BGZF.by_ref

.bgzf_flush([BGZF]) ⇒ int

Write the data in the buffer to the file.

Returns:

  • (int)

    the return value of attach_function



73
74
75
76
# File 'lib/hts/libhts/bgzf.rb', line 73

attach_function \
:bgzf_flush,
[BGZF],
:int

.bgzf_flush_try(ssize_t) ⇒ int

Flush the file if the remaining buffer size is smaller than size

Returns:

  • (int)

    the return value of attach_function



114
115
116
117
# File 'lib/hts/libhts/bgzf.rb', line 114

attach_function \
:bgzf_flush_try,
[BGZF, :ssize_t],
:int

.bgzf_getc([BGZF]) ⇒ int

Read one byte from a BGZF file. It is faster than bgzf_read()

Returns:

  • (int)

    the return value of attach_function



120
121
122
123
# File 'lib/hts/libhts/bgzf.rb', line 120

attach_function \
:bgzf_getc,
[BGZF],
:int

.bgzf_getline(int) ⇒ int

Read one line from a BGZF file. It is faster than bgzf_getc()

Returns:

  • (int)

    the return value of attach_function



126
127
128
129
# File 'lib/hts/libhts/bgzf.rb', line 126

attach_function \
:bgzf_getline,
[BGZF, :int, KString],
:int

.bgzf_hopen(string) ⇒ by_ref

Open an existing hFILE stream for reading or writing.

Returns:

  • (by_ref)

    the return value of attach_function



19
20
21
22
# File 'lib/hts/libhts/bgzf.rb', line 19

attach_function \
:bgzf_hopen,
[HFile, :string],
BGZF.by_ref

.bgzf_index_build_init([BGZF]) ⇒ int

Tell BGZF to build index while compressing.

Returns:

  • (int)

    the return value of attach_function



170
171
172
173
# File 'lib/hts/libhts/bgzf.rb', line 170

attach_function \
:bgzf_index_build_init,
[BGZF],
:int

.bgzf_index_dump(string) ⇒ int

Save BGZF index

Returns:

  • (int)

    the return value of attach_function



188
189
190
191
# File 'lib/hts/libhts/bgzf.rb', line 188

attach_function \
:bgzf_index_dump,
[BGZF, :string, :string],
:int

.bgzf_index_dump_hfile(string) ⇒ int

Write a BGZF index to an hFILE

Returns:

  • (int)

    the return value of attach_function



194
195
196
197
# File 'lib/hts/libhts/bgzf.rb', line 194

attach_function \
:bgzf_index_dump_hfile,
[BGZF, HFile, :string],
:int

.bgzf_index_load(string) ⇒ int

Load BGZF index

Returns:

  • (int)

    the return value of attach_function



176
177
178
179
# File 'lib/hts/libhts/bgzf.rb', line 176

attach_function \
:bgzf_index_load,
[BGZF, :string, :string],
:int

.bgzf_index_load_hfile(string) ⇒ int

Load BGZF index from an hFILE

Returns:

  • (int)

    the return value of attach_function



182
183
184
185
# File 'lib/hts/libhts/bgzf.rb', line 182

attach_function \
:bgzf_index_load_hfile,
[BGZF, HFile, :string],
:int

.bgzf_is_bgzf(string) ⇒ int

Check if a file is in the BGZF format

Returns:

  • (int)

    the return value of attach_function



102
103
104
105
# File 'lib/hts/libhts/bgzf.rb', line 102

attach_function \
:bgzf_is_bgzf,
[:string],
:int

.bgzf_mt(int) ⇒ int

Enable multi-threading (only effective when the library was compiled with -DBGZF_MT)

Returns:

  • (int)

    the return value of attach_function



146
147
148
149
# File 'lib/hts/libhts/bgzf.rb', line 146

attach_function \
:bgzf_mt,
[BGZF, :int, :int],
:int

.bgzf_open(string) ⇒ by_ref

Open the specified file for reading or writing.

Returns:

  • (by_ref)

    the return value of attach_function



13
14
15
16
# File 'lib/hts/libhts/bgzf.rb', line 13

attach_function \
:bgzf_open,
%i[string string],
BGZF.by_ref

.bgzf_peek([BGZF]) ⇒ int

Returns the next byte in the file without consuming it.

Returns:

  • (int)

    the return value of attach_function



51
52
53
54
# File 'lib/hts/libhts/bgzf.rb', line 51

attach_function \
:bgzf_peek,
[BGZF],
:int

.bgzf_raw_read(pointer) ⇒ ssize_t

Read up to length bytes directly from the underlying stream without decompressing. Bypasses BGZF blocking, so must be used with care in specialised circumstances only.

Returns:

  • (ssize_t)

    the return value of attach_function



59
60
61
62
# File 'lib/hts/libhts/bgzf.rb', line 59

attach_function \
:bgzf_raw_read,
[BGZF, :pointer, :size_t],
:ssize_t

.bgzf_raw_write(pointer) ⇒ ssize_t

Write length bytes directly to the underlying stream without compressing. Bypasses BGZF blocking, so must be used with care in specialised circumstances only.

Returns:

  • (ssize_t)

    the return value of attach_function



67
68
69
70
# File 'lib/hts/libhts/bgzf.rb', line 67

attach_function \
:bgzf_raw_write,
[BGZF, :pointer, :size_t],
:ssize_t

.bgzf_read(pointer) ⇒ ssize_t

Read up to length bytes from the file storing into data.

Returns:

  • (ssize_t)

    the return value of attach_function



31
32
33
34
# File 'lib/hts/libhts/bgzf.rb', line 31

attach_function \
:bgzf_read,
[HFile, :pointer, :size_t],
:ssize_t

.bgzf_read_block([BGZF]) ⇒ int

Read the next BGZF block.

Returns:

  • (int)

    the return value of attach_function



132
133
134
135
# File 'lib/hts/libhts/bgzf.rb', line 132

attach_function \
:bgzf_read_block,
[BGZF],
:int

.bgzf_seek(int64) ⇒ int64

Set the file to read from the location specified by pos.

Returns:

  • (int64)

    the return value of attach_function



84
85
86
87
# File 'lib/hts/libhts/bgzf.rb', line 84

attach_function \
:bgzf_seek,
[BGZF, :int64, :int],
:int64

.bgzf_set_cache_size(int) ⇒ void

This method returns an undefined value.

Set the cache size. Only effective when compiled with -DBGZF_CACHE.



108
109
110
111
# File 'lib/hts/libhts/bgzf.rb', line 108

attach_function \
:bgzf_set_cache_size,
[BGZF, :int],
:void

.bgzf_tell(fp) ⇒ Object

Return a virtual file pointer to the current location in the file.



79
80
81
# File 'lib/hts/libhts/bgzf.rb', line 79

def self.bgzf_tell(fp)
  (fp[:block_address] << 16) | (fp[:block_offset] & 0xFFFF)
end

.bgzf_thread_pool(pointer) ⇒ int

Enable multi-threading (when compiled with -DBGZF_MT) via a shared thread pool.

Returns:

  • (int)

    the return value of attach_function



139
140
141
142
# File 'lib/hts/libhts/bgzf.rb', line 139

attach_function \
:bgzf_thread_pool,
[BGZF, :pointer, :int],
:int

.bgzf_useek(off_t) ⇒ int

Position BGZF at the uncompressed offset

Returns:

  • (int)

    the return value of attach_function



158
159
160
161
# File 'lib/hts/libhts/bgzf.rb', line 158

attach_function \
:bgzf_useek,
[BGZF, :off_t, :int],
:int

.bgzf_utell([BGZF]) ⇒ off_t

Position in uncompressed BGZF

Returns:

  • (off_t)

    the return value of attach_function



164
165
166
167
# File 'lib/hts/libhts/bgzf.rb', line 164

attach_function \
:bgzf_utell,
[BGZF],
:off_t

.bgzf_write(pointer) ⇒ ssize_t

Write length bytes from data to the file. If no I/O errors occur, the complete length bytes will be written (or queued for writing).

Returns:

  • (ssize_t)

    the return value of attach_function



38
39
40
41
# File 'lib/hts/libhts/bgzf.rb', line 38

attach_function \
:bgzf_write,
[BGZF, :pointer, :size_t],
:ssize_t

.cram_block_append(cram_block) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



169
170
171
172
# File 'lib/hts/libhts/cram.rb', line 169

attach_function \
:cram_block_append,
%i[cram_block pointer int],
:int

.cram_block_get_comp_size(cram_block) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



109
110
111
112
# File 'lib/hts/libhts/cram.rb', line 109

attach_function \
:cram_block_get_comp_size,
[:cram_block],
:int32

.cram_block_get_content_id(cram_block) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



104
105
106
107
# File 'lib/hts/libhts/cram.rb', line 104

attach_function \
:cram_block_get_content_id,
[:cram_block],
:int32

.cram_block_get_content_type(cram_block) ⇒ CramContentType

Returns the return value of attach_function.

Returns:



129
130
131
132
# File 'lib/hts/libhts/cram.rb', line 129

attach_function \
:cram_block_get_content_type,
[:cram_block],
CramContentType

.cram_block_get_crc32(cram_block) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



119
120
121
122
# File 'lib/hts/libhts/cram.rb', line 119

attach_function \
:cram_block_get_crc32,
[:cram_block],
:int32

.cram_block_get_data(cram_block) ⇒ pointer

Returns the return value of attach_function.

Returns:

  • (pointer)

    the return value of attach_function



124
125
126
127
# File 'lib/hts/libhts/cram.rb', line 124

attach_function \
:cram_block_get_data,
[:cram_block],
:pointer

.cram_block_get_method(cram_block) ⇒ CramBlockMethod

Returns the return value of attach_function.

Returns:



134
135
136
137
# File 'lib/hts/libhts/cram.rb', line 134

attach_function \
:cram_block_get_method,
[:cram_block],
CramBlockMethod

.cram_block_get_offset(cram_block) ⇒ size_t

Returns the return value of attach_function.

Returns:

  • (size_t)

    the return value of attach_function



179
180
181
182
# File 'lib/hts/libhts/cram.rb', line 179

attach_function \
:cram_block_get_offset,
[:cram_block],
:size_t

.cram_block_get_uncomp_size(cram_block) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



114
115
116
117
# File 'lib/hts/libhts/cram.rb', line 114

attach_function \
:cram_block_get_uncomp_size,
[:cram_block],
:int32

.cram_block_set_comp_size(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



149
150
151
152
# File 'lib/hts/libhts/cram.rb', line 149

attach_function \
:cram_block_set_comp_size,
%i[cram_block int32],
:void

.cram_block_set_content_id(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



144
145
146
147
# File 'lib/hts/libhts/cram.rb', line 144

attach_function \
:cram_block_set_content_id,
%i[cram_block int32],
:void

.cram_block_set_crc32(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



159
160
161
162
# File 'lib/hts/libhts/cram.rb', line 159

attach_function \
:cram_block_set_crc32,
%i[cram_block int32],
:void

.cram_block_set_data(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



164
165
166
167
# File 'lib/hts/libhts/cram.rb', line 164

attach_function \
:cram_block_set_data,
%i[cram_block pointer],
:void

.cram_block_set_offset(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



184
185
186
187
# File 'lib/hts/libhts/cram.rb', line 184

attach_function \
:cram_block_set_offset,
%i[cram_block size_t],
:void

.cram_block_set_uncomp_size(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



154
155
156
157
# File 'lib/hts/libhts/cram.rb', line 154

attach_function \
:cram_block_set_uncomp_size,
%i[cram_block int32],
:void

.cram_block_size(cram_block) ⇒ uint32

Computes the size of a cram block, including the block header itself.

Returns:

  • (uint32)

    the return value of attach_function



190
191
192
193
# File 'lib/hts/libhts/cram.rb', line 190

attach_function \
:cram_block_size,
[:cram_block],
:uint32

.cram_block_update_size(cram_block) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



174
175
176
177
# File 'lib/hts/libhts/cram.rb', line 174

attach_function \
:cram_block_update_size,
[:cram_block],
:void

.cram_check_EOF(cram_fd) ⇒ int

Check if this file has a proper EOF block

Returns:

  • (int)

    the return value of attach_function



429
430
431
432
# File 'lib/hts/libhts/cram.rb', line 429

attach_function \
:cram_check_EOF,
[:cram_fd],
:int

.cram_cid2ds_free(pointer) ⇒ void

This method returns an undefined value.

Frees a cram_cid2ds_t allocated by cram_update_cid2ds_map



253
254
255
256
# File 'lib/hts/libhts/cram.rb', line 253

attach_function \
:cram_cid2ds_free,
[:pointer],
:void

.cram_cid2ds_query(pointer) ⇒ int

Return a list of data series observed as belonging to a block with the specified content_id.

Returns:

  • (int)

    the return value of attach_function



247
248
249
250
# File 'lib/hts/libhts/cram.rb', line 247

attach_function \
:cram_cid2ds_query,
%i[pointer int pointer],
:int

.cram_close(cram_fd) ⇒ int

Closes a CRAM file.

Returns:

  • (int)

    the return value of attach_function



387
388
389
390
# File 'lib/hts/libhts/cram.rb', line 387

attach_function \
:cram_close,
[:cram_fd],
:int

.cram_codec_describe(pointer) ⇒ int

Produces a human readable description of the codec parameters.

Returns:

  • (int)

    the return value of attach_function



202
203
204
205
# File 'lib/hts/libhts/cram.rb', line 202

attach_function \
:cram_codec_describe,
[:pointer, KString.ptr],
:int

.cram_codec_get_content_ids(pointer) ⇒ void

This method returns an undefined value.

Returns the Block Content ID values referred to by a cram_codec in ids.



196
197
198
199
# File 'lib/hts/libhts/cram.rb', line 196

attach_function \
:cram_codec_get_content_ids,
%i[pointer pointer],
:void

.cram_compress_block(cram_fd) ⇒ int

Compresses a block.

Returns:

  • (int)

    the return value of attach_function



328
329
330
331
# File 'lib/hts/libhts/cram.rb', line 328

attach_function \
:cram_compress_block,
%i[cram_fd cram_block cram_metrics int int],
:int

.cram_container_get_coords(cram_container) ⇒ void

This method returns an undefined value.

Returns chromosome and start/span from container struct



99
100
101
102
# File 'lib/hts/libhts/cram.rb', line 99

attach_function \
:cram_container_get_coords,
%i[cram_container pointer pointer],
:void

.cram_container_get_landmarks(cram_container) ⇒ pointer

Returns the return value of attach_function.

Returns:

  • (pointer)

    the return value of attach_function



72
73
74
75
# File 'lib/hts/libhts/cram.rb', line 72

attach_function \
:cram_container_get_landmarks,
%i[cram_container int32],
:pointer

.cram_container_get_length(cram_container) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



52
53
54
55
# File 'lib/hts/libhts/cram.rb', line 52

attach_function \
:cram_container_get_length,
[:cram_container],
:int32

.cram_container_get_num_bases(cram_container) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



87
88
89
90
# File 'lib/hts/libhts/cram.rb', line 87

attach_function \
:cram_container_get_num_bases,
[:cram_container],
:int32

.cram_container_get_num_blocks(cram_container) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



62
63
64
65
# File 'lib/hts/libhts/cram.rb', line 62

attach_function \
:cram_container_get_num_blocks,
[:cram_container],
:int32

.cram_container_get_num_records(cram_container) ⇒ int32

Returns the return value of attach_function.

Returns:

  • (int32)

    the return value of attach_function



82
83
84
85
# File 'lib/hts/libhts/cram.rb', line 82

attach_function \
:cram_container_get_num_records,
[:cram_container],
:int32

.cram_container_is_empty(cram_fd) ⇒ int

Returns true if the container is empty (EOF marker)

Returns:

  • (int)

    the return value of attach_function



93
94
95
96
# File 'lib/hts/libhts/cram.rb', line 93

attach_function \
:cram_container_is_empty,
[:cram_fd],
:int

.cram_container_num2offset(cram_fd) ⇒ off_t

Returns the byte offset for the start of the n^th container.

Returns:

  • (off_t)

    the return value of attach_function



465
466
467
468
# File 'lib/hts/libhts/cram.rb', line 465

attach_function \
:cram_container_num2offset,
%i[cram_fd int64],
:off_t

.cram_container_offset2num(cram_fd) ⇒ int64

Returns the container number for the first container at offset >= pos.

Returns:

  • (int64)

    the return value of attach_function



471
472
473
474
# File 'lib/hts/libhts/cram.rb', line 471

attach_function \
:cram_container_offset2num,
%i[cram_fd off_t],
:int64

.cram_container_set_landmarks(cram_container) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



77
78
79
80
# File 'lib/hts/libhts/cram.rb', line 77

attach_function \
:cram_container_set_landmarks,
%i[cram_container int32 pointer],
:void

.cram_container_set_length(cram_container) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



57
58
59
60
# File 'lib/hts/libhts/cram.rb', line 57

attach_function \
:cram_container_set_length,
%i[cram_container int32],
:void

.cram_container_set_num_blocks(cram_container) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



67
68
69
70
# File 'lib/hts/libhts/cram.rb', line 67

attach_function \
:cram_container_set_num_blocks,
%i[cram_container int32],
:void

.cram_container_size(cram_container) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



369
370
371
372
# File 'lib/hts/libhts/cram.rb', line 369

attach_function \
:cram_container_size,
[:cram_container],
:int

.cram_copy_slice(cram_fd) ⇒ int

Copies the blocks representing the next num_slice slices from a container from ‘in’ to ‘out’.

Returns:

  • (int)

    the return value of attach_function



215
216
217
218
# File 'lib/hts/libhts/cram.rb', line 215

attach_function \
:cram_copy_slice,
%i[cram_fd cram_fd int32],
:int

.cram_decode_compression_header(cram_fd) ⇒ pointer

Decodes a CRAM block compression header.

Returns:

  • (pointer)

    the return value of attach_function



228
229
230
231
# File 'lib/hts/libhts/cram.rb', line 228

attach_function \
:cram_decode_compression_header,
%i[cram_fd cram_block],
:pointer

.cram_decode_slice_header(pointer) ⇒ pointer

Decodes a slice header from a cram block.

Returns:

  • (pointer)

    the return value of attach_function



285
286
287
288
# File 'lib/hts/libhts/cram.rb', line 285

attach_function \
:cram_decode_slice_header,
%i[pointer pointer],
:pointer

.cram_describe_encodings(pointer) ⇒ int

Produces a description of the record and tag encodings held within a compression header and appends to ‘ks’.

Returns:

  • (int)

    the return value of attach_function



260
261
262
263
# File 'lib/hts/libhts/cram.rb', line 260

attach_function \
:cram_describe_encodings,
[:pointer, KString.ptr],
:int

.cram_dopen(pointer) ⇒ cram_fd

Opens an existing stream for reading or writing.

Returns:

  • (cram_fd)

    the return value of attach_function



381
382
383
384
# File 'lib/hts/libhts/cram.rb', line 381

attach_function \
:cram_dopen,
%i[pointer string string],
:cram_fd

.cram_eof(cram_fd) ⇒ int

Checks for end of file on a cram_fd stream.

Returns:

  • (int)

    the return value of attach_function



405
406
407
408
# File 'lib/hts/libhts/cram.rb', line 405

attach_function \
:cram_eof,
[:cram_fd],
:int

.cram_expand_method(pointer) ⇒ pointer

Returns the return value of attach_function.

Returns:

  • (pointer)

    the return value of attach_function



139
140
141
142
# File 'lib/hts/libhts/cram.rb', line 139

attach_function \
:cram_expand_method,
[:pointer, :int32, CramBlockMethod],
:pointer

.cram_fd_get_fp(cram_fd) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



42
43
44
45
# File 'lib/hts/libhts/cram.rb', line 42

attach_function \
:cram_fd_get_fp,
[:cram_fd],
HFile.by_ref

.cram_fd_get_header(cram_fd) ⇒ by_ref

cram_fd

Returns:

  • (by_ref)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/cram.rb', line 12

attach_function \
:cram_fd_get_header,
[:cram_fd],
SamHdr.by_ref

.cram_fd_get_version(cram_fd) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



22
23
24
25
# File 'lib/hts/libhts/cram.rb', line 22

attach_function \
:cram_fd_get_version,
[:cram_fd],
:int

.cram_fd_set_fp(cram_fd) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



47
48
49
50
# File 'lib/hts/libhts/cram.rb', line 47

attach_function \
:cram_fd_set_fp,
[:cram_fd, HFile],
:void

.cram_fd_set_header(cram_fd) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



17
18
19
20
# File 'lib/hts/libhts/cram.rb', line 17

attach_function \
:cram_fd_set_header,
[:cram_fd, SamHdr.by_ref],
:void

.cram_fd_set_version(cram_fd) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



27
28
29
30
# File 'lib/hts/libhts/cram.rb', line 27

attach_function \
:cram_fd_set_version,
%i[cram_fd int],
:void

.cram_filter_container(cram_fd) ⇒ int

Copies a container, but filtering it down to a specific region (as already specified in ‘in’

Returns:

  • (int)

    the return value of attach_function



222
223
224
225
# File 'lib/hts/libhts/cram.rb', line 222

attach_function \
:cram_filter_container,
%i[cram_fd cram_fd cram_container pointer],
:int

.cram_flush(cram_fd) ⇒ int

Flushes a CRAM file.

Returns:

  • (int)

    the return value of attach_function



399
400
401
402
# File 'lib/hts/libhts/cram.rb', line 399

attach_function \
:cram_flush,
[:cram_fd],
:int

.cram_free_block(cram_block) ⇒ void

This method returns an undefined value.

Frees a CRAM block, deallocating internal data too.



316
317
318
319
# File 'lib/hts/libhts/cram.rb', line 316

attach_function \
:cram_free_block,
[:cram_block],
:void

.cram_free_compression_header(pointer) ⇒ void

This method returns an undefined value.

Frees a cram_block_compression_hdr structure.



234
235
236
237
# File 'lib/hts/libhts/cram.rb', line 234

attach_function \
:cram_free_compression_header,
[:pointer],
:void

.cram_free_container(cram_container) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



345
346
347
348
# File 'lib/hts/libhts/cram.rb', line 345

attach_function \
:cram_free_container,
[:cram_container],
:void

.cram_free_slice_header(pointer) ⇒ void

This method returns an undefined value.

Frees a cram_block_slice_hdr structure.



291
292
293
294
# File 'lib/hts/libhts/cram.rb', line 291

attach_function \
:cram_free_slice_header,
[:pointer],
:void

.cram_get_refs(by_ref) ⇒ pointer

Returns the refs_t structure used by a cram file handle.

Returns:

  • (pointer)

    the return value of attach_function



441
442
443
444
# File 'lib/hts/libhts/cram.rb', line 441

attach_function \
:cram_get_refs,
[HtsFile.by_ref],
:pointer

.cram_index_extents(cram_fd) ⇒ int

Returns the file offsets of CRAM slices covering a specific region query.

Returns:

  • (int)

    the return value of attach_function



447
448
449
450
# File 'lib/hts/libhts/cram.rb', line 447

attach_function \
:cram_index_extents,
%i[cram_fd int hts_pos_t hts_pos_t pointer pointer],
:int

.cram_major_vers(cram_fd) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



32
33
34
35
# File 'lib/hts/libhts/cram.rb', line 32

attach_function \
:cram_major_vers,
[:cram_fd],
:int

.cram_minor_vers(cram_fd) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



37
38
39
40
# File 'lib/hts/libhts/cram.rb', line 37

attach_function \
:cram_minor_vers,
[:cram_fd],
:int

.cram_new_block(int) ⇒ cram_block

Allocates a new cram_block structure with a specified content_type and id.

Returns:

  • (cram_block)

    the return value of attach_function



298
299
300
301
# File 'lib/hts/libhts/cram.rb', line 298

attach_function \
:cram_new_block,
[CramContentType, :int],
:cram_block

.cram_new_container(int) ⇒ cram_container

Creates a new container, specifying the maximum number of slices and records permitted.

Returns:

  • (cram_container)

    the return value of attach_function



340
341
342
343
# File 'lib/hts/libhts/cram.rb', line 340

attach_function \
:cram_new_container,
%i[int int],
:cram_container

.cram_num_containers(cram_fd) ⇒ int64

Returns the total number of containers in the CRAM index.

Returns:

  • (int64)

    the return value of attach_function



453
454
455
456
# File 'lib/hts/libhts/cram.rb', line 453

attach_function \
:cram_num_containers,
[:cram_fd],
:int64

.cram_num_containers_between(cram_fd) ⇒ int64

Returns the number of containers in the CRAM index within given offsets.

Returns:

  • (int64)

    the return value of attach_function



459
460
461
462
# File 'lib/hts/libhts/cram.rb', line 459

attach_function \
:cram_num_containers_between,
%i[cram_fd off_t off_t pointer pointer],
:int64

.cram_open(string) ⇒ cram_fd

Opens a CRAM file for read (mode “rb”) or write (“wb”).

Returns:

  • (cram_fd)

    the return value of attach_function



375
376
377
378
# File 'lib/hts/libhts/cram.rb', line 375

attach_function \
:cram_open,
%i[string string],
:cram_fd

.cram_read_block(cram_fd) ⇒ cram_block

Reads a block from a cram file.

Returns:

  • (cram_block)

    the return value of attach_function



304
305
306
307
# File 'lib/hts/libhts/cram.rb', line 304

attach_function \
:cram_read_block,
[:cram_fd],
:cram_block

.cram_read_container(cram_fd) ⇒ cram_container

Reads a container header.

Returns:

  • (cram_container)

    the return value of attach_function



351
352
353
354
# File 'lib/hts/libhts/cram.rb', line 351

attach_function \
:cram_read_container,
[:cram_fd],
:cram_container

.cram_seek(pointer) ⇒ int

Seek within a CRAM file.

Returns:

  • (int)

    the return value of attach_function



393
394
395
396
# File 'lib/hts/libhts/cram.rb', line 393

attach_function \
:cram_seek,
%i[pointer off_t int],
:int

.cram_set_header(cram_fd) ⇒ int

Attaches a header to a cram_fd.

Returns:

  • (int)

    the return value of attach_function



423
424
425
426
# File 'lib/hts/libhts/cram.rb', line 423

attach_function \
:cram_set_header,
[:cram_fd, SamHdr.by_ref],
:int

.cram_set_option(cram_fd) ⇒ int

Sets options on the cram_fd.

Returns:

  • (int)

    the return value of attach_function



411
412
413
414
# File 'lib/hts/libhts/cram.rb', line 411

attach_function \
:cram_set_option,
[:cram_fd, HtsFmtOption, :varargs],
:int

.cram_set_voption(cram_fd) ⇒ int

Sets options on the cram_fd.

Returns:

  • (int)

    the return value of attach_function



417
418
419
420
# File 'lib/hts/libhts/cram.rb', line 417

attach_function \
:cram_set_voption,
[:cram_fd, HtsFmtOption, :pointer], # va_list
:int

.cram_slice_hdr_get_coords(pointer) ⇒ void

This method returns an undefined value.

Returns slice reference ID, start and span (length) coordinates.



279
280
281
282
# File 'lib/hts/libhts/cram.rb', line 279

attach_function \
:cram_slice_hdr_get_coords,
%i[pointer pointer pointer pointer],
:void

.cram_slice_hdr_get_embed_ref_id(pointer) ⇒ int

Returns the block content_id for the block containing an embedded reference sequence.

Returns:

  • (int)

    the return value of attach_function



273
274
275
276
# File 'lib/hts/libhts/cram.rb', line 273

attach_function \
:cram_slice_hdr_get_embed_ref_id,
[:pointer],
:int

.cram_slice_hdr_get_num_blocks(pointer) ⇒ int32

Returns the number of cram blocks within this slice.

Returns:

  • (int32)

    the return value of attach_function



266
267
268
269
# File 'lib/hts/libhts/cram.rb', line 266

attach_function \
:cram_slice_hdr_get_num_blocks,
[:pointer],
:int32

.cram_store_container(cram_fd) ⇒ int

Stores the container structure in dat and returns *size as the number of bytes written to dat[].

Returns:

  • (int)

    the return value of attach_function



364
365
366
367
# File 'lib/hts/libhts/cram.rb', line 364

attach_function \
:cram_store_container,
%i[cram_fd cram_container string pointer],
:int

.cram_transcode_rg(cram_fd) ⇒ int

Renumbers RG numbers in a cram compression header.

Returns:

  • (int)

    the return value of attach_function



208
209
210
211
# File 'lib/hts/libhts/cram.rb', line 208

attach_function \
:cram_transcode_rg,
%i[cram_fd cram_fd cram_container int pointer pointer],
:int

.cram_uncompress_block(cram_block) ⇒ int

Uncompresses a CRAM block, if compressed.

Returns:

  • (int)

    the return value of attach_function



322
323
324
325
# File 'lib/hts/libhts/cram.rb', line 322

attach_function \
:cram_uncompress_block,
[:cram_block],
:int

.cram_update_cid2ds_map(pointer) ⇒ pointer

Map cram block numbers to data-series.

Returns:

  • (pointer)

    the return value of attach_function



240
241
242
243
# File 'lib/hts/libhts/cram.rb', line 240

attach_function \
:cram_update_cid2ds_map,
%i[pointer pointer],
:pointer

.cram_write_block(cram_fd) ⇒ int

Writes a CRAM block.

Returns:

  • (int)

    the return value of attach_function



310
311
312
313
# File 'lib/hts/libhts/cram.rb', line 310

attach_function \
:cram_write_block,
%i[cram_fd cram_block],
:int

.cram_write_container(cram_fd) ⇒ int

Writes a container structure.

Returns:

  • (int)

    the return value of attach_function



357
358
359
360
# File 'lib/hts/libhts/cram.rb', line 357

attach_function \
:cram_write_container,
%i[cram_fd cram_container],
:int

.errmod_cal(pointer) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



424
425
426
427
# File 'lib/hts/libhts/hts.rb', line 424

attach_function \
:errmod_cal,
%i[pointer int int pointer pointer],
:int

.errmod_destroy(pointer) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



419
420
421
422
# File 'lib/hts/libhts/hts.rb', line 419

attach_function \
:errmod_destroy,
[:pointer],
:void

.errmod_init(double) ⇒ pointer

Deprecated Convenience function to determine file type attach_function \

:hts_file_type,
[:string],
:int

Returns:

  • (pointer)

    the return value of attach_function



414
415
416
417
# File 'lib/hts/libhts/hts.rb', line 414

attach_function \
:errmod_init,
[:double],
:pointer

.fai_build(string) ⇒ int

Build index for a FASTA or FASTQ or bgzip-compressed FASTA or FASTQ file.

Returns:

  • (int)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/fai.rb', line 12

attach_function \
:fai_build,
[:string],
:int

.fai_build3(string) ⇒ int

Build index for a FASTA or FASTQ or bgzip-compressed FASTA or FASTQ file.

Returns:

  • (int)

    the return value of attach_function



6
7
8
9
# File 'lib/hts/libhts/fai.rb', line 6

attach_function \
:fai_build3,
%i[string string string],
:int

.fai_destroy([Faidx]) ⇒ void

This method returns an undefined value.

Destroy a faidx_t struct



18
19
20
21
# File 'lib/hts/libhts/fai.rb', line 18

attach_function \
:fai_destroy,
[Faidx],
:void

.fai_fetch(string) ⇒ string

Fetch the sequence in a region

Returns:

  • (string)

    the return value of attach_function



48
49
50
51
# File 'lib/hts/libhts/fai.rb', line 48

attach_function \
:fai_fetch,
[Faidx, :string, :pointer],
:string

.fai_fetch64(string) ⇒ string

Fetch the sequence in a region

Returns:

  • (string)

    the return value of attach_function



54
55
56
57
# File 'lib/hts/libhts/fai.rb', line 54

attach_function \
:fai_fetch64,
[Faidx, :string, :pointer],
:string

.fai_fetchqual(string) ⇒ string

Fetch the quality string for a region for FASTQ files

Returns:

  • (string)

    the return value of attach_function



60
61
62
63
# File 'lib/hts/libhts/fai.rb', line 60

attach_function \
:fai_fetchqual,
[Faidx, :string, :pointer],
:string

.fai_fetchqual64(string) ⇒ string

Returns the return value of attach_function.

Returns:

  • (string)

    the return value of attach_function



65
66
67
68
# File 'lib/hts/libhts/fai.rb', line 65

attach_function \
:fai_fetchqual64,
[Faidx, :string, :pointer],
:string

.fai_load(string) ⇒ by_ref

Load index from “fn.fai”.

Returns:

  • (by_ref)

    the return value of attach_function



30
31
32
33
# File 'lib/hts/libhts/fai.rb', line 30

attach_function \
:fai_load,
[:string],
Faidx.by_ref

.fai_load3(string) ⇒ by_ref

Load FASTA indexes.

Returns:

  • (by_ref)

    the return value of attach_function



24
25
26
27
# File 'lib/hts/libhts/fai.rb', line 24

attach_function \
:fai_load3,
%i[string string string int],
Faidx.by_ref

.fai_load3_format(string) ⇒ by_ref

Load FASTA or FASTQ indexes.

Returns:

  • (by_ref)

    the return value of attach_function



36
37
38
39
# File 'lib/hts/libhts/fai.rb', line 36

attach_function \
:fai_load3_format,
[:string, :string, :string, :int, FaiFormatOptions],
Faidx.by_ref

.fai_load_format(string) ⇒ by_ref

Load index from “fn.fai”.

Returns:

  • (by_ref)

    the return value of attach_function



42
43
44
45
# File 'lib/hts/libhts/fai.rb', line 42

attach_function \
:fai_load_format,
[:string, FaiFormatOptions],
Faidx.by_ref

.fai_parse_region(string) ⇒ string

Parses a region string.

Returns:

  • (string)

    the return value of attach_function



125
126
127
# File 'lib/hts/libhts/fai.rb', line 125

attach_function \
:fai_parse_region,
[Faidx, :string, :pointer, :pointer, :pointer, :int], :string

.fai_path(string) ⇒ string

Determines the path to the reference index file

Returns:

  • (string)

    the return value of attach_function



136
137
138
139
# File 'lib/hts/libhts/fai.rb', line 136

attach_function \
:fai_path,
[:string],
:string

.fai_set_cache_size(int) ⇒ void

This method returns an undefined value.

Sets the cache size of the underlying BGZF compressed file



130
131
132
133
# File 'lib/hts/libhts/fai.rb', line 130

attach_function \
:fai_set_cache_size,
[Faidx, :int],
:void

.faidx_fetch_nseq([Faidx]) ⇒ int

Fetch the number of sequences

Returns:

  • (int)

    the return value of attach_function



71
72
73
74
# File 'lib/hts/libhts/fai.rb', line 71

attach_function \
:faidx_fetch_nseq,
[Faidx],
:int

.faidx_fetch_qual(string) ⇒ string

Fetch the quality string in a region for FASTQ files

Returns:

  • (string)

    the return value of attach_function



89
90
91
92
# File 'lib/hts/libhts/fai.rb', line 89

attach_function \
:faidx_fetch_qual,
[Faidx, :string, :int, :int, :pointer],
:string

.faidx_fetch_qual64(string) ⇒ string

Fetch the quality string in a region for FASTQ files

Returns:

  • (string)

    the return value of attach_function



95
96
97
98
# File 'lib/hts/libhts/fai.rb', line 95

attach_function \
:faidx_fetch_qual64,
[Faidx, :string, :int64, :int64, :pointer],
:string

.faidx_fetch_seq(string) ⇒ string

Fetch the sequence in a region

Returns:

  • (string)

    the return value of attach_function



77
78
79
80
# File 'lib/hts/libhts/fai.rb', line 77

attach_function \
:faidx_fetch_seq,
[Faidx, :string, :int, :int, :pointer],
:string

.faidx_fetch_seq64(string) ⇒ string

Fetch the sequence in a region

Returns:

  • (string)

    the return value of attach_function



83
84
85
86
# File 'lib/hts/libhts/fai.rb', line 83

attach_function \
:faidx_fetch_seq64,
[Faidx, :string, :int64, :int64, :pointer],
:string

.faidx_has_seq(string) ⇒ int

Query if sequence is present

Returns:

  • (int)

    the return value of attach_function



101
102
103
104
# File 'lib/hts/libhts/fai.rb', line 101

attach_function \
:faidx_has_seq,
[Faidx, :string],
:int

.faidx_iseq(int) ⇒ string

Return name of i-th sequence

Returns:

  • (string)

    the return value of attach_function



113
114
115
116
# File 'lib/hts/libhts/fai.rb', line 113

attach_function \
:faidx_iseq,
[Faidx, :int],
:string

.faidx_nseq([Faidx]) ⇒ int

Return number of sequences in fai index

Returns:

  • (int)

    the return value of attach_function



107
108
109
110
# File 'lib/hts/libhts/fai.rb', line 107

attach_function \
:faidx_nseq,
[Faidx],
:int

.faidx_seq_len(string) ⇒ int

Return sequence length, -1 if not present

Returns:

  • (int)

    the return value of attach_function



119
120
121
122
# File 'lib/hts/libhts/fai.rb', line 119

attach_function \
:faidx_seq_len,
[Faidx, :string],
:int

.haddextension(string) ⇒ string

Append an extension or replace an existing extension

Returns:

  • (string)

    the return value of attach_function



24
25
26
27
# File 'lib/hts/libhts/hfile.rb', line 24

attach_function \
:haddextension,
[KString, :string, :int, :string],
:string

.hclose([HFile]) ⇒ int

Flush (for output streams) and close the stream

Returns:

  • (int)

    the return value of attach_function



30
31
32
33
# File 'lib/hts/libhts/hfile.rb', line 30

attach_function \
:hclose,
[HFile],
:int

.hclose_abruptly([HFile]) ⇒ void

This method returns an undefined value.

Close the stream, without flushing or propagating errors



36
37
38
39
# File 'lib/hts/libhts/hfile.rb', line 36

attach_function \
:hclose_abruptly,
[HFile],
:void

.hdopen(int) ⇒ by_ref

Associate a stream with an existing open file descriptor

Returns:

  • (by_ref)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/hfile.rb', line 12

attach_function \
:hdopen,
%i[int string],
HFile.by_ref

.hfile_has_plugin(string) ⇒ int

Tests for the presence of a specific hFILE plugin.

Returns:

  • (int)

    the return value of attach_function



104
105
106
107
# File 'lib/hts/libhts/hfile.rb', line 104

attach_function \
:hfile_has_plugin,
[:string],
:int

.hfile_list_plugins(pointer) ⇒ int

Fills out plist[] with the list of known hFILE plugins.

Returns:

  • (int)

    the return value of attach_function



98
99
100
101
# File 'lib/hts/libhts/hfile.rb', line 98

attach_function \
:hfile_list_plugins,
%i[pointer pointer], # mutable string
:int

.hfile_list_schemes(string) ⇒ int

Fills out sc_list[] with the list of known URL schemes.

Returns:

  • (int)

    the return value of attach_function



92
93
94
95
# File 'lib/hts/libhts/hfile.rb', line 92

attach_function \
:hfile_list_schemes,
%i[string pointer pointer], # mutable string
:int

.hfile_mem_get_buffer(pointer) ⇒ string

For hfile_mem: get the internal buffer and it’s size from a hfile

Returns:

  • (string)

    the return value of attach_function



80
81
82
83
# File 'lib/hts/libhts/hfile.rb', line 80

attach_function \
:hfile_mem_get_buffer,
[HFile, :pointer],
:string

.hfile_mem_steal_buffer(pointer) ⇒ string

For hfile_mem: get the internal buffer and it’s size from a hfile.

Returns:

  • (string)

    the return value of attach_function



86
87
88
89
# File 'lib/hts/libhts/hfile.rb', line 86

attach_function \
:hfile_mem_steal_buffer,
[HFile, :pointer],
:string

.hflush([HFile]) ⇒ int

For writing streams, flush buffered output to the underlying stream

Returns:

  • (int)

    the return value of attach_function



74
75
76
77
# File 'lib/hts/libhts/hfile.rb', line 74

attach_function \
:hflush,
[HFile],
:int

.hgetdelim(string) ⇒ ssize_t

Read from the stream until the delimiter, up to a maximum length

Returns:

  • (ssize_t)

    the return value of attach_function



56
57
58
59
# File 'lib/hts/libhts/hfile.rb', line 56

attach_function \
:hgetdelim,
[:string, :size_t, :int, HFile],
:ssize_t

.hgets(string) ⇒ string

Read a line from the stream, up to a maximum length

Returns:

  • (string)

    the return value of attach_function



62
63
64
65
# File 'lib/hts/libhts/hfile.rb', line 62

attach_function \
:hgets,
[:string, :int, HFile],
:string

.hisremote(string) ⇒ int

Report whether the file name or URL denotes remote storage

Returns:

  • (int)

    the return value of attach_function



18
19
20
21
# File 'lib/hts/libhts/hfile.rb', line 18

attach_function \
:hisremote,
[:string],
:int

.hopen(string) ⇒ by_ref

Open the named file or URL as a stream

Returns:

  • (by_ref)

    the return value of attach_function



6
7
8
9
# File 'lib/hts/libhts/hfile.rb', line 6

attach_function \
:hopen,
%i[string string varargs],
HFile.by_ref

.hpeek(pointer) ⇒ ssize_t

Peek at characters to be read without removing them from buffers

Returns:

  • (ssize_t)

    the return value of attach_function



68
69
70
71
# File 'lib/hts/libhts/hfile.rb', line 68

attach_function \
:hpeek,
[HFile, :pointer, :size_t],
:ssize_t

.hrec_add_idx(int) ⇒ int

Add an IDX header record

Returns:

  • (int)

    the return value of attach_function



299
300
301
302
# File 'lib/hts/libhts/vcf.rb', line 299

attach_function \
:hrec_add_idx,
[BcfHrec, :int],
:int

.hseek(off_t) ⇒ off_t

Reposition the read/write stream offset

Returns:

  • (off_t)

    the return value of attach_function



42
43
44
45
# File 'lib/hts/libhts/hfile.rb', line 42

attach_function \
:hseek,
[HFile, :off_t, :int],
:off_t

.htell(fp) ⇒ Object

Report the current stream offset



48
49
50
51
52
53
# File 'lib/hts/libhts/hfile.rb', line 48

def self.htell(fp)
  # TODO: This is a hack. Is this OK?
  bg = FFI::Pointer.new(:int, fp.pointer.address + fp.offset_of(:begin)).read_int
  bf = FFI::Pointer.new(:int, fp.pointer.address + fp.offset_of(:buffer)).read_int
  fp[:offset] + (bg - bf)
end

.hts_base_mod_state_alloc([]) ⇒ pointer

Allocates an hts_base_mode_state.

Returns:

  • (pointer)

    the return value of attach_function



672
673
674
675
# File 'lib/hts/libhts/sam.rb', line 672

attach_function \
:hts_base_mod_state_alloc,
[],
:pointer

.hts_base_mod_state_free(pointer) ⇒ void

This method returns an undefined value.

Destroys an hts_base_mode_state.



678
679
680
681
# File 'lib/hts/libhts/sam.rb', line 678

attach_function \
:hts_base_mod_state_free,
[:pointer], # hts_base_mod_state
:void

.hts_check_EOF([HtsFile]) ⇒ int

Determine whether a given htsFile contains a valid EOF block

Returns:

  • (int)

    the return value of attach_function



199
200
201
202
# File 'lib/hts/libhts/hts.rb', line 199

attach_function \
:hts_check_EOF,
[HtsFile],
:int

.hts_close([HtsFile]) ⇒ int Also known as: sam_close, bcf_close, vcf_close

Close a file handle, flushing buffered data for output streams

Returns:

  • (int)

    the return value of attach_function



128
129
130
131
# File 'lib/hts/libhts/hts.rb', line 128

attach_function \
:hts_close,
[HtsFile],
:int

.hts_detect_format([HFile, HtsFormat]) ⇒ int

Determine format by peeking at the start of a file

Returns:

  • (int)

    the return value of attach_function



85
86
87
88
# File 'lib/hts/libhts/hts.rb', line 85

attach_function \
:hts_detect_format,
[HFile, HtsFormat],
:int

.hts_detect_format2(string) ⇒ int

Determine format primarily by peeking at the start of a file

Returns:

  • (int)

    the return value of attach_function



91
92
93
94
# File 'lib/hts/libhts/hts.rb', line 91

attach_function \
:hts_detect_format2,
[HFile, :string, HtsFormat],
:int

.hts_feature_string([]) ⇒ string

Introspection on the features enabled in htslib, string form

Returns:

  • (string)

    the return value of attach_function



79
80
81
82
# File 'lib/hts/libhts/hts.rb', line 79

attach_function \
:hts_feature_string,
[],
:string

.hts_features([]) ⇒ uint

Introspection on the features enabled in htslib

Returns:

  • (uint)

    the return value of attach_function



68
69
70
71
# File 'lib/hts/libhts/hts.rb', line 68

attach_function \
:hts_features,
[],
:uint

.hts_flush([HtsFile]) ⇒ int Also known as: sam_flush

For output streams, flush any buffered data

Returns:

  • (int)

    the return value of attach_function



122
123
124
125
# File 'lib/hts/libhts/hts.rb', line 122

attach_function \
:hts_flush,
[HtsFile],
:int

.hts_format_description([HtsFormat]) ⇒ string

Get a human-readable description of the file format

Returns:

  • (string)

    the return value of attach_function



97
98
99
100
# File 'lib/hts/libhts/hts.rb', line 97

attach_function \
:hts_format_description,
[HtsFormat],
:string

.hts_format_file_extension([HtsFormat]) ⇒ string

Returns a string containing the file format extension.

Returns:

  • (string)

    the return value of attach_function



140
141
142
143
# File 'lib/hts/libhts/hts.rb', line 140

attach_function \
:hts_format_file_extension,
[HtsFormat],
:string

.hts_free(pointer) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



26
27
28
29
# File 'lib/hts/libhts/hts.rb', line 26

attach_function \
:hts_free,
[:pointer],
:void

.hts_get_bgzfp([HtsFile]) ⇒ by_ref

Internal helper function used by tbx_itr_next()

Returns:

  • (by_ref)

    the return value of attach_function



18
19
20
21
# File 'lib/hts/libhts/tbx.rb', line 18

attach_function \
:hts_get_bgzfp,
[HtsFile],
BGZF.by_ref

.hts_get_format([HtsFile]) ⇒ by_ref

Returns the file’s format information

Returns:

  • (by_ref)

    the return value of attach_function



134
135
136
137
# File 'lib/hts/libhts/hts.rb', line 134

attach_function \
:hts_get_format,
[HtsFile],
HtsFormat.by_ref

.hts_get_log_level([]) ⇒ HtsLogLevel

Gets the selected log level.

Returns:

  • (HtsLogLevel)

    the return value of attach_function



16
17
18
19
# File 'lib/hts/libhts/hts.rb', line 16

attach_function \
:hts_get_log_level,
[],
HtsLogLevel

.hts_getline(int) ⇒ int

Read a line (and its n or rn terminator) from a file

Returns:

  • (int)

    the return value of attach_function



152
153
154
155
# File 'lib/hts/libhts/hts.rb', line 152

attach_function \
:hts_getline,
[HtsFile, :int, KString],
:int

.hts_hopen(string) ⇒ by_ref

Open an existing stream as a SAM/BAM/CRAM/VCF/BCF/etc file

Returns:

  • (by_ref)

    the return value of attach_function



116
117
118
119
# File 'lib/hts/libhts/hts.rb', line 116

attach_function \
:hts_hopen,
[HFile, :string, :string],
HtsFile.by_ref

.hts_idx_destroy([HtsIdx]) ⇒ void

This method returns an undefined value.

Free a BAI/CSI/TBI type index



219
220
221
222
# File 'lib/hts/libhts/hts.rb', line 219

attach_function \
:hts_idx_destroy,
[HtsIdx],
:void

.hts_idx_finish(uint64) ⇒ int

Finish building an index

Returns:

  • (int)

    the return value of attach_function



231
232
233
234
# File 'lib/hts/libhts/hts.rb', line 231

attach_function \
:hts_idx_finish,
[HtsIdx, :uint64],
:int

.hts_idx_fmt([HtsIdx]) ⇒ int

Returns index format

Returns:

  • (int)

    the return value of attach_function



237
238
239
240
# File 'lib/hts/libhts/hts.rb', line 237

attach_function \
:hts_idx_fmt,
[HtsIdx],
:int

.hts_idx_get_meta(pointer) ⇒ uint8

Get extra index meta-data

Returns:

  • (uint8)

    the return value of attach_function



279
280
281
282
# File 'lib/hts/libhts/hts.rb', line 279

attach_function \
:hts_idx_get_meta,
[HtsIdx, :pointer],
:uint8

.hts_idx_get_n_no_coor([HtsIdx]) ⇒ uint64

Return the number of unplaced reads from an index

Returns:

  • (uint64)

    the return value of attach_function



297
298
299
300
# File 'lib/hts/libhts/hts.rb', line 297

attach_function \
:hts_idx_get_n_no_coor,
[HtsIdx],
:uint64

.hts_idx_get_stat(int) ⇒ int

Get number of mapped and unmapped reads from an index

Returns:

  • (int)

    the return value of attach_function



291
292
293
294
# File 'lib/hts/libhts/hts.rb', line 291

attach_function \
:hts_idx_get_stat,
[HtsIdx, :int, :pointer, :pointer],
:int

.hts_idx_init(int) ⇒ pointer

Create a BAI/CSI/TBI type index structure

Returns:

  • (pointer)

    the return value of attach_function



213
214
215
216
# File 'lib/hts/libhts/hts.rb', line 213

attach_function \
:hts_idx_init,
%i[int int uint64 int int],
:pointer

.hts_idx_load(string) ⇒ by_ref

Load an index file

Returns:

  • (by_ref)

    the return value of attach_function



261
262
263
264
# File 'lib/hts/libhts/hts.rb', line 261

attach_function \
:hts_idx_load,
%i[string int],
HtsIdx.by_ref

.hts_idx_load2(string) ⇒ by_ref

Load a specific index file

Returns:

  • (by_ref)

    the return value of attach_function



267
268
269
270
# File 'lib/hts/libhts/hts.rb', line 267

attach_function \
:hts_idx_load2,
%i[string string],
HtsIdx.by_ref

.hts_idx_load3(string) ⇒ by_ref

Load a specific index file

Returns:

  • (by_ref)

    the return value of attach_function



273
274
275
276
# File 'lib/hts/libhts/hts.rb', line 273

attach_function \
:hts_idx_load3,
%i[string string int int],
HtsIdx.by_ref

.hts_idx_nseq([HtsIdx]) ⇒ int

Return the number of targets from an index

Returns:

  • (int)

    the return value of attach_function



309
310
311
312
# File 'lib/hts/libhts/hts.rb', line 309

attach_function \
:hts_idx_nseq,
[HtsIdx],
:int

.hts_idx_push(int) ⇒ int

Push an index entry

Returns:

  • (int)

    the return value of attach_function



225
226
227
228
# File 'lib/hts/libhts/hts.rb', line 225

attach_function \
:hts_idx_push,
[HtsIdx, :int, :int64, :int64, :uint64, :int],
:int

.hts_idx_save(string) ⇒ int

Save an index to a file

Returns:

  • (int)

    the return value of attach_function



249
250
251
252
# File 'lib/hts/libhts/hts.rb', line 249

attach_function \
:hts_idx_save,
[HtsIdx, :string, :int],
:int

.hts_idx_save_as(string) ⇒ int

Save an index to a specific file

Returns:

  • (int)

    the return value of attach_function



255
256
257
258
# File 'lib/hts/libhts/hts.rb', line 255

attach_function \
:hts_idx_save_as,
[HtsIdx, :string, :string, :int],
:int

.hts_idx_seqnames(pointer) ⇒ pointer

Return a list of target names from an index

Returns:

  • (pointer)

    the return value of attach_function



303
304
305
306
# File 'lib/hts/libhts/hts.rb', line 303

attach_function \
:hts_idx_seqnames,
[HtsIdx, :pointer, :pointer, :pointer],
:pointer

.hts_idx_set_meta(uint32) ⇒ int

Set extra index meta-data

Returns:

  • (int)

    the return value of attach_function



285
286
287
288
# File 'lib/hts/libhts/hts.rb', line 285

attach_function \
:hts_idx_set_meta,
[HtsIdx, :uint32, :pointer, :int],
:int

.hts_idx_tbi_name(int) ⇒ int

Add name to TBI index meta-data

Returns:

  • (int)

    the return value of attach_function



243
244
245
246
# File 'lib/hts/libhts/hts.rb', line 243

attach_function \
:hts_idx_tbi_name,
[HtsIdx, :int, :string],
:int

.hts_itr_destroy([HtsItr]) ⇒ void Also known as: bam_itr_destroy, sam_itr_destroy, bcf_itr_destroy

This method returns an undefined value.

Free an iterator



347
348
349
350
# File 'lib/hts/libhts/hts.rb', line 347

attach_function \
:hts_itr_destroy,
[HtsItr],
:void

.hts_itr_multi_bam([HtsIdx, HtsItr]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



364
365
366
367
# File 'lib/hts/libhts/hts.rb', line 364

attach_function \
:hts_itr_multi_bam,
[HtsIdx, HtsItr],
:int

.hts_itr_multi_cram([HtsIdx, HtsItr]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



369
370
371
372
# File 'lib/hts/libhts/hts.rb', line 369

attach_function \
:hts_itr_multi_cram,
[HtsIdx, HtsItr],
:int

.hts_itr_multi_next(pointer) ⇒ int

Return the next record from an iterator

Returns:

  • (int)

    the return value of attach_function



390
391
392
393
# File 'lib/hts/libhts/hts.rb', line 390

attach_function \
:hts_itr_multi_next,
[HtsFile, HtsItr, :pointer],
:int

.hts_itr_next(pointer) ⇒ int

Return the next record from an iterator

Returns:

  • (int)

    the return value of attach_function



359
360
361
362
# File 'lib/hts/libhts/hts.rb', line 359

attach_function \
:hts_itr_next,
[BGZF, HtsItr, :pointer, :pointer],
:int

.hts_itr_query(int) ⇒ by_ref

Create a single-region iterator

Returns:

  • (by_ref)

    the return value of attach_function



341
342
343
344
# File 'lib/hts/libhts/hts.rb', line 341

attach_function \
:hts_itr_query,
[HtsIdx, :int, :hts_pos_t, :hts_pos_t, :pointer],
HtsItr.by_ref

.hts_itr_querys(string) ⇒ by_ref

Create a single-region iterator from a text region specification

Returns:

  • (by_ref)

    the return value of attach_function



353
354
355
356
# File 'lib/hts/libhts/hts.rb', line 353

attach_function \
:hts_itr_querys,
[HtsIdx, :string, :hts_name2id_f, :pointer, :pointer, :pointer],
HtsItr.by_ref

.hts_itr_regions(pointer) ⇒ by_ref

Create a multi-region iterator from a region list

Returns:

  • (by_ref)

    the return value of attach_function



375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/hts/libhts/hts.rb', line 375

attach_function \
:hts_itr_regions,
[HtsIdx,
 :pointer, # hts_reglist_t *
 :int,
 :hts_name2id_f,
 :pointer,
 :pointer, # hts_itr_multi_query_func
 :pointer, # hts_readrec_func
 :pointer, # hts_seek_func
 :pointer  # hts_tell_func
],
HtsItr.by_ref

.hts_lib_shutdown([]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



21
22
23
24
# File 'lib/hts/libhts/hts.rb', line 21

attach_function \
:hts_lib_shutdown,
[],
:void

.hts_md5_destroy(pointer) ⇒ void

This method returns an undefined value.

Deallocates any memory allocated by hts_md5_init.



466
467
468
469
# File 'lib/hts/libhts/hts.rb', line 466

attach_function \
:hts_md5_destroy,
[:pointer],
:void

.hts_md5_final(pointer) ⇒ void

This method returns an undefined value.

Computes the final 128-bit MD5 hash from the given context



448
449
450
451
# File 'lib/hts/libhts/hts.rb', line 448

attach_function \
:hts_md5_final,
%i[pointer pointer], # unsigned char
:void

.hts_md5_hex(string) ⇒ void

This method returns an undefined value.

Converts a 128-bit MD5 hash into a 33-byte nul-termninated by string.



460
461
462
463
# File 'lib/hts/libhts/hts.rb', line 460

attach_function \
:hts_md5_hex,
%i[string pointer],
:void

.hts_md5_init([]) ⇒ pointer

Initialises an MD5 context.

Returns:

  • (pointer)

    the return value of attach_function



436
437
438
439
# File 'lib/hts/libhts/hts.rb', line 436

attach_function \
:hts_md5_init,
[],
:pointer

.hts_md5_reset(pointer) ⇒ void

This method returns an undefined value.

Resets an md5_context to the initial state, as returned by hts_md5_init().



454
455
456
457
# File 'lib/hts/libhts/hts.rb', line 454

attach_function \
:hts_md5_reset,
[:pointer],
:void

.hts_md5_update(pointer) ⇒ void

This method returns an undefined value.

Updates the context with the MD5 of the data.



442
443
444
445
# File 'lib/hts/libhts/hts.rb', line 442

attach_function \
:hts_md5_update,
%i[pointer pointer ulong],
:void

.hts_open(string) ⇒ by_ref Also known as: sam_open, bcf_open, vcf_open

Open a sequence data (SAM/BAM/CRAM) or variant data (VCF/BCF) or possibly-compressed textual line-orientated file

Returns:

  • (by_ref)

    the return value of attach_function



104
105
106
107
# File 'lib/hts/libhts/hts.rb', line 104

attach_function \
:hts_open,
%i[string string],
HtsFile.by_ref

.hts_open_format(string) ⇒ by_ref Also known as: sam_open_format

Open a SAM/BAM/CRAM/VCF/BCF/etc file

Returns:

  • (by_ref)

    the return value of attach_function



110
111
112
113
# File 'lib/hts/libhts/hts.rb', line 110

attach_function \
:hts_open_format,
[:string, :string, HtsFormat],
HtsFile.by_ref

.hts_opt_add(pointer) ⇒ int

Parses arg and appends it to the option list.

Returns:

  • (int)

    the return value of attach_function



32
33
34
35
# File 'lib/hts/libhts/hts.rb', line 32

attach_function \
:hts_opt_add,
%i[pointer string],
:int

.hts_opt_apply([HtsFile, HtsOpt]) ⇒ int

Applies an hts_opt option list to a given htsFile.

Returns:

  • (int)

    the return value of attach_function



38
39
40
41
# File 'lib/hts/libhts/hts.rb', line 38

attach_function \
:hts_opt_apply,
[HtsFile, HtsOpt],
:int

.hts_opt_free([HtsOpt]) ⇒ void

This method returns an undefined value.

Frees an hts_opt list.



44
45
46
47
# File 'lib/hts/libhts/hts.rb', line 44

attach_function \
:hts_opt_free,
[HtsOpt],
:void

.hts_parse_decimal(string) ⇒ long_long

Parse a numeric string

Returns:

  • (long_long)

    the return value of attach_function



315
316
317
318
# File 'lib/hts/libhts/hts.rb', line 315

attach_function \
:hts_parse_decimal,
%i[string pointer int],
:long_long

.hts_parse_format(string) ⇒ int

Accepts a string file format (sam, bam, cram, vcf, bam)

Returns:

  • (int)

    the return value of attach_function



50
51
52
53
# File 'lib/hts/libhts/hts.rb', line 50

attach_function \
:hts_parse_format,
[HtsFormat, :string],
:int

.hts_parse_opt_list(string) ⇒ int

Tokenise options as (key(=value)?,)*(key(=value)?)?

Returns:

  • (int)

    the return value of attach_function



56
57
58
59
# File 'lib/hts/libhts/hts.rb', line 56

attach_function \
:hts_parse_opt_list,
[HtsFormat, :string],
:int

.hts_parse_reg(string) ⇒ string

Parse a “CHR:START-END”-style region string

Returns:

  • (string)

    the return value of attach_function



329
330
331
332
# File 'lib/hts/libhts/hts.rb', line 329

attach_function \
:hts_parse_reg,
%i[string pointer pointer],
:string

.hts_parse_reg64(string) ⇒ string

Parse a “CHR:START-END”-style region string

Returns:

  • (string)

    the return value of attach_function



323
324
325
326
# File 'lib/hts/libhts/hts.rb', line 323

attach_function \
:hts_parse_reg64,
%i[string pointer pointer],
:string

.hts_parse_region(string) ⇒ string

Parse a “CHR:START-END”-style region string

Returns:

  • (string)

    the return value of attach_function



335
336
337
338
# File 'lib/hts/libhts/hts.rb', line 335

attach_function \
:hts_parse_region,
%i[string pointer pointer pointer hts_name2id_f pointer int],
:string

.hts_readlines(string) ⇒ pointer

Returns the return value of attach_function.

Returns:

  • (pointer)

    the return value of attach_function



157
158
159
160
# File 'lib/hts/libhts/hts.rb', line 157

attach_function \
:hts_readlines,
%i[string pointer],
:pointer

.hts_readlist(string) ⇒ pointer

Parse comma-separated list or read list from a file

Returns:

  • (pointer)

    the return value of attach_function



163
164
165
166
# File 'lib/hts/libhts/hts.rb', line 163

attach_function \
:hts_readlist,
%i[string int pointer],
:pointer

.hts_reglist_create(pointer) ⇒ by_ref

Create a region list from a char array

Returns:

  • (by_ref)

    the return value of attach_function



396
397
398
399
# File 'lib/hts/libhts/hts.rb', line 396

attach_function \
:hts_reglist_create,
%i[pointer int pointer pointer hts_name2id_f],
HtsReglist.by_ref

.hts_reglist_free(int) ⇒ void

This method returns an undefined value.

Free a region list



402
403
404
405
# File 'lib/hts/libhts/hts.rb', line 402

attach_function \
:hts_reglist_free,
[HtsReglist, :int],
:void

.hts_set_cache_size(int) ⇒ void

This method returns an undefined value.

Adds a cache of decompressed blocks, potentially speeding up seeks.



181
182
183
184
# File 'lib/hts/libhts/hts.rb', line 181

attach_function \
:hts_set_cache_size,
[HtsFile, :int],
:void

.hts_set_fai_filename(string) ⇒ int

Set .fai filename for a file opened for reading

Returns:

  • (int)

    the return value of attach_function



187
188
189
190
# File 'lib/hts/libhts/hts.rb', line 187

attach_function \
:hts_set_fai_filename,
[HtsFile, :string],
:int

.hts_set_filter_expression(string) ⇒ int

Sets a filter expression

Returns:

  • (int)

    the return value of attach_function



193
194
195
196
# File 'lib/hts/libhts/hts.rb', line 193

attach_function \
:hts_set_filter_expression,
[HtsFile, :string],
:int

.hts_set_log_level([HtsLogLevel]) ⇒ void

This method returns an undefined value.

Sets the selected log level.



10
11
12
13
# File 'lib/hts/libhts/hts.rb', line 10

attach_function \
:hts_set_log_level,
[HtsLogLevel],
:void

.hts_set_opt(varargs) ⇒ int

Sets a specified CRAM option on the open file handle.

Returns:

  • (int)

    the return value of attach_function



146
147
148
149
# File 'lib/hts/libhts/hts.rb', line 146

attach_function \
:hts_set_opt,
[HtsFile, HtsFmtOption, :varargs],
:int

.hts_set_thread_pool([HtsFile, HtsTpool]) ⇒ int

Create extra threads to aid compress/decompression for this file

Returns:

  • (int)

    the return value of attach_function



175
176
177
178
# File 'lib/hts/libhts/hts.rb', line 175

attach_function \
:hts_set_thread_pool,
[HtsFile, HtsTpool],
:int

.hts_set_threads(int) ⇒ int

Create extra threads to aid compress/decompression for this file

Returns:

  • (int)

    the return value of attach_function



169
170
171
172
# File 'lib/hts/libhts/hts.rb', line 169

attach_function \
:hts_set_threads,
[HtsFile, :int],
:int

.hts_test_feature(uint) ⇒ string

Returns the return value of attach_function.

Returns:

  • (string)

    the return value of attach_function



73
74
75
76
# File 'lib/hts/libhts/hts.rb', line 73

attach_function \
:hts_test_feature,
[:uint],
:string

.hts_tpool_delete_result(int) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



74
75
76
77
# File 'lib/hts/libhts/thread_pool.rb', line 74

attach_function \
:hts_tpool_delete_result,
[HtsTpoolResult, :int],
:void

.hts_tpool_destroy([HtsTpool]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



54
55
56
57
# File 'lib/hts/libhts/thread_pool.rb', line 54

attach_function \
:hts_tpool_destroy,
[HtsTpool],
:void

.hts_tpool_dispatch(pointer) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



19
20
21
22
# File 'lib/hts/libhts/thread_pool.rb', line 19

attach_function \
:hts_tpool_dispatch,
[HtsTpool, HtsTpoolProcess, :pointer, :pointer],
:int

.hts_tpool_dispatch2(pointer) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



24
25
26
27
# File 'lib/hts/libhts/thread_pool.rb', line 24

attach_function \
:hts_tpool_dispatch2,
[HtsTpool, HtsTpoolProcess, :pointer, :pointer, :int],
:int

.hts_tpool_dispatch3(pointer) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



29
30
31
32
# File 'lib/hts/libhts/thread_pool.rb', line 29

attach_function \
:hts_tpool_dispatch3,
[HtsTpool, HtsTpoolProcess, :pointer, :pointer, :pointer, :pointer, :int],
:int

.hts_tpool_init(int) ⇒ by_ref

Returns the return value of attach_function.

Returns:

  • (by_ref)

    the return value of attach_function



5
6
7
8
# File 'lib/hts/libhts/thread_pool.rb', line 5

attach_function \
:hts_tpool_init,
[:int],
HtsTpool.by_ref

.hts_tpool_kill([HtsTpool]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



59
60
61
62
# File 'lib/hts/libhts/thread_pool.rb', line 59

attach_function \
:hts_tpool_kill,
[HtsTpool],
:void

.hts_tpool_next_result([HtsTpoolProcess]) ⇒ HtsTpoolResult

Returns the return value of attach_function.

Returns:



64
65
66
67
# File 'lib/hts/libhts/thread_pool.rb', line 64

attach_function \
:hts_tpool_next_result,
[HtsTpoolProcess],
HtsTpoolResult

.hts_tpool_next_result_wait([HtsTpoolProcess]) ⇒ HtsTpoolResult

Returns the return value of attach_function.

Returns:



69
70
71
72
# File 'lib/hts/libhts/thread_pool.rb', line 69

attach_function \
:hts_tpool_next_result_wait,
[HtsTpoolProcess],
HtsTpoolResult

.hts_tpool_process_attach([HtsTpool, HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



119
120
121
122
# File 'lib/hts/libhts/thread_pool.rb', line 119

attach_function \
:hts_tpool_process_attach,
[HtsTpool, HtsTpoolProcess],
:void

.hts_tpool_process_destroy([HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



89
90
91
92
# File 'lib/hts/libhts/thread_pool.rb', line 89

attach_function \
:hts_tpool_process_destroy,
[HtsTpoolProcess],
:void

.hts_tpool_process_detach([HtsTpool, HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



124
125
126
127
# File 'lib/hts/libhts/thread_pool.rb', line 124

attach_function \
:hts_tpool_process_detach,
[HtsTpool, HtsTpoolProcess],
:void

.hts_tpool_process_empty([HtsTpoolProcess]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



94
95
96
97
# File 'lib/hts/libhts/thread_pool.rb', line 94

attach_function \
:hts_tpool_process_empty,
[HtsTpoolProcess],
:int

.hts_tpool_process_flush([HtsTpoolProcess]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



39
40
41
42
# File 'lib/hts/libhts/thread_pool.rb', line 39

attach_function \
:hts_tpool_process_flush,
[HtsTpoolProcess],
:int

.hts_tpool_process_init(int) ⇒ HtsTpoolProcess

Returns the return value of attach_function.

Returns:



84
85
86
87
# File 'lib/hts/libhts/thread_pool.rb', line 84

attach_function \
:hts_tpool_process_init,
[HtsTpool, :int, :int],
HtsTpoolProcess

.hts_tpool_process_is_shutdown([HtsTpoolProcess]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



114
115
116
117
# File 'lib/hts/libhts/thread_pool.rb', line 114

attach_function \
:hts_tpool_process_is_shutdown,
[HtsTpoolProcess],
:int

.hts_tpool_process_len([HtsTpoolProcess]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



99
100
101
102
# File 'lib/hts/libhts/thread_pool.rb', line 99

attach_function \
:hts_tpool_process_len,
[HtsTpoolProcess],
:int

.hts_tpool_process_qsize([HtsTpoolProcess]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



49
50
51
52
# File 'lib/hts/libhts/thread_pool.rb', line 49

attach_function \
:hts_tpool_process_qsize,
[HtsTpoolProcess],
:int

.hts_tpool_process_ref_decr([HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



134
135
136
137
# File 'lib/hts/libhts/thread_pool.rb', line 134

attach_function \
:hts_tpool_process_ref_decr,
[HtsTpoolProcess],
:void

.hts_tpool_process_ref_incr([HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



129
130
131
132
# File 'lib/hts/libhts/thread_pool.rb', line 129

attach_function \
:hts_tpool_process_ref_incr,
[HtsTpoolProcess],
:void

.hts_tpool_process_reset(int) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



44
45
46
47
# File 'lib/hts/libhts/thread_pool.rb', line 44

attach_function \
:hts_tpool_process_reset,
[HtsTpoolProcess, :int],
:int

.hts_tpool_process_shutdown([HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



109
110
111
112
# File 'lib/hts/libhts/thread_pool.rb', line 109

attach_function \
:hts_tpool_process_shutdown,
[HtsTpoolProcess],
:void

.hts_tpool_process_sz([HtsTpoolProcess]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



104
105
106
107
# File 'lib/hts/libhts/thread_pool.rb', line 104

attach_function \
:hts_tpool_process_sz,
[HtsTpoolProcess],
:int

.hts_tpool_result_data([HtsTpoolResult]) ⇒ pointer

Returns the return value of attach_function.

Returns:

  • (pointer)

    the return value of attach_function



79
80
81
82
# File 'lib/hts/libhts/thread_pool.rb', line 79

attach_function \
:hts_tpool_result_data,
[HtsTpoolResult],
:pointer

.hts_tpool_size([HtsTpool]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



10
11
12
13
# File 'lib/hts/libhts/thread_pool.rb', line 10

attach_function \
:hts_tpool_size,
[HtsTpool],
:int

.hts_tpool_wake_dispatch([HtsTpoolProcess]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



34
35
36
37
# File 'lib/hts/libhts/thread_pool.rb', line 34

attach_function \
:hts_tpool_wake_dispatch,
[HtsTpoolProcess],
:void

.hts_version([]) ⇒ string

Get the htslib version number

Returns:

  • (string)

    the return value of attach_function



62
63
64
65
# File 'lib/hts/libhts/hts.rb', line 62

attach_function \
:hts_version,
[],
:string

.int32_put_blk(cram_block) ⇒ int

As int32_decoded/encode, but from/to blocks instead of cram_fd

Returns:

  • (int)

    the return value of attach_function



435
436
437
438
# File 'lib/hts/libhts/cram.rb', line 435

attach_function \
:int32_put_blk,
%i[cram_block int32],
:int

.kf_betai(double) ⇒ double

Returns the return value of attach_function.

Returns:

  • (double)

    the return value of attach_function



28
29
30
31
# File 'lib/hts/libhts/kfunc.rb', line 28

attach_function \
:kf_betai,
%i[double double double],
:double

.kf_erfc(double) ⇒ double

complementary error function

Returns:

  • (double)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/kfunc.rb', line 12

attach_function \
:kf_erfc,
[:double],
:double

.kf_gammap(double) ⇒ double

The following computes regularized incomplete gamma functions.

Returns:

  • (double)

    the return value of attach_function



18
19
20
21
# File 'lib/hts/libhts/kfunc.rb', line 18

attach_function \
:kf_gammap,
%i[double double],
:double

.kf_gammaq(double) ⇒ double

Returns the return value of attach_function.

Returns:

  • (double)

    the return value of attach_function



23
24
25
26
# File 'lib/hts/libhts/kfunc.rb', line 23

attach_function \
:kf_gammaq,
%i[double double],
:double

.kf_lgamma(double) ⇒ double

Log gamma function

Returns:

  • (double)

    the return value of attach_function



6
7
8
9
# File 'lib/hts/libhts/kfunc.rb', line 6

attach_function \
:kf_lgamma,
[:double],
:double

.kt_fisher_exact(int) ⇒ double

Returns the return value of attach_function.

Returns:

  • (double)

    the return value of attach_function



33
34
35
36
# File 'lib/hts/libhts/kfunc.rb', line 33

attach_function \
:kt_fisher_exact,
%i[int int int int pointer pointer pointer],
:double

.probaln_glocal(pointer) ⇒ int

Perform probabilistic banded glocal alignment

Returns:

  • (int)

    the return value of attach_function



430
431
432
433
# File 'lib/hts/libhts/hts.rb', line 430

attach_function \
:probaln_glocal,
%i[pointer int pointer int pointer pointer pointer pointer],
:int

.sam_cap_mapq(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



661
662
663
664
# File 'lib/hts/libhts/sam.rb', line 661

attach_function \
:sam_cap_mapq,
[Bam1, :string, :hts_pos_t, :int],
:int

.sam_format1([SamHdr, Bam1, KString]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



420
421
422
423
# File 'lib/hts/libhts/sam.rb', line 420

attach_function \
:sam_format1,
[SamHdr, Bam1, KString],
:int

.sam_hdr_add_line(string) ⇒ int

Adds a single line to an existing header.

Returns:

  • (int)

    the return value of attach_function



78
79
80
81
# File 'lib/hts/libhts/sam.rb', line 78

attach_function \
:sam_hdr_add_line,
[SamHdr, :string, :varargs],
:int

.sam_hdr_add_lines(string) ⇒ int

Add formatted lines to an existing header.

Returns:

  • (int)

    the return value of attach_function



72
73
74
75
# File 'lib/hts/libhts/sam.rb', line 72

attach_function \
:sam_hdr_add_lines,
[SamHdr, :string, :size_t],
:int

.sam_hdr_add_pg(string) ⇒ int

Add an @PG line.

Returns:

  • (int)

    the return value of attach_function



186
187
188
189
# File 'lib/hts/libhts/sam.rb', line 186

attach_function \
:sam_hdr_add_pg,
[SamHdr, :string, :varargs],
:int

.sam_hdr_change_HD(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



410
411
412
413
# File 'lib/hts/libhts/sam.rb', line 410

attach_function \
:sam_hdr_change_HD,
[SamHdr, :string, :string],
:int

.sam_hdr_count_lines(string) ⇒ int

Count the number of lines for a given header type

Returns:

  • (int)

    the return value of attach_function



126
127
128
129
# File 'lib/hts/libhts/sam.rb', line 126

attach_function \
:sam_hdr_count_lines,
[SamHdr, :string],
:int

.sam_hdr_destroy([SamHdr]) ⇒ void

This method returns an undefined value.

Frees the resources associated with a header.



24
25
26
27
# File 'lib/hts/libhts/sam.rb', line 24

attach_function \
:sam_hdr_destroy,
[SamHdr],
:void

.sam_hdr_dup([SamHdr]) ⇒ by_ref

Duplicate a header structure.

Returns:

  • (by_ref)

    the return value of attach_function



30
31
32
33
# File 'lib/hts/libhts/sam.rb', line 30

attach_function \
:sam_hdr_dup,
[SamHdr],
SamHdr.by_ref

.sam_hdr_find_hd(h, ks) ⇒ Object

Returns the SAM formatted text of the @HD header line



112
113
114
# File 'lib/hts/libhts/sam_funcs.rb', line 112

def sam_hdr_find_hd(h, ks)
  sam_hdr_find_line_id(h, "HD", nil, nil, ks)
end

.sam_hdr_find_line_id(string) ⇒ int

Returns a complete line of formatted text for a given type and ID.

Returns:

  • (int)

    the return value of attach_function



84
85
86
87
# File 'lib/hts/libhts/sam.rb', line 84

attach_function \
:sam_hdr_find_line_id,
[SamHdr, :string, :string, :string, KString],
:int

.sam_hdr_find_line_pos(string) ⇒ int

Returns a complete line of formatted text for a given type and index.

Returns:

  • (int)

    the return value of attach_function



90
91
92
93
# File 'lib/hts/libhts/sam.rb', line 90

attach_function \
:sam_hdr_find_line_pos,
[SamHdr, :string, :int, KString],
:int

.sam_hdr_find_tag_hd(h, key, ks) ⇒ Object

Returns the value associated with a given @HD line tag



117
118
119
# File 'lib/hts/libhts/sam_funcs.rb', line 117

def sam_hdr_find_tag_hd(h, key, ks)
  sam_hdr_find_tag_id(h, "HD", nil, nil, key, ks)
end

.sam_hdr_find_tag_id(string) ⇒ int

Return the value associated with a key for a header line identified by ID_key:ID_val

Returns:

  • (int)

    the return value of attach_function



144
145
146
147
# File 'lib/hts/libhts/sam.rb', line 144

attach_function \
:sam_hdr_find_tag_id,
[SamHdr, :string, :string, :string, :string, KString],
:int

.sam_hdr_find_tag_pos(string) ⇒ int

Return the value associated with a key for a header line identified by position

Returns:

  • (int)

    the return value of attach_function



150
151
152
153
# File 'lib/hts/libhts/sam.rb', line 150

attach_function \
:sam_hdr_find_tag_pos,
[SamHdr, :string, :int, :string, KString],
:int

.sam_hdr_incr_ref([SamHdr]) ⇒ void

This method returns an undefined value.

Increments the reference count on a header



198
199
200
201
# File 'lib/hts/libhts/sam.rb', line 198

attach_function \
:sam_hdr_incr_ref,
[SamHdr],
:void

.sam_hdr_init([]) ⇒ by_ref

Generates a new unpopulated header structure.

Returns:

  • (by_ref)

    the return value of attach_function



6
7
8
9
# File 'lib/hts/libhts/sam.rb', line 6

attach_function \
:sam_hdr_init,
[],
SamHdr.by_ref

.sam_hdr_length([SamHdr]) ⇒ size_t

Returns the current length of the header text.

Returns:

  • (size_t)

    the return value of attach_function



54
55
56
57
# File 'lib/hts/libhts/sam.rb', line 54

attach_function \
:sam_hdr_length,
[SamHdr],
:size_t

.sam_hdr_line_index(string) ⇒ int

Index of the line for the types that have dedicated look-up tables (SQ, RG, PG)

Returns:

  • (int)

    the return value of attach_function



132
133
134
135
# File 'lib/hts/libhts/sam.rb', line 132

attach_function \
:sam_hdr_line_index,
[SamHdr, :string, :string],
:int

.sam_hdr_line_name(string) ⇒ string

Id key of the line for the types that have dedicated look-up tables (SQ, RG, PG)

Returns:

  • (string)

    the return value of attach_function



138
139
140
141
# File 'lib/hts/libhts/sam.rb', line 138

attach_function \
:sam_hdr_line_name,
[SamHdr, :string, :int],
:string

.sam_hdr_name2tid(string) ⇒ int

Get the target id for a given reference sequence name

Returns:

  • (int)

    the return value of attach_function



162
163
164
165
# File 'lib/hts/libhts/sam.rb', line 162

attach_function \
:sam_hdr_name2tid,
[SamHdr, :string],
:int

.sam_hdr_nref([SamHdr]) ⇒ int

Returns the number of references in the header.

Returns:

  • (int)

    the return value of attach_function



66
67
68
69
# File 'lib/hts/libhts/sam.rb', line 66

attach_function \
:sam_hdr_nref,
[SamHdr],
:int

.sam_hdr_parse(size_t) ⇒ by_ref

Create a header from existing text.

Returns:

  • (by_ref)

    the return value of attach_function



36
37
38
39
# File 'lib/hts/libhts/sam.rb', line 36

attach_function \
:sam_hdr_parse,
%i[size_t string],
SamHdr.by_ref

.sam_hdr_pg_id(string) ⇒ string

Generate a unique @PG ID: value

Returns:

  • (string)

    the return value of attach_function



180
181
182
183
# File 'lib/hts/libhts/sam.rb', line 180

attach_function \
:sam_hdr_pg_id,
[SamHdr, :string],
:string

.sam_hdr_read([SamFile]) ⇒ by_ref

Read a header from a SAM, BAM or CRAM file.

Returns:

  • (by_ref)

    the return value of attach_function



42
43
44
45
# File 'lib/hts/libhts/sam.rb', line 42

attach_function \
:sam_hdr_read,
[SamFile],
SamHdr.by_ref

.sam_hdr_remove_except(string) ⇒ int

Remove all lines of a given type from a header, except the one matching an ID

Returns:

  • (int)

    the return value of attach_function



114
115
116
117
# File 'lib/hts/libhts/sam.rb', line 114

attach_function \
:sam_hdr_remove_except,
[SamHdr, :string, :string, :string],
:int

.sam_hdr_remove_line_id(string) ⇒ int

Remove a line with given type / id from a header

Returns:

  • (int)

    the return value of attach_function



96
97
98
99
# File 'lib/hts/libhts/sam.rb', line 96

attach_function \
:sam_hdr_remove_line_id,
[SamHdr, :string, :string, :string],
:int

.sam_hdr_remove_line_pos(string) ⇒ int

Remove nth line of a given type from a header

Returns:

  • (int)

    the return value of attach_function



102
103
104
105
# File 'lib/hts/libhts/sam.rb', line 102

attach_function \
:sam_hdr_remove_line_pos,
[SamHdr, :string, :int],
:int

.sam_hdr_remove_lines(string) ⇒ int

Remove header lines of a given type, except those in a given ID set

Returns:

  • (int)

    the return value of attach_function



120
121
122
123
# File 'lib/hts/libhts/sam.rb', line 120

attach_function \
:sam_hdr_remove_lines,
[SamHdr, :string, :string, :pointer],
:int

.sam_hdr_remove_tag_hd(h, key) ⇒ Object

Removes the @HD line tag with the given key



127
128
129
# File 'lib/hts/libhts/sam_funcs.rb', line 127

def sam_hdr_remove_tag_hd(h, key)
  sam_hdr_remove_tag_id(h, "HD", nil, nil, key)
end

.sam_hdr_remove_tag_id(string) ⇒ int

Remove the key from the line identified by type, ID_key and ID_value.

Returns:

  • (int)

    the return value of attach_function



156
157
158
159
# File 'lib/hts/libhts/sam.rb', line 156

attach_function \
:sam_hdr_remove_tag_id,
[SamHdr, :string, :string, :string, :string],
:int

.sam_hdr_str([SamHdr]) ⇒ string

Returns the text representation of the header.

Returns:

  • (string)

    the return value of attach_function



60
61
62
63
# File 'lib/hts/libhts/sam.rb', line 60

attach_function \
:sam_hdr_str,
[SamHdr],
:string

.sam_hdr_tid2len(int) ⇒ hts_pos_t

Get the reference sequence length from a target index

Returns:

  • (hts_pos_t)

    the return value of attach_function



174
175
176
177
# File 'lib/hts/libhts/sam.rb', line 174

attach_function \
:sam_hdr_tid2len,
[SamHdr, :int],
:hts_pos_t

.sam_hdr_tid2name(int) ⇒ string

Get the reference sequence name from a target index

Returns:

  • (string)

    the return value of attach_function



168
169
170
171
# File 'lib/hts/libhts/sam.rb', line 168

attach_function \
:sam_hdr_tid2name,
[SamHdr, :int],
:string

.sam_hdr_update_hd(h, *args) ⇒ Object

Adds or updates tags on the header @HD line



122
123
124
# File 'lib/hts/libhts/sam_funcs.rb', line 122

def sam_hdr_update_hd(h, *args)
  sam_hdr_update_line(h, "HD", nil, nil, *args, nil)
end

.sam_hdr_update_line(string) ⇒ int

Add or update tag key,value pairs in a header line.

Returns:

  • (int)

    the return value of attach_function



108
109
110
111
# File 'lib/hts/libhts/sam.rb', line 108

attach_function \
:sam_hdr_update_line,
[SamHdr, :string, :string, :string, :varargs],
:int

.sam_hdr_write([SamFile, SamHdr]) ⇒ int

Write a header to a SAM, BAM or CRAM file.

Returns:

  • (int)

    the return value of attach_function



48
49
50
51
# File 'lib/hts/libhts/sam.rb', line 48

attach_function \
:sam_hdr_write,
[SamFile, SamHdr],
:int

.sam_idx_init(int) ⇒ int

Initialise fp->idx for the current format type for SAM, BAM and CRAM types .

Returns:

  • (int)

    the return value of attach_function



307
308
309
310
# File 'lib/hts/libhts/sam.rb', line 307

attach_function \
:sam_idx_init,
[HtsFile, SamHdr, :int, :string],
:int

.sam_idx_save([HtsFile]) ⇒ int

Writes the index initialised with sam_idx_init to disk.

Returns:

  • (int)

    the return value of attach_function



313
314
315
316
# File 'lib/hts/libhts/sam.rb', line 313

attach_function \
:sam_idx_save,
[HtsFile],
:int

.sam_index_build(string) ⇒ int Also known as: bam_index_build

Generate and save an index file

Returns:

  • (int)

    the return value of attach_function



337
338
339
340
# File 'lib/hts/libhts/sam.rb', line 337

attach_function \
:sam_index_build,
%i[string int],
:int

.sam_index_build2(string) ⇒ int

Generate and save an index to a specific file

Returns:

  • (int)

    the return value of attach_function



343
344
345
346
# File 'lib/hts/libhts/sam.rb', line 343

attach_function \
:sam_index_build2,
%i[string string int],
:int

.sam_index_build3(string) ⇒ int

Generate and save an index to a specific file

Returns:

  • (int)

    the return value of attach_function



349
350
351
352
# File 'lib/hts/libhts/sam.rb', line 349

attach_function \
:sam_index_build3,
%i[string string int int],
:int

.sam_index_load(string) ⇒ by_ref

Load a BAM (.csi or .bai) or CRAM (.crai) index file

Returns:

  • (by_ref)

    the return value of attach_function



319
320
321
322
# File 'lib/hts/libhts/sam.rb', line 319

attach_function \
:sam_index_load,
[HtsFile, :string],
HtsIdx.by_ref

.sam_index_load2(string) ⇒ by_ref

Load a specific BAM (.csi or .bai) or CRAM (.crai) index file

Returns:

  • (by_ref)

    the return value of attach_function



325
326
327
328
# File 'lib/hts/libhts/sam.rb', line 325

attach_function \
:sam_index_load2,
[HtsFile, :string, :string],
HtsIdx.by_ref

.sam_index_load3(string) ⇒ by_ref

Load or stream a BAM (.csi or .bai) or CRAM (.crai) index file

Returns:

  • (by_ref)

    the return value of attach_function



331
332
333
334
# File 'lib/hts/libhts/sam.rb', line 331

attach_function \
:sam_index_load3,
[HtsFile, :string, :string, :int],
HtsIdx.by_ref

.sam_itr_next(htsfp, itr, r) ⇒ Object Also known as: bam_itr_next

Get the next read from a SAM/BAM/CRAM iterator



379
380
381
382
383
384
385
# File 'lib/hts/libhts/sam.rb', line 379

def self.sam_itr_next(htsfp, itr, r)
  # FIXME: check if htsfp is compressed BGZF
  raise("Null iterator") if itr.null?

  # FIXME: check multi
  hts_itr_next(htsfp[:fp][:bgzf], itr, r, htsfp)
end

.sam_itr_queryi(int) ⇒ by_ref Also known as: bam_itr_queryi

Create a BAM/CRAM iterator

Returns:

  • (by_ref)

    the return value of attach_function



355
356
357
358
# File 'lib/hts/libhts/sam.rb', line 355

attach_function \
:sam_itr_queryi,
[HtsIdx, :int, :hts_pos_t, :hts_pos_t],
HtsItr.by_ref

.sam_itr_querys(string) ⇒ by_ref Also known as: bam_itr_querys

Create a SAM/BAM/CRAM iterator

Returns:

  • (by_ref)

    the return value of attach_function



361
362
363
364
# File 'lib/hts/libhts/sam.rb', line 361

attach_function \
:sam_itr_querys,
[HtsIdx, SamHdr, :string],
HtsItr.by_ref

.sam_itr_regarray(pointer) ⇒ by_ref

Create a multi-region iterator

Returns:

  • (by_ref)

    the return value of attach_function



373
374
375
376
# File 'lib/hts/libhts/sam.rb', line 373

attach_function \
:sam_itr_regarray,
[HtsIdx, SamHdr, :pointer, :uint],
HtsItr.by_ref

.sam_itr_regions(uint) ⇒ by_ref

Create a multi-region iterator

Returns:

  • (by_ref)

    the return value of attach_function



367
368
369
370
# File 'lib/hts/libhts/sam.rb', line 367

attach_function \
:sam_itr_regions,
[HtsIdx, SamHdr, HtsReglist, :uint],
HtsItr.by_ref

.sam_open_mode(string) ⇒ int

macros (or alias) sam_open sam_open_format sam_close

Returns:

  • (int)

    the return value of attach_function



399
400
401
402
# File 'lib/hts/libhts/sam.rb', line 399

attach_function \
:sam_open_mode,
%i[string string string],
:int

.sam_open_mode_opts(string) ⇒ string

A version of sam_open_mode that can handle ,key=value options.

Returns:

  • (string)

    the return value of attach_function



405
406
407
408
# File 'lib/hts/libhts/sam.rb', line 405

attach_function \
:sam_open_mode_opts,
%i[string string string],
:string

.sam_parse1([KString, SamHdr, Bam1]) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



415
416
417
418
# File 'lib/hts/libhts/sam.rb', line 415

attach_function \
:sam_parse1,
[KString, SamHdr, Bam1],
:int

.sam_parse_cigar(string) ⇒ ssize_t

Parse a CIGAR string into a uint32_t array

Returns:

  • (ssize_t)

    the return value of attach_function



295
296
297
298
# File 'lib/hts/libhts/sam.rb', line 295

attach_function \
:sam_parse_cigar,
%i[string pointer pointer pointer],
:ssize_t

.sam_parse_region(string) ⇒ string

Returns the return value of attach_function.

Returns:

  • (string)

    the return value of attach_function



387
388
389
390
# File 'lib/hts/libhts/sam.rb', line 387

attach_function \
:sam_parse_region,
[SamHdr, :string, :pointer, :pointer, :pointer, :int],
:string

.sam_passes_filter(pointer) ⇒ int

Checks whether a record passes an hts_filter.

Returns:

  • (int)

    the return value of attach_function



438
439
440
441
# File 'lib/hts/libhts/sam.rb', line 438

attach_function \
:sam_passes_filter,
[SamHdr, Bam1, :pointer], # hts_filter_t
:int

.sam_prob_realn(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



666
667
668
669
# File 'lib/hts/libhts/sam.rb', line 666

attach_function \
:sam_prob_realn,
[Bam1, :string, :hts_pos_t, :int],
:int

.sam_read1([HtsFile, SamHdr, Bam1]) ⇒ int

Read a record from a file

Returns:

  • (int)

    the return value of attach_function



426
427
428
429
# File 'lib/hts/libhts/sam.rb', line 426

attach_function \
:sam_read1,
[HtsFile, SamHdr, Bam1],
:int

.sam_write1([HtsFile, SamHdr, Bam1]) ⇒ int

Write a record to a file

Returns:

  • (int)

    the return value of attach_function



432
433
434
435
# File 'lib/hts/libhts/sam.rb', line 432

attach_function \
:sam_write1,
[HtsFile, SamHdr, Bam1],
:int

.stringify_argv(int) ⇒ string

A function to help with construction of CL tags in @PG records.

Returns:

  • (string)

    the return value of attach_function



192
193
194
195
# File 'lib/hts/libhts/sam.rb', line 192

attach_function \
:stringify_argv,
%i[int pointer],
:string

.tbx_bgzf_itr_next(bgzfp, tbx, itr, r) ⇒ Object



27
28
29
# File 'lib/hts/libhts/tbx_funcs.rb', line 27

def tbx_bgzf_itr_next(bgzfp, tbx, itr, r)
  hts_itr_next(bgzfp, itr, r, tbx)
end

.tbx_destroy([Tbx]) ⇒ void

This method returns an undefined value.

Returns the return value of attach_function.



72
73
74
75
# File 'lib/hts/libhts/tbx.rb', line 72

attach_function \
:tbx_destroy,
[Tbx],
:void

.tbx_index(int) ⇒ by_ref

Build an index of the lines in a BGZF-compressed file

Returns:

  • (by_ref)

    the return value of attach_function



29
30
31
32
# File 'lib/hts/libhts/tbx.rb', line 29

attach_function \
:tbx_index,
[BGZF, :int, TbxConf],
Tbx.by_ref

.tbx_index_build(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



34
35
36
37
# File 'lib/hts/libhts/tbx.rb', line 34

attach_function \
:tbx_index_build,
[:string, :int, TbxConf],
:int

.tbx_index_build2(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



39
40
41
42
# File 'lib/hts/libhts/tbx.rb', line 39

attach_function \
:tbx_index_build2,
[:string, :string, :int, TbxConf],
:int

.tbx_index_build3(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



44
45
46
47
# File 'lib/hts/libhts/tbx.rb', line 44

attach_function \
:tbx_index_build3,
[:string, :string, :int, :int, TbxConf],
:int

.tbx_index_load(string) ⇒ by_ref

Load or stream a .tbi or .csi index

Returns:

  • (by_ref)

    the return value of attach_function



50
51
52
53
# File 'lib/hts/libhts/tbx.rb', line 50

attach_function \
:tbx_index_load,
[:string],
Tbx.by_ref

.tbx_index_load2(string) ⇒ by_ref

Load or stream a .tbi or .csi index

Returns:

  • (by_ref)

    the return value of attach_function



56
57
58
59
# File 'lib/hts/libhts/tbx.rb', line 56

attach_function \
:tbx_index_load2,
%i[string string],
Tbx.by_ref

.tbx_index_load3(string) ⇒ by_ref

Load or stream a .tbi or .csi index

Returns:

  • (by_ref)

    the return value of attach_function



62
63
64
65
# File 'lib/hts/libhts/tbx.rb', line 62

attach_function \
:tbx_index_load3,
%i[string string int],
Tbx.by_ref

.tbx_itr_destroy(iter) ⇒ Object



6
7
8
# File 'lib/hts/libhts/tbx_funcs.rb', line 6

def tbx_itr_destroy(iter)
  hts_itr_destroy(iter)
end

.tbx_itr_next(htsfp, tbx, itr, r) ⇒ Object



23
24
25
# File 'lib/hts/libhts/tbx_funcs.rb', line 23

def tbx_itr_next(htsfp, tbx, itr, r)
  hts_itr_next(hts_get_bgzfp(htsfp), itr, r, tbx)
end

.tbx_itr_queryi(tbx, tid, beg, end_) ⇒ Object



10
11
12
# File 'lib/hts/libhts/tbx_funcs.rb', line 10

def tbx_itr_queryi(tbx, tid, beg, end_)
  hts_itr_query(tbx[:idx], tid, beg, end_, @ffi_functions[:tbx_readrec])
end

.tbx_itr_querys(tbx, s) ⇒ Object



18
19
20
21
# File 'lib/hts/libhts/tbx_funcs.rb', line 18

def tbx_itr_querys(tbx, s)
  hts_itr_querys(tbx[:idx], s, @@tbx_name2id, tbx, @ffi_functions[:hts_itr_query],
                 @ffi_functions[:tbx_readrec])
end

.tbx_name2id(string) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



12
13
14
15
# File 'lib/hts/libhts/tbx.rb', line 12

attach_function \
:tbx_name2id,
[Tbx, :string],
:int

.tbx_readrec(pointer) ⇒ int

Returns the return value of attach_function.

Returns:

  • (int)

    the return value of attach_function



23
24
25
26
# File 'lib/hts/libhts/tbx.rb', line 23

attach_function \
:tbx_readrec,
[BGZF, :pointer, :pointer, :pointer, :pointer, :pointer],
:int

.tbx_seqnames(pointer) ⇒ pointer

Returns the return value of attach_function.

Returns:

  • (pointer)

    the return value of attach_function



67
68
69
70
# File 'lib/hts/libhts/tbx.rb', line 67

attach_function \
:tbx_seqnames,
[Tbx, :pointer],
:pointer

.vcf_format([BcfHdr, Bcf1, KString]) ⇒ int Also known as: vcf_format1

The opposite of vcf_parse.

Returns:

  • (int)

    the return value of attach_function



84
85
86
87
# File 'lib/hts/libhts/vcf.rb', line 84

attach_function \
:vcf_format,
[BcfHdr, Bcf1, KString],
:int

.vcf_hdr_read([HtsFile]) ⇒ by_ref

Read a VCF format header

Returns:

  • (by_ref)

    the return value of attach_function



119
120
121
122
# File 'lib/hts/libhts/vcf.rb', line 119

attach_function \
:vcf_hdr_read,
[HtsFile],
BcfHdr.by_ref

.vcf_hdr_write([HtsFile, BcfHdr]) ⇒ int

Write a VCF format header

Returns:

  • (int)

    the return value of attach_function



125
126
127
128
# File 'lib/hts/libhts/vcf.rb', line 125

attach_function \
:vcf_hdr_write,
[HtsFile, BcfHdr],
:int

.vcf_open_mode(string) ⇒ int

Complete the file opening mode, according to its extension.

Returns:

  • (int)

    the return value of attach_function



78
79
80
81
# File 'lib/hts/libhts/vcf.rb', line 78

attach_function \
:vcf_open_mode,
%i[string string string],
:int

.vcf_parse([KString, BcfHdr, Bcf1]) ⇒ int Also known as: vcf_parse1

Parse VCF line contained in kstring and populate the bcf1_t struct

Returns:

  • (int)

    the return value of attach_function



72
73
74
75
# File 'lib/hts/libhts/vcf.rb', line 72

attach_function \
:vcf_parse,
[KString, BcfHdr, Bcf1],
:int

.vcf_read([HtsFile, BcfHdr, Bcf1]) ⇒ int Also known as: vcf_read1

Read a record from a VCF file

Returns:

  • (int)

    the return value of attach_function



131
132
133
134
# File 'lib/hts/libhts/vcf.rb', line 131

attach_function \
:vcf_read,
[HtsFile, BcfHdr, Bcf1],
:int

.vcf_write([HtsFile, BcfHdr, Bcf1]) ⇒ int Also known as: vcf_write1

Write a record to a VCF file

Returns:

  • (int)

    the return value of attach_function



137
138
139
140
# File 'lib/hts/libhts/vcf.rb', line 137

attach_function \
:vcf_write,
[HtsFile, BcfHdr, Bcf1],
:int

.vcf_write_line([HtsFile, KString]) ⇒ int

Write a line to a VCF file

Returns:

  • (int)

    the return value of attach_function



149
150
151
152
# File 'lib/hts/libhts/vcf.rb', line 149

attach_function \
:vcf_write_line,
[HtsFile, KString],
:int