]> git.donarmstrong.com Git - samtools.git/blob - bam2bcf.h
r579: after merging Peter's depad changes
[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 #define B2B_FMT_DP 0x1
11 #define B2B_FMT_SP 0x2
12 #define B2B_FMT_DV 0x4
13
14 typedef struct __bcf_callaux_t {
15         int capQ, min_baseQ;
16         int openQ, extQ, tandemQ; // for indels
17         int min_support; // for collecting indel candidates
18         double min_frac; // for collecting indel candidates
19         // for internal uses
20         int max_bases;
21         int indel_types[4];
22         int maxins, indelreg;
23         char *inscns;
24         uint16_t *bases;
25         errmod_t *e;
26         void *rghash;
27 } bcf_callaux_t;
28
29 typedef struct {
30         int depth, n_supp, ori_depth, qsum[4];
31         int anno[16];
32         float p[25];
33     int mvd[3]; // mean variant distance, number of variant reads, average read length
34 } bcf_callret1_t;
35
36 typedef struct {
37         int a[5]; // alleles: ref, alt, alt2, alt3
38         int n, n_alleles, shift, ori_ref, unseen;
39         int n_supp; // number of supporting non-reference reads
40         int anno[16], depth, ori_depth;
41         uint8_t *PL;
42     float vdb; // variant distance bias
43 } bcf_call_t;
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49         bcf_callaux_t *bcf_call_init(double theta, int min_baseQ);
50         void bcf_call_destroy(bcf_callaux_t *bca);
51         int bcf_call_glfgen(int _n, const bam_pileup1_t *pl, int ref_base, bcf_callaux_t *bca, bcf_callret1_t *r);
52         int bcf_call_combine(int n, const bcf_callret1_t *calls, int ref_base /*4-bit*/, bcf_call_t *call);
53         int bcf_call2bcf(int tid, int pos, bcf_call_t *bc, bcf1_t *b, bcf_callret1_t *bcr, int fmt_flag,
54                                          const bcf_callaux_t *bca, const char *ref);
55         int bcf_call_gap_prep(int n, int *n_plp, bam_pileup1_t **plp, int pos, bcf_callaux_t *bca, const char *ref,
56                                                   const void *rghash);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif