New upstream release, introducing two files with new copyright statements.
[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; // for indels
13         int min_support; // for collecting indel candidates
14         double min_frac; // for collecting indel candidates
15         // for internal uses
16         int max_bases;
17         int indel_types[4];
18         int maxins, indelreg;
19         char *inscns;
20         uint16_t *bases;
21         errmod_t *e;
22         void *rghash;
23 } bcf_callaux_t;
24
25 typedef struct {
26         int depth, ori_depth, qsum[4];
27         int anno[16];
28         float p[25];
29 } bcf_callret1_t;
30
31 typedef struct {
32         int a[5]; // alleles: ref, alt, alt2, alt3
33         int n, n_alleles, shift, ori_ref, unseen;
34         int anno[16], depth, ori_depth;
35         uint8_t *PL;
36 } bcf_call_t;
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42         bcf_callaux_t *bcf_call_init(double theta, int min_baseQ);
43         void bcf_call_destroy(bcf_callaux_t *bca);
44         int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t *bca, bcf_callret1_t *r);
45         int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, bcf_call_t *call);
46         int bcf_call2bcf(int tid, int pos, bcf_call_t *bc, bcf1_t *b, bcf_callret1_t *bcr, int is_SP,
47                                          const bcf_callaux_t *bca, const char *ref);
48         int bcf_call_gap_prep(int n, int *n_plp, bam_pileup1_t **plp, int pos, bcf_callaux_t *bca, const char *ref,
49                                                   const void *rghash);
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif