Exemplo n.º 1
0
        public void GetProteinPosition_Forward_Insertion()
        {
            int proteinStart = MappedPositionUtilities.GetProteinPosition(225);
            int proteinEnd   = MappedPositionUtilities.GetProteinPosition(224);

            Assert.Equal(75, proteinStart);
            Assert.Equal(75, proteinEnd);
        }
Exemplo n.º 2
0
        public void GetProteinPosition_Reverse_Deletion()
        {
            int proteinStart = MappedPositionUtilities.GetProteinPosition(-1);
            int proteinEnd   = MappedPositionUtilities.GetProteinPosition(-1);

            Assert.Equal(-1, proteinStart);
            Assert.Equal(-1, proteinEnd);
        }
        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));
        }