- bam_aux2A
char bam_aux2A(const(ubyte)* s)
@param s Pointer to the tag data, as returned by bam_aux_get().
@return The value, or 0 if the tag was not a character ('A') type
If the tag is not a character type, errno is set to EINVAL.
- bam_aux2Z
char* bam_aux2Z(const(ubyte)* s)
@param s Pointer to the tag data, as returned by bam_aux_get().
@return Pointer to the string, or NULL if the tag was not a string type
If the tag is not a string type ('Z' or 'H'), errno is set to EINVAL.
- bam_aux2f
double bam_aux2f(const(ubyte)* s)
@param s Pointer to the tag data, as returned by bam_aux_get()
@return The value, or 0 if the tag was not an integer type
If the tag is not an numeric type, errno is set to EINVAL. The value of
integer flags will be returned cast to a double.
- bam_aux2i
long bam_aux2i(const(ubyte)* s)
@param s Pointer to the tag data, as returned by bam_aux_get()
@return The value, or 0 if the tag was not an integer type
If the tag is not an integer type, errno is set to EINVAL. This function
will not return the value of floating-point tags.
- bam_auxB2f
double bam_auxB2f(const(ubyte)* s, uint idx)
@param s Pointer to the tag data, as returned by bam_aux_get().
@param idx 0-based Index into the array
@return The idx'th value, or 0.0 on error.
If the array is not a numeric type, errno is set to EINVAL. This can
only actually happen if the input record has an invalid type field. If
idx is greater than or equal to the value returned by bam_auxB_len(s),
errno is set to ERANGE. In both cases, 0.0 will be returned.
- bam_auxB2i
long bam_auxB2i(const(ubyte)* s, uint idx)
@param s Pointer to the tag data, as returned by bam_aux_get().
@param idx 0-based Index into the array
@return The idx'th value, or 0 on error.
If the array is not an integer type, errno is set to EINVAL. If idx
is greater than or equal to the value returned by bam_auxB_len(s),
errno is set to ERANGE. In both cases, 0 will be returned.
- bam_auxB_len
uint bam_auxB_len(const(ubyte)* s)
@param s Pointer to the tag data, as returned by bam_aux_get().
@return The length of the array, or 0 if the tag is not an array type.
If the tag is not an array type, errno is set to EINVAL.
- bam_aux_append
int bam_aux_append(bam1_t* b, const(char)[2] tag, char type, int len, const(ubyte)* data)
Append tag data to a bam record
- bam_aux_del
int bam_aux_del(bam1_t* b, ubyte* s)
Delete tag data from a bam record
- bam_aux_get
ubyte* bam_aux_get(const(bam1_t)* b, const(char)[2] tag)
@param b Pointer to the bam record
@param tag Desired aux tag
@return Pointer to the tag data, or NULL if tag is not present or on error
If the tag is not present, this function returns NULL and sets errno to
ENOENT. If the bam record's aux data is corrupt (either a tag has an
invalid type, or the last record is incomplete) then errno is set to
EINVAL and NULL is returned.
- bam_aux_get_str
int bam_aux_get_str(const(bam1_t)* b, const(char)[2] tag, kstring_t* s)
@param b Pointer to the bam record
@param tag Desired aux tag
@param s The kstring to write to.
- bam_aux_update_array
int bam_aux_update_array(bam1_t* b, const(char)[2] tag, ubyte type, uint items, void* data)
Update or add an array tag
- bam_aux_update_float
int bam_aux_update_float(bam1_t* b, const(char)[2] tag, float val)
Update or add a floating-point tag
- bam_aux_update_int
int bam_aux_update_int(bam1_t* b, const(char)[2] tag, long val)
Update or add an integer tag
- bam_aux_update_str
int bam_aux_update_str(bam1_t* b, const(char)[2] tag, int len, const(char)* data)
Update or add a string-type tag
- bam_cigar2qlen
hts_pos_t bam_cigar2qlen(int n_cigar, const(uint)* cigar)
@param n_cigar Number of items in @p cigar
@param cigar CIGAR data
@return Query length
- bam_cigar2rlen
hts_pos_t bam_cigar2rlen(int n_cigar, const(uint)* cigar)
@param n_cigar Number of items in @p cigar
@param cigar CIGAR data
@return Reference length
- bam_cigar_gen
auto bam_cigar_gen(T0 l, T1 o)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_cigar_op
auto bam_cigar_op(T c)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_cigar_oplen
auto bam_cigar_oplen(T c)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_cigar_type
auto bam_cigar_type(T o)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_copy1
bam1_t* bam_copy1(bam1_t* bdst, const(bam1_t)* bsrc)
@param bdst Destination alignment record
@param bsrc Source alignment record
@return bdst on success; NULL on failure
- bam_destroy1
void bam_destroy1(bam1_t* b)
@param b structure to destroy
- bam_dup1
bam1_t* bam_dup1(const(bam1_t)* bsrc)
@param bsrc Source alignment record
@return Pointer to a new alignment record on success; NULL on failure
- bam_endpos
hts_pos_t bam_endpos(const(bam1_t)* b)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_flag2str
char* bam_flag2str(int flag)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_get_aux
auto bam_get_aux(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_get_cigar
auto bam_get_cigar(bam1_t* b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_get_l_aux
auto bam_get_l_aux(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_get_mempolicy
uint bam_get_mempolicy(bam1_t* b)
@param b Alignment record
- bam_get_qname
auto bam_get_qname(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_get_qual
auto bam_get_qual(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_get_seq
auto bam_get_seq(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_hdr_destroy
void bam_hdr_destroy(sam_hdr_t* h)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_hdr_dup
sam_hdr_t* bam_hdr_dup(const(sam_hdr_t)* h0)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_hdr_init
sam_hdr_t* bam_hdr_init()
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_hdr_read
sam_hdr_t* bam_hdr_read(BGZF* fp)
Read the header from a BAM compressed file.
- bam_hdr_write
int bam_hdr_write(BGZF* fp, const(sam_hdr_t)* h)
Writes the header to a BAM file.
- bam_index_build
auto bam_index_build(T0 fn, T1 min_shift)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_index_load
auto bam_index_load(T fn)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_init1
bam1_t* bam_init1()
@return An empty bam1_t structure on success, NULL on failure
- bam_is_mrev
auto bam_is_mrev(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_is_rev
auto bam_is_rev(T b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_itr_next
auto bam_itr_next(T0 htsfp, T1 itr, T2 r)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_mplp64_auto
int bam_mplp64_auto(bam_mplp_t iter, int* _tid, hts_pos_t* _pos, int* n_plp, const(bam_pileup1_t*)* plp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_mplp_auto
int bam_mplp_auto(bam_mplp_t iter, int* _tid, int* _pos, int* n_plp, const(bam_pileup1_t*)* plp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_mplp_constructor
void bam_mplp_constructor(bam_mplp_t iter, int function(void* data, const(bam1_t)* b, bam_pileup_cd* cd) func)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_mplp_destroy
void bam_mplp_destroy(bam_mplp_t iter)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_mplp_destructor
void bam_mplp_destructor(bam_mplp_t iter, int function(void* data, const(bam1_t)* b, bam_pileup_cd* cd) func)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_mplp_init
bam_mplp_t bam_mplp_init(int n, bam_plp_auto_f func, void** data)
The struct returned by a successful call should be freed
via bam_mplp_destroy() when it is no longer needed.
- bam_mplp_init_overlaps
int bam_mplp_init_overlaps(bam_mplp_t iter)
@param iter mpileup iterator
@return 0 on success; a negative value on error
- bam_mplp_reset
void bam_mplp_reset(bam_mplp_t iter)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_mplp_set_maxcnt
void bam_mplp_set_maxcnt(bam_mplp_t iter, int maxcnt)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_name2id
int bam_name2id(sam_hdr_t* h, const(char)* ref_)
Alias of sam_hdr_name2tid(), for backwards compatibility.
- bam_parse_cigar
ssize_t bam_parse_cigar(const(char)* in_, char** end, bam1_t* b)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp64_auto
const(bam_pileup1_t)* bam_plp64_auto(bam_plp_t iter, int* _tid, hts_pos_t* _pos, int* _n_plp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp64_next
const(bam_pileup1_t)* bam_plp64_next(bam_plp_t iter, int* _tid, hts_pos_t* _pos, int* _n_plp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_auto
const(bam_pileup1_t)* bam_plp_auto(bam_plp_t iter, int* _tid, int* _pos, int* _n_plp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_constructor
void bam_plp_constructor(bam_plp_t plp, int function(void* data, const(bam1_t)* b, bam_pileup_cd* cd) func)
bam_plp_constructor() - sets a callback to initialise any per-pileup1_t fields.
@plp: The bam_plp_t initialised using bam_plp_init.
@func: The callback function itself. When called, it is given the
data argument (specified in bam_plp_init), the bam structure and
a pointer to a locally allocated bam_pileup_cd union. This union
will also be present in each bam_pileup1_t created.
- bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_destructor
void bam_plp_destructor(bam_plp_t plp, int function(void* data, const(bam1_t)* b, bam_pileup_cd* cd) func)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_init
bam_plp_t bam_plp_init(bam_plp_auto_f func, void* data)
bam_plp_init() - sets an iterator over multiple
@func: see mplp_func in bam_plcmd.c in samtools for an example. Expected return
status: 0 on success, -1 on end, < -1 on non-recoverable errors
@data: user data to pass to @func
- bam_plp_insertion
int bam_plp_insertion(const(bam_pileup1_t)* p, kstring_t* ins, int* del_len)
@param p pileup data
@param ins the kstring where the insertion sequence will be written
@param del_len location for deletion length
@return the length of insertion string on success; -1 on failure.
- bam_plp_next
const(bam_pileup1_t)* bam_plp_next(bam_plp_t iter, int* _tid, int* _pos, int* _n_plp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_push
int bam_plp_push(bam_plp_t iter, const(bam1_t)* b)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_reset
void bam_plp_reset(bam_plp_t iter)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_plp_set_maxcnt
void bam_plp_set_maxcnt(bam_plp_t iter, int maxcnt)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_read1
int bam_read1(BGZF* fp, bam1_t* b)
@param fp BGZF file being read
@param b Destination for the alignment data
@return number of bytes read on success
-1 at end of file
< -1 on failure
- bam_seqi
auto bam_seqi(T0 s, T1 i)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_set1
int bam_set1(bam1_t* bam, size_t l_qname, const(char)* qname, ushort flag, int tid, hts_pos_t pos, ubyte mapq, size_t n_cigar, const(uint)* cigar, int mtid, hts_pos_t mpos, hts_pos_t isize, size_t l_seq, const(char)* seq, const(char)* qual, size_t l_aux)
@param bam Target alignment structure. Must be initialized by a call to bam_init1().
The data field will be reallocated automatically as needed.
@param l_qname Length of the query name. If set to 0, the placeholder query name "*" will be used.
@param qname Query name, may be NULL if l_qname = 0
@param flag Bitwise flag, a combination of the BAM_F* constants.
@param tid Chromosome ID, defined by sam_hdr_t (a.k.a. RNAME).
@param pos 0-based leftmost coordinate.
@param mapq Mapping quality.
@param n_cigar Number of CIGAR operations.
@param cigar CIGAR data, may be NULL if n_cigar = 0.
@param mtid Chromosome ID of next read in template, defined by sam_hdr_t (a.k.a. RNEXT).
@param mpos 0-based leftmost coordinate of next read in template (a.k.a. PNEXT).
@param isize Observed template length ("insert size") (a.k.a. TLEN).
@param l_seq Length of the query sequence (read) and sequence quality string.
@param seq Sequence, may be NULL if l_seq = 0.
@param qual Sequence quality, may be NULL.
@param l_aux Length to be reserved for auxiliary field data, may be 0.
- bam_set_mempolicy
void bam_set_mempolicy(bam1_t* b, uint policy)
@param b Alignment record
@param policy Desired policy
- bam_set_qname
int bam_set_qname(bam1_t* b, const(char)* qname)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_set_seqi
void bam_set_seqi(T0 s, T1 i, T3 b)
Undocumented in source. Be warned that the author may not have intended to support it.
- bam_str2flag
int bam_str2flag(const(char)* str)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- bam_write1
int bam_write1(BGZF* fp, const(bam1_t)* b)
@param fp BGZF file being written
@param b Alignment record to write
@return number of bytes written on success
-1 on error
- sam_cap_mapq
int sam_cap_mapq(bam1_t* b, const(char)* ref_, hts_pos_t ref_len, int thres)
BAQ calculation and realignment *
- sam_format1
int sam_format1(const(sam_hdr_t)* h, const(bam1_t)* b, kstring_t* str)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_format_aux1
const(ubyte)* sam_format_aux1(const(ubyte)* key, ubyte type, const(ubyte)* tag, const(ubyte)* end, kstring_t* ks)
** Manipulating auxiliary fields ***
Converts a BAM aux tag to SAM format
- sam_hdr_add_line
int sam_hdr_add_line(sam_hdr_t* h, const(char)* type, ...)
Adds a single line to an existing header.
- sam_hdr_add_lines
int sam_hdr_add_lines(sam_hdr_t* h, const(char)* lines, size_t len)
Add formatted lines to an existing header.
- sam_hdr_add_pg
int sam_hdr_add_pg(sam_hdr_t* h, const(char)* name, ...)
- sam_hdr_change_HD
int sam_hdr_change_HD(sam_hdr_t* h, const(char)* key, const(char)* val)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_hdr_count_lines
int sam_hdr_count_lines(sam_hdr_t* h, const(char)* type)
Count the number of lines for a given header type
- sam_hdr_destroy
void sam_hdr_destroy(sam_hdr_t* h)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_hdr_dup
sam_hdr_t* sam_hdr_dup(const(sam_hdr_t)* h0)
Duplicate a header structure.
- sam_hdr_find_hd
auto sam_hdr_find_hd(T0 h, T1 ks)
Returns the SAM formatted text of the \@HD header line
- sam_hdr_find_line_id
int sam_hdr_find_line_id(sam_hdr_t* h, const(char)* type, const(char)* ID_key, const(char)* ID_val, kstring_t* ks)
Returns a complete line of formatted text for a given type and ID.
- sam_hdr_find_line_pos
int sam_hdr_find_line_pos(sam_hdr_t* h, const(char)* type, int pos, kstring_t* ks)
Returns a complete line of formatted text for a given type and index.
- sam_hdr_find_tag_hd
auto sam_hdr_find_tag_hd(T0 h, T1 key, T2 ks)
Returns the value associated with a given \@HD line tag
- sam_hdr_find_tag_id
int sam_hdr_find_tag_id(sam_hdr_t* h, const(char)* type, const(char)* ID_key, const(char)* ID_value, const(char)* key, kstring_t* ks)
Return the value associated with a key for a header line identified by ID_key:ID_val
- sam_hdr_find_tag_pos
int sam_hdr_find_tag_pos(sam_hdr_t* h, const(char)* type, int pos, const(char)* key, kstring_t* ks)
Return the value associated with a key for a header line identified by position
- sam_hdr_incr_ref
void sam_hdr_incr_ref(sam_hdr_t* h)
Increments the reference count on a header
- sam_hdr_init
sam_hdr_t* sam_hdr_init()
** BAM I/O ***
Generates a new unpopulated header structure.
- sam_hdr_length
size_t sam_hdr_length(sam_hdr_t* h)
Returns the current length of the header text.
- sam_hdr_line_index
int sam_hdr_line_index(sam_hdr_t* bh, const(char)* type, const(char)* key)
Index of the line for the types that have dedicated look-up tables (SQ, RG, PG)
- sam_hdr_line_name
const(char)* sam_hdr_line_name(sam_hdr_t* bh, const(char)* type, int pos)
Id key of the line for the types that have dedicated look-up tables (SQ, RG, PG)
- sam_hdr_name2tid
int sam_hdr_name2tid(sam_hdr_t* h, const(char)* ref_)
Get the target id for a given reference sequence name
- sam_hdr_nref
int sam_hdr_nref(const(sam_hdr_t)* h)
Returns the number of references in the header.
- sam_hdr_parse
sam_hdr_t* sam_hdr_parse(size_t l_text, const(char)* text)
Create a header from existing text.
- sam_hdr_pg_id
const(char)* sam_hdr_pg_id(sam_hdr_t* h, const(char)* name)
Generate a unique \@PG ID: value
- sam_hdr_read
sam_hdr_t* sam_hdr_read(samFile* fp)
Read a header from a SAM, BAM or CRAM file.
- sam_hdr_remove_except
int sam_hdr_remove_except(sam_hdr_t* h, const(char)* type, const(char)* ID_key, const(char)* ID_value)
Remove all lines of a given type from a header, except the one matching an ID
- sam_hdr_remove_line_id
int sam_hdr_remove_line_id(sam_hdr_t* h, const(char)* type, const(char)* ID_key, const(char)* ID_value)
Remove a line with given type / id from a header
- sam_hdr_remove_line_pos
int sam_hdr_remove_line_pos(sam_hdr_t* h, const(char)* type, int position)
Remove nth line of a given type from a header
- sam_hdr_remove_lines
int sam_hdr_remove_lines(sam_hdr_t* h, const(char)* type, const(char)* id, void* rh)
Remove header lines of a given type, except those in a given ID set
- sam_hdr_remove_tag_hd
auto sam_hdr_remove_tag_hd(T0 h, T1 key)
Removes the \@HD line tag with the given key
- sam_hdr_remove_tag_id
int sam_hdr_remove_tag_id(sam_hdr_t* h, const(char)* type, const(char)* ID_key, const(char)* ID_value, const(char)* key)
Remove the key from the line identified by type, ID_key and ID_value.
- sam_hdr_str
const(char)* sam_hdr_str(sam_hdr_t* h)
Returns the text representation of the header.
- sam_hdr_tid2len
hts_pos_t sam_hdr_tid2len(const(sam_hdr_t)* h, int tid)
Get the reference sequence length from a target index
- sam_hdr_tid2name
const(char)* sam_hdr_tid2name(const(sam_hdr_t)* h, int tid)
Get the reference sequence name from a target index
- sam_hdr_update_hd
auto sam_hdr_update_hd(T h, A a)
Adds or updates tags on the header \@HD line
- sam_hdr_update_line
int sam_hdr_update_line(sam_hdr_t* h, const(char)* type, const(char)* ID_key, const(char)* ID_value, ...)
Add or update tag key,value pairs in a header line.
- sam_hdr_write
int sam_hdr_write(samFile* fp, const(sam_hdr_t)* h)
Write a header to a SAM, BAM or CRAM file.
- sam_idx_init
int sam_idx_init(htsFile* fp, sam_hdr_t* h, int min_shift, const(char)* fnidx)
@param fp File handle for the data file being written.
@param h Bam header structured (needed for BAI and CSI).
@param min_shift 0 for BAI, or larger for CSI (CSI defaults to 14).
@param fnidx Filename to write index to. This pointer must remain valid
until after sam_idx_save is called.
@return 0 on success, <0 on failure.
- sam_idx_save
int sam_idx_save(htsFile* fp)
@param fp File handle for the data file being written.
@return 0 on success, <0 on failure.
- sam_index_build
int sam_index_build(const(char)* fn, int min_shift)
@param fn Input BAM/etc filename, to which .csi/etc will be added
@param min_shift Positive to generate CSI, or 0 to generate BAI
@return 0 if successful, or negative if an error occurred (usually -1; or
-2: opening fn failed; -3: format not indexable; -4:
failed to create and/or save the index)
- sam_index_build2
int sam_index_build2(const(char)* fn, const(char)* fnidx, int min_shift)
@param fn Input BAM/CRAM/etc filename
@param fnidx Output filename, or NULL to add .bai/.csi/etc to @a fn
@param min_shift Positive to generate CSI, or 0 to generate BAI
@return 0 if successful, or negative if an error occurred (see
sam_index_build for error codes)
- sam_index_build3
int sam_index_build3(const(char)* fn, const(char)* fnidx, int min_shift, int nthreads)
@param fn Input BAM/CRAM/etc filename
@param fnidx Output filename, or NULL to add .bai/.csi/etc to @a fn
@param min_shift Positive to generate CSI, or 0 to generate BAI
@param nthreads Number of threads to use when building the index
@return 0 if successful, or negative if an error occurred (see
sam_index_build for error codes)
- sam_index_load
hts_idx_t* sam_index_load(htsFile* fp, const(char)* fn)
@param fp File handle of the data file whose index is being opened
@param fn BAM/CRAM/etc filename to search alongside for the index file
@return The index, or NULL if an error occurred.
- sam_index_load2
hts_idx_t* sam_index_load2(htsFile* fp, const(char)* fn, const(char)* fnidx)
@param fp File handle of the data file whose index is being opened
@param fn BAM/CRAM/etc data file filename
@param fnidx Index filename, or NULL to search alongside @a fn
@return The index, or NULL if an error occurred.
- sam_index_load3
hts_idx_t* sam_index_load3(htsFile* fp, const(char)* fn, const(char)* fnidx, int flags)
@param fp File handle of the data file whose index is being opened
@param fn BAM/CRAM/etc data file filename
@param fnidx Index filename, or NULL to search alongside @a fn
@param flags Flags to alter behaviour (see description)
@return The index, or NULL if an error occurred.
- sam_itr_next
int sam_itr_next(htsFile* htsfp, hts_itr_t* itr, bam1_t* r)
@param htsfp Htsfile pointer for the input file
@param itr Iterator
@param r Pointer to a bam1_t struct
@return >= 0 on success; -1 when there is no more data; < -1 on error
- sam_itr_queryi
hts_itr_t* sam_itr_queryi(const(hts_idx_t)* idx, int tid, hts_pos_t beg, hts_pos_t end)
@param idx Index
@param tid Target id
@param beg Start position in target
@param end End position in target
@return An iterator on success; NULL on failure
- sam_itr_querys
hts_itr_t* sam_itr_querys(const(hts_idx_t)* idx, sam_hdr_t* hdr, const(char)* region)
@param idx Index
@param hdr Header
@param region Region specification
@return An iterator on success; NULL on failure
- sam_itr_regarray
hts_itr_t* sam_itr_regarray(const(hts_idx_t)* idx, sam_hdr_t* hdr, char** regarray, uint regcount)
@param idx Index
@param hdr Header
@param regarray Array of ref:interval region specifiers
@param regcount Number of items in regarray
- sam_itr_regions
hts_itr_t* sam_itr_regions(const(hts_idx_t)* idx, sam_hdr_t* hdr, hts_reglist_t* reglist, uint regcount)
@param idx Index
@param hdr Header
@param reglist Array of regions to iterate over
@param regcount Number of items in reglist
- sam_open_mode
int sam_open_mode(char* mode, const(char)* fn, const(char)* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_open_mode_opts
char* sam_open_mode_opts(const(char)* fn, const(char)* mode, const(char)* format)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_parse1
int sam_parse1(kstring_t* s, sam_hdr_t* h, bam1_t* b)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_parse_cigar
ssize_t sam_parse_cigar(const(char)* in_, char** end, uint** a_cigar, size_t* a_mem)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_parse_region
const(char)* sam_parse_region(sam_hdr_t* h, const(char)* s, int* tid, hts_pos_t* beg, hts_pos_t* end, int flags)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
- sam_passes_filter
int sam_passes_filter(const(sam_hdr_t)* h, const(bam1_t)* b, hts_filter_t* filt)
@param h Pointer to the header structure previously read
@param b Pointer to the BAM record to be checked
@param filt Pointer to the filter, created from hts_filter_init.
@return 1 if passes, 0 if not, and <0 on error.
- sam_prob_realn
int sam_prob_realn(bam1_t* b, const(char)* ref_, hts_pos_t ref_len, int flag)
@param b BAM record
@param ref Reference sequence
@param ref_len Reference sequence length
@param flag Flags, see description
@return 0 on success \n
-1 if the read was unmapped, zero length, had no quality values, did not have at least one M, X or = CIGAR operator, or included a reference skip. \n
-3 if BAQ alignment has already been done and does not need to be applied, or has already been applied. \n
-4 if alignment failed (most likely due to running out of memory)
- sam_read1
int sam_read1(samFile* fp, sam_hdr_t* h, bam1_t* b)
@param fp Pointer to the source file
@param h Pointer to the header previously read (fully or partially)
@param b Pointer to the record placeholder
@return >= 0 on successfully reading a new record, -1 on end of stream, < -1 on error
- sam_write1
int sam_write1(samFile* fp, const(sam_hdr_t)* h, const(bam1_t)* b)
@param fp Pointer to the destination file
@param h Pointer to the header structure previously read
@param b Pointer to the record to be written
@return >= 0 on successfully writing the record, -1 on error
- stringify_argv
char* stringify_argv(int argc, char** argv)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
@file htslib/sam.h High-level SAM/BAM/CRAM sequence file operations.