Exemplo n.º 1
0
        private void AddStatusInfo(BamAlignment origBamAlignment, List <PreIndel> selectedIndels, List <PreIndel> existingIndels,
                                   RealignmentResult realignResult, BamAlignment bamAlignment, bool hasExistingUnsanctionedIndels,
                                   AlignmentSummary originalAlignmentSummary)
        {
            _statusCounter.AddStatusCount("INDEL STATUS\tAccepted\t" + realignResult.Indels);

            _statusCounter.AddStatusCount($"Successfully realigned (ps: {selectedIndels != null})");
            _statusCounter.AppendStatusStringTag("RX",
                                                 $"Successfully realigned after {realignResult.Attempts} attempts, indel is {string.Join("|", realignResult.AcceptedIndels)}",
                                                 bamAlignment);

            if (existingIndels != null && existingIndels.Any())
            {
                _statusCounter.AppendStatusStringTag("RX",
                                                     $"Orig indels:{string.Join("|", existingIndels)}__New indels:{realignResult.Indels}",
                                                     bamAlignment);
                _statusCounter.AddStatusCount(
                    $"Replaced existing indels (nonsanctioned: {hasExistingUnsanctionedIndels})");
            }

            bamAlignment.ReplaceOrAddStringTag("OC", $"{origBamAlignment.CigarData}");
            bamAlignment.ReplaceOrAddStringTag("OS",
                                               $"{originalAlignmentSummary.NumMatches}M-{originalAlignmentSummary.NumNonNSoftclips}S-{originalAlignmentSummary.NumMismatches}X-{originalAlignmentSummary.NumMismatchesIncludeSoftclip}x-{originalAlignmentSummary.NumInsertedBases}i-{originalAlignmentSummary.NumIndels}Z-{originalAlignmentSummary.SumOfMismatchingQualities}Q");
            bamAlignment.ReplaceOrAddStringTag("RS",
                                               $"{realignResult.NumMatches}M-{realignResult.NumNonNSoftclips}S-{realignResult.NumMismatches}X-{realignResult.NumMismatchesIncludeSoftclip}x-{realignResult.NumInsertedBases}i-{realignResult.NumIndels}Z-{realignResult.SumOfMismatchingQualities}Q");
        }
 private static void AddMdTagCountsTags(BamAlignment bamAlignment, PairResult pairResult)
 {
     if (pairResult.md1.IsSet)
     {
         bamAlignment.ReplaceOrAddStringTag("XM",
                                            $"A: {pairResult.md1.A},{pairResult.md2.A}; T: {pairResult.md1.T},{pairResult.md2.T}; C: {pairResult.md1.C},{pairResult.md2.C}; G: {pairResult.md1.G},{pairResult.md2.G}; subA: {pairResult.md1.SubA},{pairResult.md2.SubA}; subT: {pairResult.md1.SubT},{pairResult.md2.SubT}; subC: {pairResult.md1.SubC},{pairResult.md2.SubC}; subG: {pairResult.md1.SubG},{pairResult.md2.SubG}; subN: {pairResult.md1.SubN},{pairResult.md2.SubN}; maxRun: {pairResult.md1.RunLength},{pairResult.md2.RunLength}; numRuns: {pairResult.md1.NumInRuns},{pairResult.md2.NumInRuns}");
     }
     else
     {
         bamAlignment.ReplaceOrAddStringTag("XM", $"Not set");
     }
 }
Exemplo n.º 3
0
        public void AddCombinedStatusStringTags()
        {
            var counter = new ReadStatusCounter();
            var handler = new DebugSummaryStatusHandler(counter);
            var pair    = TestHelpers.GetPair("10M", "10M");

            pair.Read1.ReplaceOrAddStringTag("HI", "read1_hi");
            pair.Read2.ReplaceOrAddStringTag("HI", "read2_hi");

            var outAlignment = new BamAlignment(pair.Read1);

            outAlignment.ReplaceOrAddStringTag("HI", "nothing");

            // Should  not update
            handler.AddCombinedStatusStringTags("HI", pair.Read1, pair.Read2, outAlignment);
            Assert.Equal("nothing", outAlignment.GetStringTag("HI"));
        }
Exemplo n.º 4
0
 public void AddCombinedStatusStringTags(string tagName, BamAlignment alignment1, BamAlignment alignment2, BamAlignment outAlignment)
 {
     outAlignment.ReplaceOrAddStringTag(tagName,
                                        alignment1.GetStringTag(tagName) + "," + alignment2.GetStringTag(tagName));
 }
Exemplo n.º 5
0
 public void UpdateStatusStringTag(string tagName, string tagValue, BamAlignment alignment)
 {
     alignment.ReplaceOrAddStringTag(tagName, tagValue);
 }
Exemplo n.º 6
0
 public void AppendStatusStringTag(string tagName, string tagValue, BamAlignment alignment)
 {
     // TODO if there is not already a tag, don't add the comma, it's confusing
     alignment.ReplaceOrAddStringTag(tagName, alignment.GetStringTag(tagName) + "," + tagValue);
 }