// -*- 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 "blt_common/position_snp_call_pprob_monogt.hh" #include "blt_util/log.hh" #include "blt_util/seq_util.hh" #include #include #include #include #include /// /// void position_snp_call_pprob_monogt(const double theta, const snp_pos_info& pi, monoploid_genotype& mgt){ if(pi.ref_base=='N') return; const unsigned n_calls(pi.calls.size()); mgt.ref_gt=base_to_id(pi.ref_base); // check that a non-reference call meeting quality criteria even exists: bool is_test(false); for(unsigned i(0);i0.); } else { prior[gt]=theta*one_third; } } // mult by prior distro to get unnormalized pprob: for(unsigned gt(0);gt max){ max2 = max; max = mgt.pprob[gt]; mgt.max2_gt = mgt.max_gt; mgt.max_gt = gt; } else if(mgt.pprob[gt] > max2) { max2 = mgt.pprob[gt]; mgt.max2_gt = gt; } } // \todo debatable call criteria: mgt.is_snp=(mgt.max_gt != mgt.ref_gt); double sum(0.); for(unsigned gt(0);gt