Module: HTS::LibHTS

Extended by:
FFI::Library
Defined in:
lib/hts/libhts.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/faidx.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/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
)
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
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)
HtsTpoolProcess =

FIXME: struct

:pointer
HtsTpoolResult =
:pointer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attach_functionObject



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

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

.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_get_aux(b) ⇒ Object



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

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



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

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

.bam_get_l_aux(b) ⇒ Object



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

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



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

def bam_get_qname(b)
  b[:data]
end

.bam_get_qual(b) ⇒ Object



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

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



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

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

.bam_is_mrev(b) ⇒ Object



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

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

.bam_is_rev(b) ⇒ Object



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

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

.bam_seqi(s, i) ⇒ Object



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

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

.bcf_alleles2gt(a, b) ⇒ Object



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

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

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



181
182
183
# File 'lib/hts/libhts/vcf_funcs.rb', line 181

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



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

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



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

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_genotypes(hdr, line, dst, ndst) ⇒ Object



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

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

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



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

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



161
162
163
# File 'lib/hts/libhts/vcf_funcs.rb', line 161

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_int32(hdr, line, tag, dst, ndst) ⇒ Object



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

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



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

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

.bcf_gt_allele(val) ⇒ Object



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

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

.bcf_gt_is_missing(val) ⇒ Object



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

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

.bcf_gt_is_phased(idx) ⇒ Object



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

def bcf_gt_is_phased(idx)
  ((idx) & 1)
end

.bcf_gt_missingObject



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

def bcf_gt_missing
  0
end

.bcf_gt_phased(idx) ⇒ Object



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

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

.bcf_gt_unphased(idx) ⇒ Object



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

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

.bcf_hdr_id2coltype(hdr, type, int_id) ⇒ Object



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

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_id2length(hdr, type, int_id) ⇒ Object



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

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



200
201
202
203
204
205
206
207
# File 'lib/hts/libhts/vcf_funcs.rb', line 200

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



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

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



223
224
225
226
227
228
# File 'lib/hts/libhts/vcf_funcs.rb', line 223

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_int2id(hdr, type, int_id) ⇒ Object



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

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_name2id(hdr, id) ⇒ Object



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

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

.bcf_hdr_nsamples(hdr) ⇒ Object



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

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

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



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

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



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

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



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

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

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



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

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

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



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

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



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

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



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

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



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

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

.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

.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

.sam_itr_next(htsfp, itr, r) ⇒ Object

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

Instance Method Details

#bam_aux2A(pointer) ⇒ char

Get a character aux value



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

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

#bam_aux2f(pointer) ⇒ double

Get an integer aux value



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

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

#bam_aux2i(pointer) ⇒ int64

Get an integer aux value



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

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

#bam_aux2Z(pointer) ⇒ string

Get a string aux value



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

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

#bam_aux_append(string) ⇒ int

Append tag data to a bam record



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

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

#bam_aux_del(pointer) ⇒ int

Delete tag data from a bam record



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

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

#bam_aux_get(string) ⇒ pointer

Return a pointer to an aux record



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

attach_function \
:bam_aux_get,
[Bam1, :string], # FIXME
:pointer

#bam_aux_update_array(string) ⇒ int

Update or add an array tag



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

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



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

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

#bam_aux_update_int(string) ⇒ int

Update or add an integer tag



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

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

#bam_aux_update_str(string) ⇒ int

Update or add a string-type tag



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

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



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

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

#bam_auxB2i(pointer) ⇒ int64

Get an integer value from an array-type tag



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

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

#bam_auxB_len(pointer) ⇒ uint

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



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

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

#bam_cigar2qlen(int) ⇒ int64

Calculate query length from CIGAR data



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



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

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

#bam_copy1([Bam1, Bam1]) ⇒ by_ref

Copy alignment record data



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



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.



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

attach_function \
:bam_endpos,
[Bam1],
:hts_pos_t

#bam_flag2str(int) ⇒ string



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

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

#bam_hdr_read([BGZF]) ⇒ by_ref

Read the header from a BAM compressed file.



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.



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

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

#bam_init1([]) ⇒ by_ref

Create a new bam1_t alignment structure



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

attach_function \
:bam_init1,
[],
Bam1.by_ref

