]> git.donarmstrong.com Git - samtools.git/blob - bam2bcf.h
* this revision is UNSTABLE
[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 BAM2BCF_INDELREG_THRES 13
9
10 typedef struct __bcf_callaux_t {
11         int max_bases, capQ, min_baseQ;
12         int openQ, extQ, tandemQ;
13         // for internal uses
14         uint16_t *bases;
15         errmod_t *e;
16 } bcf_callaux_t;
17
18 typedef struct {
19         int depth, indelreg;
20         float ins_len, del_len;
21         int qsum[4];
22         int anno[16];
23         float p[25];
24 } bcf_callret1_t;
25
26 typedef struct {
27         int a[5]; // alleles: ref, alt, alt2, alt3
28         int n, n_alleles, shift, ori_ref, unseen;
29         int indelreg;
30         float ins_len, del_len;
31         int depth, anno[16];
32         uint8_t *PL;
33 } bcf_call_t;
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39         bcf_callaux_t *bcf_call_init(double theta, int min_baseQ);
40         void bcf_call_destroy(bcf_callaux_t *bca);
41         int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base /*4-bit*/, bcf_callaux_t *bca, bcf_callret1_t *r);
42         int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, bcf_call_t *call);
43         int bcf_call_combine_gap(int n, const bcf_callret1_t *calls, 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         int bcf_call_glfgen_gap(int pos, int _n, const bam_pileup1_t *pl, bcf_callaux_t *bca, bcf_callret1_t *r);
46
47 #ifdef __cplusplus
48 }
49 #endif
50
51 #endif