Imported Upstream version 0.1.10
[samtools.git] / bam2bcf.h
1 #ifndef BAM2BCF_H
2 #define BAM2BCF_H
3
4 #include <stdint.h>
5 #include "errmod.h"
6 #include "bcftools/bcf.h"
7
8 #define B2B_INDEL_NULL 10000
9
10 typedef struct __bcf_callaux_t {
11         int capQ, min_baseQ;
12         int openQ, extQ, tandemQ;
13         // for internal uses
14         int max_bases;
15         int indel_types[4];
16         int maxins, indelreg;
17         char *inscns;
18         uint16_t *bases;
19         errmod_t *e;
20         void *rghash;
21 } bcf_callaux_t;
22
23 typedef struct {
24         int depth, ori_depth, qsum[4];
25         int anno[16];
26         float p[25];
27 } bcf_callret1_t;
28
29 typedef struct {
30         int a[5]; // alleles: ref, alt, alt2, alt3
31         int n, n_alleles, shift, ori_ref, unseen;
32         int anno[16], depth, ori_depth;
33         uint8_t *PL;
34 } bcf_call_t;
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40         bcf_callaux_t *bcf_call_init(double theta, int min_baseQ);
41         void bcf_call_destroy(bcf_callaux_t *bca);
42         int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t *bca, bcf_callret1_t *r);
43         int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, bcf_call_t *call);
44         int bcf_call2bcf(int tid, int pos, bcf_call_t *bc, bcf1_t *b, bcf_callret1_t *bcr, int is_SP,
45                                          const bcf_callaux_t *bca, const char *ref);
46         int bcf_call_gap_prep(int n, int *n_plp, bam_pileup1_t **plp, int pos, bcf_callaux_t *bca, const char *ref,
47                                                   const void *rghash);
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif