private static RecalibrationResult GetModelFromType(CalledAllele allele, RecalibrationResults results) { var variantType = VariantReader.GetVariantType(allele); RecalibrationResult resultForVariant; if (variantType == VariantType.NoVariant || variantType == VariantType.Snv) { resultForVariant = results.SnvResults; } else if (variantType == VariantType.Indel) { resultForVariant = results.IndelResults; } else { throw new ArgumentException("Variant type unrecognized."); } return(resultForVariant); }
private static CalledAllele UpdateGenotype(CalledAllele allele, SimplifiedDiploidGenotype category) { if (category == SimplifiedDiploidGenotype.HomozygousRef) { allele.Genotype = Genotype.HomozygousRef; } else if (category == SimplifiedDiploidGenotype.HeterozygousAltRef) { if (allele.IsRefType) { allele.Genotype = Genotype.HomozygousRef; } else if (VariantReader.GetVariantType(allele) == VariantType.Snv) { allele.Genotype = Genotype.HeterozygousAltRef; } else if (VariantReader.GetVariantType(allele) == VariantType.Indel) { allele.Genotype = Genotype.HeterozygousAltRef; } } else if (category == SimplifiedDiploidGenotype.HomozygousAlt) { if (allele.IsRefType) { allele.Genotype = Genotype.HomozygousRef; } else if (VariantReader.GetVariantType(allele) == VariantType.Snv) { allele.Genotype = Genotype.HomozygousAlt; } else if (VariantReader.GetVariantType(allele) == VariantType.Indel) { allele.Genotype = Genotype.HomozygousAlt; } } return(allele); }