#bam_mods_at_next_pos(pointer) ⇒ int

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



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

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.



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

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

#bam_mplp64_auto(bam_mplp) ⇒ int



623
624
625
626
# File 'lib/hts/libhts/sam.rb', line 623

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

#bam_mplp_auto(bam_mplp) ⇒ int



618
619
620
621
# File 'lib/hts/libhts/sam.rb', line 618

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

#bam_mplp_constructor(bam_mplp) ⇒ void



633
634
635
636
# File 'lib/hts/libhts/sam.rb', line 633

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

#bam_mplp_destroy(bam_mplp) ⇒ void



608
609
610
611
# File 'lib/hts/libhts/sam.rb', line 608

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

#bam_mplp_destructor(bam_mplp) ⇒ void



638
639
640
641
# File 'lib/hts/libhts/sam.rb', line 638

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

#bam_mplp_init(int) ⇒ bam_mplp



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

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

#bam_mplp_init_overlaps(bam_mplp) ⇒ int



603
604
605
606
# File 'lib/hts/libhts/sam.rb', line 603

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

#bam_mplp_reset(bam_mplp) ⇒ void



628
629
630
631
# File 'lib/hts/libhts/sam.rb', line 628

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

#bam_mplp_set_maxcnt(bam_mplp) ⇒ void



613
614
615
616
# File 'lib/hts/libhts/sam.rb', line 613

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



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

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.



666
667
668
669
# File 'lib/hts/libhts/sam.rb', line 666

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

#bam_parse_cigar(string) ⇒ ssize_t

Parse a CIGAR string into a bam1_t struct



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



558
559
560
561
# File 'lib/hts/libhts/sam.rb', line 558

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

#bam_plp64_next(bam_plp) ⇒ by_ref



553
554
555
556
# File 'lib/hts/libhts/sam.rb', line 553

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

#bam_plp_auto(bam_plp) ⇒ by_ref



548
549
550
551
# File 'lib/hts/libhts/sam.rb', line 548

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.



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

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

#bam_plp_destroy(bam_plp) ⇒ void



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

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

#bam_plp_destructor(bam_plp) ⇒ void



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

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

#bam_plp_init(bam_plp_auto_f) ⇒ bam_plp

sets an iterator over multiple



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

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

#bam_plp_insertion(pointer) ⇒ int

Get pileup padded insertion sequence



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

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

#bam_plp_insertion_mod(pointer) ⇒ int

Get pileup padded insertion sequence, including base modifications



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

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

#bam_plp_next(bam_plp) ⇒ by_ref



543
544
545
546
# File 'lib/hts/libhts/sam.rb', line 543

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

#bam_plp_push(bam_plp) ⇒ int



538
539
540
541
# File 'lib/hts/libhts/sam.rb', line 538

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

#bam_plp_reset(bam_plp) ⇒ void



568
569
570
571
# File 'lib/hts/libhts/sam.rb', line 568

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

#bam_plp_set_maxcnt(bam_plp) ⇒ void



563
564
565
566
# File 'lib/hts/libhts/sam.rb', line 563

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

#bam_read1([BGZF, Bam1]) ⇒ int

Read a BAM format alignment record



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

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

#bam_set1(size_t) ⇒ int

Set all components of an alignment structure



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_t,
 :int32_t,
 :hts_pos_t,
 :uint8_t,
 :size_t,
 :string,
 :int32_t,
 :hts_pos_t,
 :hts_pos_t,
 :size_t,
 :string,
 :string,
 :size_t],
:int

#bam_set_qname(string) ⇒ int

Set the name of the query



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

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

#bam_str2flag(string) ⇒ int



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



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

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

#bcf_add_filter(int) ⇒ int



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

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

#bcf_add_id(string) ⇒ int



317
318
319
320
# File 'lib/hts/libhts/vcf.rb', line 317

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

#bcf_clear([Bcf1]) ⇒ void



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

attach_function \
:bcf_clear,
[Bcf1],
:void

#bcf_copy([Bcf1, Bcf1]) ⇒ by_ref



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

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

#bcf_destroy([Bcf1]) ⇒ void



20
21
22
23
# File 'lib/hts/libhts/vcf.rb', line 20

attach_function \
:bcf_destroy,
[Bcf1],
:void

#bcf_dup([Bcf1]) ⇒ by_ref



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

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

#bcf_empty([Bcf1]) ⇒ void



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

attach_function \
:bcf_empty,
[Bcf1],
:void

#bcf_enc_vchar(int) ⇒ int



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

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

#bcf_enc_vfloat(int) ⇒ int



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

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

#bcf_enc_vint(int) ⇒ int



392
393
394
395
# File 'lib/hts/libhts/vcf.rb', line 392

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

#bcf_fmt_array(int) ⇒ int



377
378
379
380
# File 'lib/hts/libhts/vcf.rb', line 377

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

#bcf_fmt_sized_array(pointer) ⇒ uint8_t



382
383
384
385
# File 'lib/hts/libhts/vcf.rb', line 382

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

#bcf_get_fmt(string) ⇒ by_ref



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

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

#bcf_get_fmt_id(int) ⇒ by_ref



347
348
349
350
# File 'lib/hts/libhts/vcf.rb', line 347

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

#bcf_get_format_string(string) ⇒ int



362
363
364
365
# File 'lib/hts/libhts/vcf.rb', line 362

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

#bcf_get_format_values(string) ⇒ int



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

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

#bcf_get_info(string) ⇒ by_ref



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

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

#bcf_get_info_id(int) ⇒ by_ref



352
353
354
355
# File 'lib/hts/libhts/vcf.rb', line 352

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

#bcf_get_info_values(string) ⇒ int



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

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

#bcf_get_variant_type(int) ⇒ int



272
273
274
275
# File 'lib/hts/libhts/vcf.rb', line 272

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

#bcf_get_variant_types([Bcf1]) ⇒ int



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

attach_function \
:bcf_get_variant_types,
[Bcf1],
:int

#bcf_has_filter(string) ⇒ int



297
298
299
300
# File 'lib/hts/libhts/vcf.rb', line 297

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

#bcf_hdr_add_hrec([BcfHdr, BcfHrec]) ⇒ int



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

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

#bcf_hdr_add_sample(string) ⇒ int



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

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

#bcf_hdr_append(string) ⇒ int



162
163
164
165
# File 'lib/hts/libhts/vcf.rb', line 162

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

#bcf_hdr_destroy([BcfHdr]) ⇒ void



10
11
12
13
# File 'lib/hts/libhts/vcf.rb', line 10

attach_function \
:bcf_hdr_destroy,
[BcfHdr],
:void

#bcf_hdr_dup([BcfHdr]) ⇒ by_ref



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

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

#bcf_hdr_fmt_text(int) ⇒ string



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

attach_function \
:bcf_hdr_fmt_text,
[BcfHdr, :int, :pointer],
:string

#bcf_hdr_format(int) ⇒ int



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

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

#bcf_hdr_get_hrec(int) ⇒ by_ref



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

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

#bcf_hdr_get_version([BcfHdr]) ⇒ string



172
173
174
175
# File 'lib/hts/libhts/vcf.rb', line 172

attach_function \
:bcf_hdr_get_version,
[BcfHdr],
:string

#bcf_hdr_id2int(int) ⇒ int



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

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

#bcf_hdr_init(string) ⇒ by_ref



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

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

#bcf_hdr_merge([BcfHdr, BcfHdr]) ⇒ by_ref

DEPRECATED

attach_function \

:bcf_hdr_combine,
[BcfHdr, BcfHdr],
:int


137
138
139
140
# File 'lib/hts/libhts/vcf.rb', line 137

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

#bcf_hdr_parse(string) ⇒ int



197
198
199
200
# File 'lib/hts/libhts/vcf.rb', line 197

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

#bcf_hdr_parse_line(string) ⇒ by_ref



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

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

#bcf_hdr_printf(string) ⇒ int



167
168
169
170
# File 'lib/hts/libhts/vcf.rb', line 167

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

#bcf_hdr_read([HtsFile]) ⇒ by_ref



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

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

#bcf_hdr_remove(int) ⇒ void



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

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

#bcf_hdr_seqnames(pointer) ⇒ pointer



192
193
194
195
# File 'lib/hts/libhts/vcf.rb', line 192

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

#bcf_hdr_set(string) ⇒ int



