// -*- mode: c++; indent-tabs-mode: nil; -*- // // Copyright 2009 Illumina, Inc. // // This software is covered by the "Illumina Genome Analyzer Software // License Agreement" and the "Illumina Source Code License Agreement", // and certain third party copyright/licenses, and any user of this // source file is bound by the terms therein (see accompanying files // Illumina_Genome_Analyzer_Software_License_Agreement.pdf and // Illumina_Source_Code_License_Agreement.pdf and third party // copyright/license notices). // // /// \file /// \author Chris Saunders /// #include "position_loghood_minfunc.hh" #include "blt_common/position_strand_distro_anomaly_lrt.hh" #include "blt_util/log.hh" #include "blt_util/stat_util.hh" #define CODEMIN_USE_BOOST #include "minimize_conj_direction.h" #include #include #include #include // allele map[N_BASE] is true for each base listed in allele_freq[<=N_BASE]: // static void get_max_lhood_allele_freq(const snp_pos_info& pi, double* allele_freq, bool* is_allele_used, double& loghood){ // minimization constants: static const double line_tol(1e-7); static const double start_ratio(0.05); static const double min_start_dist(1e-6); static const double end_tol(1e-7); static const unsigned max_iter(200); static const unsigned N_BASE2(N_BASE*N_BASE); double conj_dir[N_BASE2]; unsigned n_allele(0); for(unsigned i(0);i(n_allele)); double joint_allele_freq[N_BASE]; for(unsigned i(0);i