void RemoveFilteredAlleles(vcf::Variant &candidate_variant, vector<int> &filtered_alleles_index) {
    //now that all possible alt. alleles are evaluated decide on which allele is most likely and remove any that
    //that does'nt pass score threshold. Determine Genotype based on alleles that have evidence.
    candidate_variant.updateAlleleIndexes();
    string my_healing_glow = "HEALED";
    vector<string> originalAltAlleles = candidate_variant.alt;
    if (originalAltAlleles.size() > 1  &&
            originalAltAlleles.size() > filtered_alleles_index.size()  //remove only when number of alleles more than number of filtered alleles
            && !candidate_variant.isHotSpot) { //dont remove alleles if it is a HOT SPOT position as alleles might have been provided by the user.
        //remove filtered alleles with no support
        string altStr;
        int index;
        for (size_t i = 0; i <filtered_alleles_index.size(); i++) {

            index = filtered_alleles_index[i];
            //generate allele index before removing alleles
            altStr = originalAltAlleles[index];
            // specify what the alleles removed are
            //my_healing_glow = "HEALED" + altStr;

            //altStr = (*candidate_variant)->alt[index];
            // Note: need to update index for adjustments
            //AdjustFDPForRemovedAlleles(candidate_variant, index, sample_name);
            //cout << "Removed Fitered allele: index = " << index << " allele = " << altStr << endl;
            // @TODO: removeAlt wrecks the genotype as well
            // fix so we don't remove genotype components.

            candidate_variant.removeAlt(altStr);
            candidate_variant.updateAlleleIndexes();
            // if we are deleting alleles, indicate data potentially damaged at this location
            AddFilterReason(candidate_variant, my_healing_glow);
        }
    }
}
示例#2
0
void DoStepsForNoData(VariantCandidate& candidate_variant, const string& sample_name, int sample_index, bool use_molecular_tag, string my_reason){
    //cerr << "Nonfatal: No reads found for " << candidate_variant.variant.sequenceName << "\t" << my_ensemble.multiallele_window_start << endl;
    NullFilterReason(candidate_variant.variant, sample_name);
    if (my_reason.empty()){
    	my_reason = "NODATA";
    }
    AddFilterReason(candidate_variant.variant, my_reason, sample_name);
    SetFilteredStatus(candidate_variant.variant, true);
    candidate_variant.variant.samples[sample_name]["GT"] = {"./."};
}
void NullFilterReason(vcf::Variant &candidate_variant) {
    ClearVal(candidate_variant, "FR");
    string my_null_filter = ".";
    AddFilterReason(candidate_variant, my_null_filter);
}