]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_mcns.h
posterior expectation FINALLY working. I am so tired...
[samtools.git] / bam_mcns.h
index cff6e57d28047950be347e7d873d940638baa385..a86fc1ddbd62e575ffeca6d2d59917e0b7e2f9a6 100644 (file)
@@ -6,6 +6,16 @@
 struct __mc_aux_t;
 typedef struct __mc_aux_t mc_aux_t;
 
+typedef struct {
+       // O(n)
+       int ref, alt;
+       double f_em, f_naive, f_nielsen;
+       // O(n^2)
+       double PD, p_ref, f_exp;
+       // O(n^3)
+       double f_map, p_map; // map=maximum a posterior
+} mc_rst_t;
+
 #define MC_PTYPE_FULL  1
 #define MC_PTYPE_COND2 2
 
@@ -16,10 +26,7 @@ extern "C" {
        mc_aux_t *mc_init(int n);
        void mc_init_prior(mc_aux_t *ma, int type, double theta);
        void mc_destroy(mc_aux_t *ma);
-       double mc_freq0(int ref, int *n, const bam_pileup1_t **plp, mc_aux_t *ma, int *_ref, int *alt);
-       double mc_freq_iter(double f0, mc_aux_t *ma);
-       double mc_freq_post(mc_aux_t *ma);
-       double mc_ref_prob(mc_aux_t *ma);
+       int mc_cal(int ref, int *n, const bam_pileup1_t **plp, mc_aux_t *ma, mc_rst_t *rst, int level);
        int mc_call_gt(const mc_aux_t *ma, double f0, int k);
 
 #ifdef __cplusplus