]> git.donarmstrong.com Git - samtools.git/blob - bam_maqcns.h
Create trunk copy
[samtools.git] / bam_maqcns.h
1 #ifndef BAM_MAQCNS_H
2 #define BAM_MAQCNS_H
3
4 #include "glf.h"
5
6 struct __bmc_aux_t;
7
8 typedef struct {
9         float het_rate, theta;
10         int n_hap;
11
12         float eta, q_r;
13         double *fk, *coef;
14         double *lhet;
15         struct __bmc_aux_t *aux;
16 } bam_maqcns_t;
17
18 typedef struct {
19         int mm_penalty, indel_err, ambi_thres;
20 } bam_maqindel_opt_t;
21
22 typedef struct {
23         int indel1, indel2;
24         int cnt1, cnt2, cnt_ambi, cnt_anti;
25         char *s1, *s2;
26 } bam_maqindel_ret_t;
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32         bam_maqcns_t *bam_maqcns_init();
33         void bam_maqcns_prepare(bam_maqcns_t *bm);
34         void bam_maqcns_destroy(bam_maqcns_t *bm);
35         glf1_t *bam_maqcns_glfgen(int n, const bam_pileup1_t *pl, uint8_t ref_base, bam_maqcns_t *bm);
36         uint32_t bam_maqcns_call(int n, const bam_pileup1_t *pl, bam_maqcns_t *bm);
37         // return: cns<<28 | cns2<<24 | mapQ<<16 | cnsQ<<8 | cnsQ2
38         uint32_t glf2cns(const glf1_t *g, int q_r);
39
40         bam_maqindel_opt_t *bam_maqindel_opt_init();
41         bam_maqindel_ret_t *bam_maqindel(int n, int pos, const bam_maqindel_opt_t *mi, const bam_pileup1_t *pl, const char *ref);
42         void bam_maqindel_ret_destroy(bam_maqindel_ret_t*);
43
44 #ifdef __cplusplus
45 }
46 #endif
47
48 #endif