147
148
149
150
# File 'lib/hts/libhts/vcf.rb', line 147

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

#bcf_hdr_set_samples(string) ⇒ int



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

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

#bcf_hdr_set_version(string) ⇒ int



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

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

#bcf_hdr_subset(int) ⇒ by_ref



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

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

#bcf_hdr_sync([BcfHdr]) ⇒ int



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

attach_function \
:bcf_hdr_sync,
[BcfHdr],
:int

#bcf_hdr_write([HtsFile, BcfHdr]) ⇒ int



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

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

#bcf_hrec_add_key(string) ⇒ int



232
233
234
235
# File 'lib/hts/libhts/vcf.rb', line 232

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

#bcf_hrec_destroy([BcfHrec]) ⇒ void



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

attach_function \
:bcf_hrec_destroy,
[BcfHrec],
:void

#bcf_hrec_dup([BcfHrec]) ⇒ by_ref



227
228
229
230
# File 'lib/hts/libhts/vcf.rb', line 227

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

#bcf_hrec_find_key(string) ⇒ int



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

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

#bcf_hrec_format([BcfHrec, KString]) ⇒ int



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

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

#bcf_hrec_set_val(int) ⇒ int



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

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

#bcf_idx_init(int) ⇒ int



427
428
429
430
# File 'lib/hts/libhts/vcf.rb', line 427

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

#bcf_idx_save([HtsFile]) ⇒ int



432
433
434
435
# File 'lib/hts/libhts/vcf.rb', line 432

attach_function \
:bcf_idx_save,
[HtsFile],
:int

#bcf_index_build(string) ⇒ int



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

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

#bcf_index_build2(string) ⇒ int



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

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

#bcf_index_build3(string) ⇒ int



422
423
424
425
# File 'lib/hts/libhts/vcf.rb', line 422

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

#bcf_index_load2(string) ⇒ by_ref



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

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

#bcf_index_load3(string) ⇒ by_ref



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

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

#bcf_init([]) ⇒ by_ref



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

attach_function \
:bcf_init,
[],
Bcf1.by_ref

#bcf_is_snp([Bcf1]) ⇒ int



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

attach_function \
:bcf_is_snp,
[Bcf1],
:int

#bcf_read([HtsFile, BcfHdr, Bcf1]) ⇒ int



70
71
72
73
# File 'lib/hts/libhts/vcf.rb', line 70

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

#bcf_readrec(pointer) ⇒ int



115
116
117
118
# File 'lib/hts/libhts/vcf.rb', line 115

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

#bcf_remove_filter(int) ⇒ int



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

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

#bcf_subset(int) ⇒ int



257
258
259
260
# File 'lib/hts/libhts/vcf.rb', line 257

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

#bcf_subset_format([BcfHdr, Bcf1]) ⇒ int



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

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

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



262
263
264
265
# File 'lib/hts/libhts/vcf.rb', line 262

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

#bcf_unpack(int) ⇒ int



75
76
77
78
# File 'lib/hts/libhts/vcf.rb', line 75

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

#bcf_update_alleles(pointer) ⇒ int



302
303
304
305
# File 'lib/hts/libhts/vcf.rb', line 302

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

#bcf_update_alleles_str(string) ⇒ int



307
308
309
310
# File 'lib/hts/libhts/vcf.rb', line 307

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

#bcf_update_filter(pointer) ⇒ int



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

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

#bcf_update_format(string) ⇒ int



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

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

#bcf_update_format_string(string) ⇒ int



327
328
329
330
# File 'lib/hts/libhts/vcf.rb', line 327

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

#bcf_update_id(string) ⇒ int



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

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

#bcf_update_info(string) ⇒ int



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

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

#bcf_write([HtsFile, BcfHdr, Bcf1]) ⇒ int



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

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 writen to each bgzip block.



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



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.



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.



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



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.



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.



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



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()



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()



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.



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.



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



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



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



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



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



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)



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.



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.



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.



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.



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.



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.



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.



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_thread_pool(pointer) ⇒ int

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



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



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



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).



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



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

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

#cram_block_get_comp_size(cram_block) ⇒ int32



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

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

#cram_block_get_content_id(cram_block) ⇒ int32



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

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

#cram_block_get_content_type(cram_block) ⇒ CramContentType



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

