Exemplo n.º 1
0
        public void TryTrimAminoAcidsAndUpdateProteinPositions_AsExpected(string reference, string alt, int start, int end, string newReference, string newAlt, int newStart, int newEnd)
        {
            var trimmedAa = FullTranscriptAnnotator.TryTrimAminoAcidsAndUpdateProteinPositions(new SequenceChange(reference, alt), start, end);

            Assert.Equal(newReference, trimmedAa.AaChange.Reference);
            Assert.Equal(newAlt, trimmedAa.AaChange.Alternate);
            Assert.Equal(newStart, trimmedAa.ProteinStart);
            Assert.Equal(newEnd, trimmedAa.ProteinEnd);
        }
Exemplo n.º 2
0
        public void GetHgvsProteinAnnotation_deletion()
        {
            var variant     = new Variant(ChromosomeUtilities.Chr1, 1262300, 1262302, "TCG", "", VariantType.deletion, "1:1262300:1262302", false, false, false, null, AnnotationBehavior.SmallVariants, false);
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Ser4del)", hgvspNotation);
        }
Exemplo n.º 3
0
        public void GetHgvsProteinAnnotation_duplication_right_shifted()
        {
            var variant     = new Variant(ChromosomeUtilities.Chr1, 1262297, 1262296, "", "GAC", VariantType.insertion, "1:1262295:T>GAC", false, false, false, null, AnnotationBehavior.SmallVariants, false);
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Asp3dup)", hgvspNotation);
        }
Exemplo n.º 4
0
        public void GetHgvsProteinAnnotation_substitution()
        {
            var variant     = new Variant(ChromosomeUtilities.Chr1, 1262295, 1262295, "A", "C", VariantType.SNV, "1:1262295:A>C", false, false, false, null, AnnotationBehavior.SmallVariants, false);
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Asp2Ala)", hgvspNotation);
        }
Exemplo n.º 5
0
        public void GetHgvsProteinAnnotation_frameshift_stop_gain()
        {
            var variant     = new Variant(ChromosomeUtilities.Chr1, 1262313, 1262312, "", "GA", VariantType.insertion, "1:1262333:1262332", false, false, false, null, AnnotationBehavior.SmallVariants, false);
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Phe8Ter)", hgvspNotation);
        }
Exemplo n.º 6
0
        public void GetHgvsProteinAnnotation_insertion()
        {
            var chromosome  = new Chromosome("chr1", "1", 0);
            var variant     = new Variant(chromosome, 1262297, 1262296, "", "TTC", VariantType.insertion, "1:1262295:T>TTTC", false, false, false, null, null, new AnnotationBehavior(false, false, false, false, false));
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Asp2_Asp3insPhe)", hgvspNotation);
        }
Exemplo n.º 7
0
        public void GetHgvsProteinAnnotation_extension()
        {
            var chromosome  = new Chromosome("chr1", "1", 0);
            var variant     = new Variant(chromosome, 1263141, 1263143, "TAG", "", VariantType.deletion, "1:1263141:1263143", false, false, false, null, null, new AnnotationBehavior(false, false, false, false, false));
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Ter215GlyextTer43)", hgvspNotation);
        }
Exemplo n.º 8
0
        public void GetHgvsProteinAnnotation_frameshift()
        {
            var chromosome  = new Chromosome("chr1", "1", 0);
            var variant     = new Variant(chromosome, 1262300, 1262301, "TC", "", VariantType.deletion, "1:1262300:1262301", false, false, false, null, null, new AnnotationBehavior(false, false, false, false, false));
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Ser4GlyfsTer19)", hgvspNotation);
        }
Exemplo n.º 9
0
        public void GetHgvsProteinAnnotation_no_change()
        {
            var chromosome  = new Chromosome("chr1", "1", 0);
            var variant     = new Variant(chromosome, 1262300, 1262302, "TCG", "AGT", VariantType.indel, "1:1262300:1262302", false, false, false, null, null, new AnnotationBehavior(false, false, false, false, false));
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:c.10_12delTCGinsAGT(p.(Ser4=))", hgvspNotation);
        }
Exemplo n.º 10
0
        public void GetHgvsProteinAnnotation_delIns()
        {
            var chromosome  = new Chromosome("chr1", "1", 0);
            var variant     = new Variant(chromosome, 1262300, 1262305, "TCGGAG", "GAGACA", VariantType.indel, "1:1262300:1262305", false, false, false, null, null, new AnnotationBehavior(false, false, false, false, false));
            var refSequence = new SimpleSequence(Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));

            var hgvspNotation = annotatedTranscript.HgvsProtein;

            Assert.Equal("ENST00000343938.4:p.(Ser4_Glu5delinsGluThr)", hgvspNotation);
        }
Exemplo n.º 11
0
        public void SerializeJson_NominalUsage()
        {
            var variant     = new Variant(ChromosomeUtilities.Chr1, 1263141, 1263143, "TAG", "", VariantType.deletion, "1:1263141:1263143", false, false, false, null, AnnotationBehavior.SmallVariants, false);
            var refSequence = new SimpleSequence(HgvsProteinNomenclatureTests.Enst00000343938GenomicSequence, 1260147 - 1);
            var transcript  = HgvsProteinNomenclatureTests.GetMockedTranscriptOnForwardStrand();

            var annotatedTranscript = FullTranscriptAnnotator.GetAnnotatedTranscript(transcript, variant, refSequence, null, null, new AminoAcids(false));
            var sb = StringBuilderCache.Acquire();

            annotatedTranscript.SerializeJson(sb);
            var jsonString = StringBuilderCache.GetStringAndRelease(sb);

            Assert.Contains("ENST00000343938.4:p.(Ter215GlyextTer43)", jsonString);
        }