Example #1
0
 private static void AddMultiIndelMetrics(IndelEvidence indelMetrics, List <PreIndel> indels, int totalNm)
 {
     indelMetrics.LeftAnchor  += indels[0].LeftAnchor;
     indelMetrics.RightAnchor += indels[1].RightAnchor;
     indelMetrics.Mess        += Math.Max(0, totalNm - indels.Sum(x => x.Length));
     indelMetrics.Quality     += indels.Min(x => x.AverageQualityRounded);
 }
Example #2
0
 private static void AddIndelMetrics(IndelEvidence indelMetrics, PreIndel indel, int totalNm)
 {
     indelMetrics.Position     = indel.ReferencePosition;
     indelMetrics.LeftAnchor  += indel.LeftAnchor;
     indelMetrics.RightAnchor += indel.RightAnchor;
     indelMetrics.Mess        += Math.Max(0, totalNm - indel.Length);
     indelMetrics.Quality     += indel.AverageQualityRounded;
 }
Example #3
0
        private static IndelEvidence IndelMetrics(Dictionary <string, IndelEvidence> lookup, string indelKey)
        {
            if (!lookup.TryGetValue(indelKey, out var indelMetrics))
            {
                //indelMetrics = new int[11];
                indelMetrics = new IndelEvidence();
                lookup.Add(indelKey, indelMetrics);
            }

            return(indelMetrics);
        }
Example #4
0
        public int Position; // TODO this is the wrong place for this but i need it for now

        public void AddIndelEvidence(IndelEvidence other)
        {
            Stitched         += other.Stitched;
            Forward          += other.Forward;
            Reverse          += other.Reverse;
            Observations     += other.Observations;
            Quality          += other.Quality;
            Mess             += other.Mess;
            LeftAnchor       += other.LeftAnchor;
            RightAnchor      += other.RightAnchor;
            IsRepeat         += other.IsRepeat;
            ReputableSupport += other.ReputableSupport;
            IsSplit          += other.IsSplit;
            Position          = other.Position;
        }
Example #5
0
        private static void AddReadLevelIndelMetrics(BamAlignment bamAlignment, bool isReputable, bool stitched, IndelEvidence indelMetrics,
                                                     bool isRepeat)
        {
            indelMetrics.Observations++;
            if (stitched)
            {
                indelMetrics.Stitched++;
            }
            else
            {
                if (bamAlignment.IsReverseStrand())
                {
                    indelMetrics.Reverse++;
                }
                else
                {
                    indelMetrics.Forward++;
                }
            }

            if (isReputable)
            {
                indelMetrics.ReputableSupport++;
            }

            if (isRepeat)
            {
                indelMetrics.IsRepeat++;
            }

            if (!bamAlignment.IsMateMapped() || bamAlignment.MateRefID != bamAlignment.RefID)
            {
                indelMetrics.IsSplit++;
            }
        }
Example #6
0
        private static void UpdateIndelMetrics(BamAlignment bamAlignment, bool isReputable, bool stitched, IndelEvidence indelMetrics,
                                               PreIndel indel, int totalNm)
        {
            // TODO - are read-level repeats that informative? Because this is kind of a perf burden
            // (^ Removed for now for that reason)
            bool isRepeat = false;

            //var isRepeat = StitchingLogic.OverlapEvaluator.IsRepeat(bamAlignment.Bases.Substring(0, (int)indel.LeftAnchor), 2, out repeatUnit) || StitchingLogic.OverlapEvaluator.IsRepeat(bamAlignment.Bases.Substring(0, (int)indel.RightAnchor), 2, out repeatUnit);

            AddReadLevelIndelMetrics(bamAlignment, isReputable, stitched, indelMetrics, isRepeat);
            AddIndelMetrics(indelMetrics, indel, totalNm);
        }