attach_function \
:cram_block_get_content_type,
[:cram_block],
CramContentType

#cram_block_get_crc32(cram_block) ⇒ int32



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

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

#cram_block_get_data(cram_block) ⇒ pointer



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

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

#cram_block_get_offset(cram_block) ⇒ size_t



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

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

#cram_block_get_uncomp_size(cram_block) ⇒ int32



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

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

#cram_block_set_comp_size(cram_block) ⇒ void



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

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

#cram_block_set_content_id(cram_block) ⇒ void



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

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

#cram_block_set_crc32(cram_block) ⇒ void



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

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

#cram_block_set_data(cram_block) ⇒ void



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

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

#cram_block_set_offset(cram_block) ⇒ void



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

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

#cram_block_set_uncomp_size(cram_block) ⇒ void



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

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

#cram_block_size(cram_block) ⇒ uint32



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

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

#cram_block_update_size(cram_block) ⇒ void



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

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

#cram_check_EOF(cram_fd) ⇒ int



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

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

#cram_close(cram_fd) ⇒ int



250
251
252
253
# File 'lib/hts/libhts/cram.rb', line 250

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

#cram_compress_block(cram_fd) ⇒ int



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

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

#cram_container_get_landmarks(cram_container) ⇒ pointer



70
71
72
73
# File 'lib/hts/libhts/cram.rb', line 70

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

#cram_container_get_length(cram_container) ⇒ int32



50
51
52
53
# File 'lib/hts/libhts/cram.rb', line 50

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

#cram_container_get_num_blocks(cram_container) ⇒ int32



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

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

#cram_container_is_empty(cram_fd) ⇒ int



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

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

#cram_container_set_landmarks(cram_container) ⇒ void



75
76
77
78
# File 'lib/hts/libhts/cram.rb', line 75

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

#cram_container_set_length(cram_container) ⇒ void



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

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

#cram_container_set_num_blocks(cram_container) ⇒ void



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

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

#cram_container_size(cram_container) ⇒ int



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

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

#cram_copy_slice(cram_fd) ⇒ int



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

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

#cram_dopen(pointer) ⇒ cram_fd



245
246
247
248
# File 'lib/hts/libhts/cram.rb', line 245

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

#cram_eof(cram_fd) ⇒ int



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

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

#cram_fd_get_fp(cram_fd) ⇒ by_ref



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

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

#cram_fd_get_header(cram_fd) ⇒ by_ref



10
11
12
13
# File 'lib/hts/libhts/cram.rb', line 10

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

#cram_fd_get_version(cram_fd) ⇒ int



20
21
22
23
# File 'lib/hts/libhts/cram.rb', line 20

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

#cram_fd_set_fp(cram_fd) ⇒ void



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

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

#cram_fd_set_header(cram_fd) ⇒ void



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

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

#cram_fd_set_version(cram_fd) ⇒ void



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

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

#cram_flush(cram_fd) ⇒ int



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

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

#cram_free_block(cram_block) ⇒ void



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

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

#cram_free_container(cram_container) ⇒ void



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

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

#cram_get_refs(by_ref) ⇒ pointer



295
296
297
298
# File 'lib/hts/libhts/cram.rb', line 295

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

#cram_major_vers(cram_fd) ⇒ int



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

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

#cram_minor_vers(cram_fd) ⇒ int



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

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

#cram_new_block(int) ⇒ cram_block



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

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

#cram_new_container(int) ⇒ cram_container

attach_function \

:cram_compress_block2,
%i[cram_fd cram_slice cram_block cram_metrics int int],
:int


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

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

#cram_open(string) ⇒ cram_fd



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

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

#cram_read_block(cram_fd) ⇒ cram_block



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

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

#cram_read_container(cram_fd) ⇒ cram_container



220
221
222
223
# File 'lib/hts/libhts/cram.rb', line 220

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

#cram_seek(pointer) ⇒ int



255
256
257
258
# File 'lib/hts/libhts/cram.rb', line 255

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

#cram_set_header(cram_fd) ⇒ int



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

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

#cram_set_option(cram_fd) ⇒ int



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

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

#cram_set_voption(cram_fd) ⇒ int



275
276
277
278
# File 'lib/hts/libhts/cram.rb', line 275

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

