Пример #1
0
        public void GetCdsPosition_Reverse_NoCodingRegion_Deletion()
        {
            const byte startExonPhase = 0;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(null, -1, 123, startExonPhase, false);

            Assert.Equal(-1, cdsStart);
            Assert.Equal(-1, cdsEnd);
        }
Пример #2
0
        public void GetCdsPosition_Forward_Insertion_WithStartExonPhase()
        {
            var        codingRegion   = new CodingRegion(6413107, 6415837, 1, 953, 953);
            const byte startExonPhase = 1;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, 29, 28, startExonPhase, true);

            Assert.Equal(30, cdsStart);
            Assert.Equal(29, cdsEnd);
        }
Пример #3
0
        public void GetCdsPosition_Snv_AfterOutframeRnaEditInsertion()
        {
            // NM_033517.1
            var        codingRegion   = new CodingRegion(51113070, 51169740, 1, 5196, 5157);
            const byte startExonPhase = 0;

            (int cdsStart, _) = MappedPositionUtilities.GetCdsPositions(codingRegion, 1343, 1343, startExonPhase, false);

            Assert.Equal(1343, cdsStart);
        }
Пример #4
0
        public void GetCdsPosition_Snv_AfterInframeRnaEditInsertion()
        {
            // NM_000682.6
            var        codingRegion   = new CodingRegion(96780545, 96781888, 97, 1449, 1344);
            const byte startExonPhase = 0;

            (int cdsStart, _) = MappedPositionUtilities.GetCdsPositions(codingRegion, 1010, 1010, startExonPhase, false);

            Assert.Equal(914, cdsStart);
        }
Пример #5
0
        public void GetCdsPosition_Snv_AfterOutFrameRnaEditDeletion()
        {
            // NM_001317107.1
            var        codingRegion   = new CodingRegion(22138201, 22139150, 83, 1030, 948);
            const byte startExonPhase = 0;

            (int cdsStart, _) = MappedPositionUtilities.GetCdsPositions(codingRegion, 681, 681, startExonPhase, false);

            Assert.Equal(599, cdsStart);
        }
Пример #6
0
        public void GetCdsPosition_Forward_Insertion()
        {
            var        codingRegion   = new CodingRegion(78001559, 78024355, 262, 495, 234);
            const byte startExonPhase = 0;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, 486, 485, startExonPhase, true);

            Assert.Equal(225, cdsStart);
            Assert.Equal(224, cdsEnd);
        }
Пример #7
0
        public void GetCdsPosition_DoNotSilenceOutput_Reverse()
        {
            // variant: [179315139, 179315692]
            var        codingRegion   = new CodingRegion(179308070, 179315170, 617, 942, 326);
            const byte startExonPhase = 0;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, 95, 648, startExonPhase, false);

            Assert.Equal(-1, cdsStart);
            Assert.Equal(32, cdsEnd);
        }
Пример #8
0
        public void GetCdsPosition_SilenceOutput_InsertionBeforeCodingRegion_Reverse()
        {
            // variant: [37480320, 37480319] insertion after coding region
            var        codingRegion   = new CodingRegion(37480320, 37543667, 556, 3228, 2673);
            const byte startExonPhase = 0;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, 3229, 3228, startExonPhase, true);

            Assert.Equal(-1, cdsStart);
            Assert.Equal(-1, cdsEnd);
        }
Пример #9
0
        public void GetCdsPosition_SilenceOutput_InsertionAfterCodingRegion_Reverse()
        {
            // variant: [103629803, 103629804] insertion after coding region
            var        codingRegion   = new CodingRegion(103113259, 103629803, 161, 10543, 10383);
            const byte startExonPhase = 0;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, 161, 160, startExonPhase, true);

            Assert.Equal(-1, cdsStart);
            Assert.Equal(-1, cdsEnd);
        }
Пример #10
0
        public void GetCdsPosition_SilenceOutput_InsertionAfterCodingRegion_Forward()
        {
            // variant: [6647337, 6647336] insertion after coding region
            var        codingRegion   = new CodingRegion(6643999, 6647336, 667, 1674, 1008);
            const byte startExonPhase = 0;

            var(cdsStart, cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, 1675, 1674, startExonPhase, true);

            Assert.Equal(-1, cdsStart);
            Assert.Equal(-1, cdsEnd);
        }
Пример #11
0
        private static IMappedPosition GetMappedPosition(ITranscriptRegion[] regions, ITranscriptRegion startRegion,
                                                         int startIndex, ITranscriptRegion endRegion, int endIndex, IInterval variant, bool onReverseStrand,
                                                         ICodingRegion codingRegion, byte startExonPhase, bool isInsertion)
        {
            (int cdnaStart, int cdnaEnd) = MappedPositionUtilities.GetCdnaPositions(startRegion, endRegion, variant, onReverseStrand, isInsertion);
            if (onReverseStrand)
            {
                Swap.Int(ref cdnaStart, ref cdnaEnd);
            }

            (int cdsStart, int cdsEnd) = MappedPositionUtilities.GetCdsPositions(codingRegion, cdnaStart, cdnaEnd,
                                                                                 startExonPhase, isInsertion);

            int proteinStart = MappedPositionUtilities.GetProteinPosition(cdsStart);
            int proteinEnd   = MappedPositionUtilities.GetProteinPosition(cdsEnd);

            (int exonStart, int exonEnd, int intronStart, int intronEnd) = regions.GetExonsAndIntrons(startIndex, endIndex);

            return(new MappedPosition(cdnaStart, cdnaEnd, cdsStart, cdsEnd, proteinStart, proteinEnd, exonStart,
                                      exonEnd, intronStart, intronEnd, startIndex, endIndex));
        }