]> git.donarmstrong.com Git - samtools.git/blob - glf.h
* samtools-0.1.2-10
[samtools.git] / glf.h
1 #ifndef GLF_H_
2 #define GLF_H_
3
4 typedef struct {
5         unsigned char ref_base:4, dummy:4; /** "XACMGRSVTWYHKDBN"[ref_base] gives the reference base */
6         unsigned char max_mapQ; /** maximum mapping quality */
7         unsigned char lk[10];   /** log likelihood ratio, capped at 255 */
8         unsigned min_lk:8, depth:24; /** minimum lk capped at 255, and the number of mapped reads */
9 } glf1_t;
10
11 #include <stdint.h>
12 #include "bgzf.h"
13 typedef BGZF *glfFile;
14
15 #define GLF_TYPE_NORMAL 0
16 #define GLF_TYPE_INDEL  1
17 #define GLF_TYPE_END   15
18
19 typedef struct {
20         unsigned char ref_base:4, type:4; /** "XACMGRSVTWYHKDBN"[ref_base] gives the reference base */
21         unsigned char max_mapQ; /** maximum mapping quality */
22         unsigned char lk[10];   /** log likelihood ratio, capped at 255 */
23         unsigned min_lk:8, depth:24; /** minimum lk capped at 255, and the number of mapped reads */
24         unsigned offset; /** the first base in a chromosome has offset zero. */
25 } glf3_t;
26
27 typedef struct {
28         int32_t l_text;
29         uint8_t *text;
30 } glf_header_t;
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36         glf_header_t *glf_header_init();
37         glf_header_t *glf_header_read(glfFile fp);
38         void glf_header_write(glfFile fp, const glf_header_t *h);
39         void glf_header_destroy(glf_header_t *h);
40         char *glf_ref_read(glfFile fp);
41         void glf_ref_write(glfFile fp, const char *str);
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif