Ejemplo n.º 1
0
        public static IAnnotatedTranscript GetAnnotatedTranscript(ITranscript transcript, IVariant leftShiftedVariant,
                                                                  ISequence refSequence, IPredictionCache siftCache, IPredictionCache polyphenCache, AminoAcids aminoAcids)
        {
            var rightShiftedVariant = VariantRotator.Right(leftShiftedVariant, transcript, refSequence,
                                                           transcript.Gene.OnReverseStrand);

            var leftAnnotation = AnnotateTranscript(transcript, leftShiftedVariant, aminoAcids, refSequence);

            var rightAnnotation = ReferenceEquals(leftShiftedVariant, rightShiftedVariant)
                ? leftAnnotation
                : AnnotateTranscript(transcript, rightShiftedVariant, aminoAcids, refSequence);

            var consequences = GetConsequences(transcript, leftShiftedVariant, leftAnnotation.VariantEffect);

            var hgvsCoding = HgvsCodingNomenclature.GetHgvscAnnotation(transcript, rightShiftedVariant, refSequence,
                                                                       rightAnnotation.Position.RegionStartIndex, rightAnnotation.Position.RegionEndIndex);

            var hgvsProtein = HgvsProteinNomenclature.GetHgvsProteinAnnotation(transcript,
                                                                               rightAnnotation.RefAminoAcids, rightAnnotation.AltAminoAcids, rightAnnotation.TranscriptAltAllele,
                                                                               rightAnnotation.Position, rightAnnotation.VariantEffect, rightShiftedVariant, refSequence, hgvsCoding,
                                                                               leftShiftedVariant.Chromosome.UcscName == "chrM");

            var predictionScores = GetPredictionScores(leftAnnotation.Position, leftAnnotation.RefAminoAcids,
                                                       leftAnnotation.AltAminoAcids, siftCache, polyphenCache, transcript.SiftIndex, transcript.PolyPhenIndex);

            return(new AnnotatedTranscript(transcript, leftAnnotation.RefAminoAcids, leftAnnotation.AltAminoAcids,
                                           leftAnnotation.RefCodons, leftAnnotation.AltCodons, leftAnnotation.Position, hgvsCoding, hgvsProtein,
                                           predictionScores.Sift, predictionScores.PolyPhen, consequences, false));
        }
Ejemplo n.º 2
0
        public void GetHgvscAnnotation_deletion_of_reverse_gene()
        {
            var variant       = new SimpleVariant(Chromosome, 135802, 137619, "ATCGTGGGTTGT", "", VariantType.deletion);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_reverseTranscript, variant, null, 0, 1);

            Assert.Equal("ENST00000423372.3:c.*909+2_*910delACAACCCACGAT", observedHgvsc);
        }
Ejemplo n.º 3
0
        public void GetHgvscAnnotation_substitution_in_intron_of_reverse_gene()
        {
            var variant       = new SimpleVariant(Chromosome, 136000, 136000, "A", "G", VariantType.SNV);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_reverseTranscript, variant, null, 1, 1);

            Assert.Equal("ENST00000423372.3:c.*910-198T>C", observedHgvsc);
        }
Ejemplo n.º 4
0
        public void GetHgvscAnnotation_substitution_after_stopCodon_of_reverse_gene()
        {
            var variant       = new SimpleVariant(Chromosome, 138529, 138529, "A", "G", VariantType.SNV);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_reverseTranscript, variant, null, 2, -1);

            Assert.Equal("ENST00000423372.3:c.*1T>C", observedHgvsc);
        }
Ejemplo n.º 5
0
        public void GetHgvscAnnotation_Deletion_end_after_transcript()
        {
            var variant       = new SimpleVariant(Chromosome, 1260143, 1260148, "ATGTC", "", VariantType.deletion);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, -1, 0);

            Assert.Null(observedHgvsc);
        }
Ejemplo n.º 6
0
        public void GetHgvscAnnotation_Reference_no_hgvsc()
        {
            var variant       = new SimpleVariant(Chromosome, 1260138, 1260138, "A", "A", VariantType.reference);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, -1, -1);

            Assert.Null(observedHgvsc);
        }
Ejemplo n.º 7
0
        public void GetHgvscAnnotation_substitution_in_intron_before_TSS()
        {
            var variant       = new SimpleVariant(Chromosome, 1262210, 1262210, "C", "G", VariantType.SNV);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, 1, 1);

            Assert.Equal("ENST00000343938.4:c.-75-6C>G", observedHgvsc);
        }
Ejemplo n.º 8
0
        public void GetHgvscAnnotation_inversion_start_from_Exon_end_in_intron()
        {
            var variant       = new SimpleVariant(Chromosome, 1262410, 1262414, "ATGTC", "GACAT", VariantType.MNV);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, 2, 3);

            Assert.Equal("ENST00000343938.4:c.120_122+2invATGTC", observedHgvsc);
        }
Ejemplo n.º 9
0
        public void GetHgvscAnnotation_substitution_in_3UTR()
        {
            var variant       = new SimpleVariant(Chromosome, 1260247, 1260247, "A", "G", VariantType.SNV);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, 0, 0);

            Assert.Equal("ENST00000343938.4:c.-311A>G", observedHgvsc);
        }
        public void GetHgvscAnnotation_Delin_start_from_Exon_end_in_intron()
        {
            var variant       = new SimpleVariant(ChromosomeUtilities.Chr1, 1262410, 1262414, "ATGTC", "TG", VariantType.indel);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, 2, 3);

            Assert.Equal("ENST00000343938.4:c.120_122+2delATGTCinsTG", observedHgvsc);
        }
        public void GetHgvscAnnotation_Deletion_start_before_transcript()
        {
            var variant       = new SimpleVariant(ChromosomeUtilities.Chr1, 1260144, 1260148, "ATGTC", "", VariantType.deletion);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, null, -1, 0);

            Assert.Null(observedHgvsc);
        }
Ejemplo n.º 12
0
        public void GetHgvscAnnotation_duplication_at_last_position()
        {
            var sequence = new Mock <ISequence>();

            sequence.Setup(x => x.Substring(70361156 - 4, 4)).Returns("ACAC");

            var variant       = new SimpleVariant(chrX, 70361157, 70361156, "", "ACAC", VariantType.insertion);//right shifted variant
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(GetForwardTranscriptWithoutUtr(), variant, sequence.Object, 0, 0);

            Assert.Equal("ENST00000579622.1:n.119_122dupACAC", observedHgvsc);
        }
Ejemplo n.º 13
0
        public void GetHgvscAnnotation_duplication_in_coding_region()
        {
            var sequence = new Mock <ISequence>();

            sequence.Setup(x => x.Substring(1262626, 2)).Returns("TA");

            var variant       = new SimpleVariant(Chromosome, 1262629, 1262628, "", "TA", VariantType.insertion);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, sequence.Object, 4, 4);

            Assert.Equal("ENST00000343938.4:c.129_130dupTA", observedHgvsc);
        }
Ejemplo n.º 14
0
        public void GetHgvscAnnotation_insertion_after_coding_region()
        {
            var sequence = new Mock <ISequence>();

            sequence.Setup(x => x.Substring(1262627, 1)).Returns("A");

            var variant       = new SimpleVariant(Chromosome, 1263159, 1263158, "", "G", VariantType.insertion);
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(_forwardTranscript, variant, sequence.Object, 4, 4);

            Assert.Equal("ENST00000343938.4:c.*15_*16insG", observedHgvsc);
        }
        public void GetHgvscAnnotation_insertion_at_last_position()
        {
            var sequence = new Mock <ISequence>();

            sequence.Setup(x => x.Substring(70361157 - 12, 12)).Returns("TATATATATATA");

            var variant       = new SimpleVariant(ChromosomeUtilities.ChrX, 70361157, 70361156, "", "ACACCAGCAGCA", VariantType.insertion);//right shifted variant
            var observedHgvsc = HgvsCodingNomenclature.GetHgvscAnnotation(GetForwardTranscriptWithoutUtr(), variant, sequence.Object, 0, 0);

            Assert.Equal("ENST00000579622.1:n.122_123insACACCAGCAGCA", observedHgvsc);
        }
Ejemplo n.º 16
0
        public void GetHgvscAnnotation_in_intron_gap_substitution(int variantStart, int variantEnd, string reference, string alt,
                                                                  string transcriptRef, VariantType variantType, string expectedHgvsc)
        {
            var(startIndex, _) =
                MappedPositionUtilities.FindRegion(_gapTranscript.TranscriptRegions, variantStart);
            var(endIndex, _) =
                MappedPositionUtilities.FindRegion(_gapTranscript.TranscriptRegions, variantEnd);
            var variant       = new SimpleVariant(ChromosomeUtilities.Chr10, variantStart, variantEnd, reference, alt, variantType);
            var observedHgvsc =
                HgvsCodingNomenclature.GetHgvscAnnotation(_gapTranscript, variant, null, startIndex, endIndex, transcriptRef, null);

            Assert.Equal(expectedHgvsc, observedHgvsc);
        }