#cram_store_container(cram_fd) ⇒ int



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

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

#cram_transcode_rg(cram_fd) ⇒ int



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

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

#cram_uncompress_block(cram_block) ⇒ int



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

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

#cram_write_block(cram_fd) ⇒ int



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

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

#cram_write_container(cram_fd) ⇒ int



225
226
227
228
# File 'lib/hts/libhts/cram.rb', line 225

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

#errmod_cal(pointer) ⇒ int



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



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


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.



12
13
14
15
# File 'lib/hts/libhts/faidx.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.



6
7
8
9
# File 'lib/hts/libhts/faidx.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/faidx.rb', line 18

attach_function \
:fai_destroy,
[Faidx],
:void

#fai_fetch(string) ⇒ string

Fetch the sequence in a region



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

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

#fai_fetch64(string) ⇒ string

Fetch the sequence in a region



54
55
56
57
# File 'lib/hts/libhts/faidx.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



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

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

#fai_fetchqual64(string) ⇒ string



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

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

#fai_load(string) ⇒ by_ref

Load index from “fn.fai”.



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

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

#fai_load3(string) ⇒ by_ref

Load FASTA indexes.



24
25
26
27
# File 'lib/hts/libhts/faidx.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.



36
37
38
39
# File 'lib/hts/libhts/faidx.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”.



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

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

#fai_parse_region(string) ⇒ string

Parses a region string.



125
126
127
# File 'lib/hts/libhts/faidx.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



136
137
138
139
# File 'lib/hts/libhts/faidx.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/faidx.rb', line 130

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

#faidx_fetch_nseq([Faidx]) ⇒ int

Fetch the number of sequences



71
72
73
74
# File 'lib/hts/libhts/faidx.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



89
90
91
92
# File 'lib/hts/libhts/faidx.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



95
96
97
98
# File 'lib/hts/libhts/faidx.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



77
78
79
80
# File 'lib/hts/libhts/faidx.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



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

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

#faidx_has_seq(string) ⇒ int

Query if sequence is present



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

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

#faidx_iseq(int) ⇒ string

Return name of i-th sequence



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

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

#faidx_nseq([Faidx]) ⇒ int

Return number of sequences in fai index



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

attach_function \
:faidx_nseq,
[Faidx],
:int

#faidx_seq_len(string) ⇒ int

Return sequence length, -1 if not present



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

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

#haddextension(string) ⇒ string

Append an extension or replace an existing extension



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



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



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.



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.



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.



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



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.



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



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



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



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



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



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



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



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

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

#hseek(off_t) ⇒ off_t

Reposition the read/write stream offset



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

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

#hts_base_mod_state_alloc([]) ⇒ pointer

Allocates an hts_base_mode_state.



654
655
656
657
# File 'lib/hts/libhts/sam.rb', line 654

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.



660
661
662
663
# File 'lib/hts/libhts/sam.rb', line 660

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



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

attach_function \
:hts_check_EOF,
[HtsFile],
:int

#hts_close([HtsFile]) ⇒ int

Close a file handle, flushing buffered data for output streams



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



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



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



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



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

attach_function \
:hts_features,
[],
:uint

#hts_flush([HtsFile]) ⇒ int Also known as: bcf_flush, vcf_flush

For output streams, flush any buffered data



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



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.



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

attach_function \
:hts_format_file_extension,
[HtsFormat],
:string

#hts_free(pointer) ⇒ void



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()



11
12
13
14
# File 'lib/hts/libhts/tbx.rb', line 11

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

#hts_get_format([HtsFile]) ⇒ by_ref

Returns the file’s format information



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.



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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

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



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



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



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



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



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



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



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



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], # unsinged 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.



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

Open a sequence data (SAM/BAM/CRAM) or variant data (VCF/BCF) or possibly-compressed textual line-orientated file



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

Open a SAM/BAM/CRAM/VCF/BCF/etc file



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.



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.



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



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)



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)?)?



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



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



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



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



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



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



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



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



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.



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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

attach_function \
:hts_version,
[],
:string

#int32_put_blk(cram_block) ⇒ int



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

attach_function \
:int32_put_blk,
%i[cram_block int32_t],
:int

#kf_betai(double) ⇒ double



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



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.



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

attach_function \
:kf_gammap,
%i[double double],
:double

#kf_gammaq(double) ⇒ double



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



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

attach_function \
:kf_lgamma,
[:double],
:double

#kt_fisher_exact(int) ⇒ double



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



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



643
644
645
646
# File 'lib/hts/libhts/sam.rb', line 643

attach_function \
:sam_cap_mapq,
[Bam1, :string, :hts_pos_t, :int],
:int

#sam_format1([SamHdr, Bam1, KString]) ⇒ int



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.



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.



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.



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



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



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.



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

attach_function \
:sam_hdr_dup,
[SamHdr],
SamHdr.by_ref

#sam_hdr_find_line_id(string) ⇒ int

Returns a complete line of formatted text for a given type and ID.



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.



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_id(string) ⇒ int

Return the value associated with a key for a header line identified by ID_key:ID_val



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



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.



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.



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)



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)



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



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.



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.



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



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.



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



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



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



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



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_id(string) ⇒ int

Remove the key from the line identified by type, ID_key and ID_value.



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.



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



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



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

attach_function \
:sam_hdr_tid2name,
[SamHdr, :int],
:string

#sam_hdr_update_line(string) ⇒ int

Add or update tag key,value pairs in a header line.



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.



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 .



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.



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

attach_function \
:sam_idx_save,
[HtsFile],
:int

#sam_index_build(string) ⇒ int

Generate and save an index file



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



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



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



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



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



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_queryi(int) ⇒ by_ref

Create a BAM/CRAM iterator



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

Create a SAM/BAM/CRAM iterator



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



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



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



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.



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



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



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



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.



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



648
649
650
651
# File 'lib/hts/libhts/sam.rb', line 648

attach_function \
:sam_prob_realn,
[Bam1, :string, :hts_pos_t, :int],
:int

#sam_read1([HtsFile, SamHdr, Bam1]) ⇒ int

Read a record from a file



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



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.



192
193
194
195
# File 'lib/hts/libhts/sam.rb', line 192

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

#tbx_destroy([Tbx]) ⇒ void



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

attach_function \
:tbx_destroy,
[Tbx],
:void

#tbx_index(int) ⇒ by_ref

Build an index of the lines in a BGZF-compressed file



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

attach_function \
:tbx_index,
[BGZF, :int, TbxConf],
Tbx.by_ref

#tbx_index_build(string) ⇒ int



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

attach_function \
:tbx_index_build,
[:string, :int, TbxConf],
:int

#tbx_index_build2(string) ⇒ int



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

attach_function \
:tbx_index_build2,
[:string, :string, :int, TbxConf],
:int

#tbx_index_build3(string) ⇒ int



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

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



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

attach_function \
:tbx_index_load,
[:string],
Tbx.by_ref

#tbx_index_load2(string) ⇒ by_ref

Load or stream a .tbi or .csi index



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

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



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

attach_function \
:tbx_index_load3,
%i[string string int],
Tbx.by_ref

#tbx_name2id(string) ⇒ int



5
6
7
8
# File 'lib/hts/libhts/tbx.rb', line 5

attach_function \
:tbx_name2id,
[Tbx, :string],
:int

#tbx_readrec(pointer) ⇒ int



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

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

#tbx_seqnames(int) ⇒ pointer



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

attach_function \
:tbx_seqnames,
[Tbx, :int],
:pointer

#vcf_format([BcfHdr, Bcf1, KString]) ⇒ int



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

attach_function \
:vcf_format,
[BcfHdr, Bcf1, KString],
:int

#vcf_hdr_read([HtsFile]) ⇒ by_ref



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

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

#vcf_hdr_write([HtsFile, BcfHdr]) ⇒ int



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

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

#vcf_open_mode(string) ⇒ int



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

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

#vcf_parse([KString, BcfHdr, Bcf1]) ⇒ int



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

attach_function \
:vcf_parse,
[KString, BcfHdr, Bcf1],
:int

#vcf_read([HtsFile, BcfHdr, Bcf1]) ⇒ int



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

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

#vcf_write([HtsFile, BcfHdr, Bcf1]) ⇒ int



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

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

#vcf_write_line([HtsFile, KString]) ⇒ int



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

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