| 1 |
#ifndef HTSLIB_UTIL_H |
| 2 |
#define HTSLIB_UTIL_H |
| 3 |
|
| 4 |
#include "htslib/sam.h" |
| 5 |
#include "htslib/vcf.h" |
| 6 |
#include "htslib/khash.h" |
| 7 |
|
| 8 |
int hts_set_verbosity(int verbosity); |
| 9 |
int hts_get_verbosity(void); |
| 10 |
|
| 11 |
|
| 12 |
KHASH_MAP_INIT_STR(vdict, bcf_idinfo_t) |
| 13 |
typedef khash_t(vdict) vdict_t; |
| 14 |
|
| 15 |
KHASH_DECLARE(s2i, kh_cstr_t, int64_t) |
| 16 |
typedef khash_t(s2i) s2i_t; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
bam1_t * pysam_bam_update(bam1_t * b, |
| 38 |
const size_t nbytes_old, |
| 39 |
const size_t nbytes_new, |
| 40 |
uint8_t * pos); |
| 41 |
|
| 42 |
|
| 43 |
unsigned char pysam_translate_sequence(const unsigned char s); |
| 44 |
|
| 45 |
|
| 46 |
int aux_type2size(uint8_t type); |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
static inline int pysam_bam_is_rev(bam1_t * b) { |
| 52 |
return bam_is_rev(b);}; |
| 53 |
|
| 54 |
static inline int pysam_bam_is_mrev(bam1_t * b) { |
| 55 |
return bam_is_mrev(b);} |
| 56 |
|
| 57 |
static inline char * pysam_bam_get_qname(bam1_t * b) { |
| 58 |
return bam_get_qname(b);} |
| 59 |
|
| 60 |
static inline uint32_t * pysam_bam_get_cigar(bam1_t * b) { |
| 61 |
return bam_get_cigar(b);} |
| 62 |
|
| 63 |
static inline uint8_t * pysam_bam_get_seq(bam1_t * b) { |
| 64 |
return bam_get_seq(b);} |
| 65 |
|
| 66 |
static inline uint8_t * pysam_bam_get_qual(bam1_t * b) { |
| 67 |
return bam_get_qual(b);} |
| 68 |
|
| 69 |
static inline uint8_t * pysam_bam_get_aux(bam1_t * b) { |
| 70 |
return bam_get_aux(b);} |
| 71 |
|
| 72 |
static inline int pysam_bam_get_l_aux(bam1_t * b) { |
| 73 |
return bam_get_l_aux(b); } |
| 74 |
|
| 75 |
static inline char pysam_bam_seqi(uint8_t * s, int i) { |
| 76 |
return bam_seqi(s,i);} |
| 77 |
|
| 78 |
static inline uint8_t pysam_get_qual(bam1_t * b) { |
| 79 |
return b->core.qual;} |
| 80 |
|
| 81 |
static inline uint32_t pysam_get_n_cigar(bam1_t * b) { |
| 82 |
return b->core.n_cigar;} |
| 83 |
|
| 84 |
static inline void pysam_set_qual(bam1_t * b, uint8_t v) { |
| 85 |
b->core.qual=v;} |
| 86 |
|
| 87 |
static inline void pysam_set_n_cigar(bam1_t * b, uint32_t v) { |
| 88 |
b->core.n_cigar=v;} |
| 89 |
|
| 90 |
static inline void pysam_update_flag(bam1_t * b, uint16_t v, uint16_t flag) { |
| 91 |
if (v) |
| 92 |
b->core.flag |= flag; |
| 93 |
else |
| 94 |
b->core.flag &= ~flag; |
| 95 |
} |
| 96 |
|
| 97 |
#endif |