@field n_targets number of reference sequences
@field target_name names of the reference sequences
@field target_len lengths of the referene sequences
+ @field dict header dictionary
@field hash hash table for fast name lookup
@field rg2lib hash table for @RG-ID -> LB lookup
@field l_text length of the plain text in the header
int32_t n_targets;
char **target_name;
uint32_t *target_len;
- void *hash, *rg2lib;
+ void *dict, *hash, *rg2lib;
int l_text;
char *text;
} bam_header_t;
/*! @abstract optical or PCR duplicate */
#define BAM_FDUP 1024
+#define BAM_OFDEC 0
+#define BAM_OFHEX 1
+#define BAM_OFSTR 2
+
/*! @abstract defautl mask for pileup */
#define BAM_DEF_MASK (BAM_FUNMAP | BAM_FSECONDARY | BAM_FQCFAIL | BAM_FDUP)
@abstract Free the memory allocated for an alignment.
@param b pointer to an alignment
*/
-#define bam_destroy1(b) do { \
- free((b)->data); free(b); \
+#define bam_destroy1(b) do { \
+ if (b) { free((b)->data); free(b); } \
} while (0)
/*!
*/
char *bam_format1(const bam_header_t *header, const bam1_t *b);
+ char *bam_format1_core(const bam_header_t *header, const bam1_t *b, int of);
+
+ const char *bam_get_library(bam_header_t *header, const bam1_t *b);
+
/*! @typedef
@abstract Structure for one alignment covering the pileup position.
@field b pointer to the alignment
char bam_aux2A(const uint8_t *s);
char *bam_aux2Z(const uint8_t *s);
+ int bam_aux_del(bam1_t *b, uint8_t *s);
void bam_aux_append(bam1_t *b, const char tag[2], char type, int len, uint8_t *data);
-
uint8_t *bam_aux_get_core(bam1_t *b, const char tag[2]); // an alias of bam_aux_get()
/*!
*/
int32_t bam_cigar2qlen(const bam1_core_t *c, const uint32_t *cigar);
- typedef struct {
- int32_t qbeg, qend;
- int32_t tbeg, tend;
- int32_t cbeg, cend;
- } bam_segreg_t;
-
- int bam_segreg(int32_t pos, const bam1_core_t *c, const uint32_t *cigar, bam_segreg_t *reg);
-
#ifdef __cplusplus
}
#endif