]> git.donarmstrong.com Git - samtools.git/blob - bam_mcns.h
posterior expectation FINALLY working. I am so tired...
[samtools.git] / bam_mcns.h
1 #ifndef BAM_MCNS_H
2 #define BAM_MCNS_H
3
4 #include "bam.h"
5
6 struct __mc_aux_t;
7 typedef struct __mc_aux_t mc_aux_t;
8
9 typedef struct {
10         // O(n)
11         int ref, alt;
12         double f_em, f_naive, f_nielsen;
13         // O(n^2)
14         double PD, p_ref, f_exp;
15         // O(n^3)
16         double f_map, p_map; // map=maximum a posterior
17 } mc_rst_t;
18
19 #define MC_PTYPE_FULL  1
20 #define MC_PTYPE_COND2 2
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26         mc_aux_t *mc_init(int n);
27         void mc_init_prior(mc_aux_t *ma, int type, double theta);
28         void mc_destroy(mc_aux_t *ma);
29         int mc_cal(int ref, int *n, const bam_pileup1_t **plp, mc_aux_t *ma, mc_rst_t *rst, int level);
30         int mc_call_gt(const mc_aux_t *ma, double f0, int k);
31
32 #ifdef __cplusplus
33 }
34 #endif
35
36 #endif