private static void UpdateWittyerVariant(IWittyerSimpleVariant variant, EvaluationMode emode, bool isTruth) { var sample = variant.Sample; var match = emode.Equals(EvaluationMode.Default); variant.OverlapInfo.Sort(); switch (sample) { case WittyerSampleInternal simple: UpdateWittyerVariantHelper(simple, variant, match, isTruth); break; case WittyerCopyNumberSample cnsample: UpdateWittyerVariantHelper(cnsample.BaseSample, variant, match, isTruth); break; case WittyerGenotypedSample gtSample: UpdateWittyerVariantHelper(gtSample.BaseSample, variant, match, isTruth); break; case WittyerGenotypedCopyNumberSample gtCnSample: UpdateWittyerVariantHelper(gtCnSample.BaseSample.BaseSample, variant, match, isTruth); break; default: throw new InvalidDataException( "Not sure how we get here, you must have created some non-existed wittyer sample type, check with developer!"); } }
public static BorderDistance CreateFromVariant([NotNull] IWittyerSimpleVariant first, [NotNull] IWittyerSimpleVariant second) { var lbl = GetDistance(first.CiPosInterval.Start, second.CiPosInterval.Start); var lbr = GetDistance(first.CiPosInterval.Stop, second.CiPosInterval.Stop); var rbl = GetDistance(first.CiEndInterval.Start, second.CiEndInterval.Start); var rbr = GetDistance(first.CiEndInterval.Stop, second.CiEndInterval.Stop); return(Create(lbl, lbr, rbl, rbr)); }
private static void UpdateWittyerVariantHelper(WittyerSampleInternal sample, IWittyerSimpleVariant variant, bool isGenotypeMatch, bool isTruth) { var correctMatch = new [] { MatchEnum.AlleleAndGenotypeMatch }.ToList(); if (!isGenotypeMatch) { correctMatch.Add(MatchEnum.AlleleMatch); } sample.What = variant.OverlapInfo.Select(x => x.What).ToImmutableList(); if (variant.OverlapInfo.Count == 0) { sample.What = ImmutableList.Create(MatchEnum.Unmatched); } sample.Why = variant.OverlapInfo.Select(x => x.Why).ToImmutableList(); sample.Wit = correctMatch.Any(sample.What.Contains) ? WitDecision.TruePositive : (isTruth ? WitDecision.FalseNegative : WitDecision.FalsePositive); }
internal Builder AddQuery(IWittyerSimpleVariant variant) { _query = _query.Add(variant); return this; }
internal void AddVariantToTrees(IWittyerSimpleVariant variant) { var tree = _trees.GetOrAdd(variant.VariantType, GenomeIntervalTree <IWittyerSimpleVariant> .Create()); tree.Add(variant); }