private PairResult HandleIndelPairIfStitchUnallowed(ReadPair readPair, int numMismatchesInR1, int numMismatchesInR2, bool r1HasIndels, bool r2HasIndels)
        {
            IEnumerable <BamAlignment> bamAlignmentList = null;
            PairClassification         classification;

            var read1 = readPair.Read1;
            var read2 = readPair.Read2;

            if (read1.EndPosition >= read2.Position)
            {
                bamAlignmentList = OverlappingIndelHelpers.IndelsDisagreeWithStrongMate(
                    read1, read2, out bool disagree, 3, false);

                // TODO allow to stitch if they don't disagree, as they may not necessarily get the chance later (either user is not using realigner, or there are no indels strong enough to realign against)
                // Alternatively, if there are no indels to realign against, still stitch stuff if we can! (handle this in the realigner)
                // For the cases where we want to skip realignment, either tell it to stitch here (configurable), or have it still go through realigner but not realign?
                if (disagree)
                {
                    classification = PairClassification.Disagree;
                }
                else
                {
                    classification = PairClassification.UnstitchIndel;
                }
            }
            else
            {
                classification = PairClassification.UnstitchIndel;
            }

            return(HandlePairContainingIndels(readPair, r1HasIndels, r2HasIndels, numMismatchesInR1, numMismatchesInR2,
                                              r1HasIndels || r2HasIndels, classification, false, bamAlignmentList));
        }
Exemplo n.º 2
0
        private void CheckReadsDisagreeTest(ReadPair readPair, bool shouldDisagree, string expectedCigarR1,
                                            string expectedCigarR2, bool softclipWeakOne = false)
        {
            var result =
                OverlappingIndelHelpers.IndelsDisagreeWithStrongMate(readPair.Read1, readPair.Read2, out bool disagree, 1, softclipWeakOne: softclipWeakOne);

            Assert.Equal(shouldDisagree, disagree);
            Assert.Equal(expectedCigarR1, result[0].CigarData.ToString());
            Assert.Equal(expectedCigarR2, result[1].CigarData.ToString());
        }
Exemplo n.º 3
0
        private List <BamAlignment> ShouldRestitch(ReadPair pair)
        {
            var result = OverlappingIndelHelpers.IndelsDisagreeWithStrongMate(pair.Read1, pair.Read2, out bool disagree);

            if (disagree)
            {
                return(result);
            }

            return(null);
        }