public void AnnotationCarryover() { var saReader = ResourceUtilities.GetSupplementaryAnnotationReader(Resources.MiniSuppAnnot("chr2_90472571_90472592.nsa")); var annotationSource = ResourceUtilities.GetAnnotationSource(DataUtilities.EmptyCachePrefix, saReader); annotationSource?.EnableReferenceNoCalls(false); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "2 90472571 . AAAAAAAAAAAAAAAAAAGTCC AGTCT 177 PASS CIGAR=1M21D4I;RU=.;REFREP=.;IDREP=. GT:GQ:GQX:DPI:AD 0/1:220:177:46:40,7"); Assert.NotNull(annotatedVariant); var altAllele = annotatedVariant.AnnotatedAlternateAlleles.First(); Assert.NotNull(altAllele); Assert.False(altAllele.IsReferenceMinor); Assert.Equal("indel", altAllele.VariantType); Assert.Equal("2:90472572:90472592:GTCT", altAllele.VariantId); annotatedVariant = DataUtilities.GetVariant(annotationSource, "2 90472592 . C . . PASS RefMinor GT:GQX:DP:DPF:AD 0:96:33:15:33"); Assert.NotNull(annotatedVariant); altAllele = annotatedVariant.AnnotatedAlternateAlleles.FirstOrDefault(); Assert.NotNull(altAllele); Assert.True(altAllele.IsReferenceMinor); Assert.Equal("SNV", altAllele.VariantType); }
public void OverlappingTranscripts() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("chr1_89500_911300_Ensembl84_pos"), null) as NirvanaAnnotationSource; annotationSource?.EnableReportAllSvOverlappingTranscripts(); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1\t900000\t.\tG\t<DEL>\t.\tPASS\tEND=911300;SVTYPE=DEL"); Assert.NotNull(annotatedVariant); var overlappingTranscriptIds = JsonUtilities.GetOverlappingTranscriptIds(annotatedVariant.AnnotatedAlternateAlleles.First()); var expectedTranscripts = new List <string> { "ENST00000338591", "ENST00000379410", "ENST00000379409", "ENST00000379407", "ENST00000480267", "ENST00000491024", "ENST00000433179", "ENST00000341290", "ENST00000479361" }; Assert.True(expectedTranscripts.OrderBy(t => t).SequenceEqual(overlappingTranscriptIds.OrderBy(t => t))); Assert.Contains("{\"transcript\":\"ENST00000338591\",\"hgnc\":\"KLHL17\",\"isCanonical\":true,\"partialOverlap\":true}", annotatedVariant.ToString()); Assert.Contains("{\"transcript\":\"ENST00000379409\",\"hgnc\":\"PLEKHN1\"}", annotatedVariant.ToString()); }
public void NotNonCanonicalSpliceSurrReverse() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000467459_chr1_Ensembl84"), null) as NirvanaAnnotationSource; annotationSource?.AddPlugin(new VariantAnnotation.Loftee.Loftee()); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1 45797933 . G A\t.\tPASS\t.\t.\t."); Assert.NotNull(annotatedVariant); Assert.DoesNotContain("loftee", annotatedVariant.ToString()); }
public void NonCanonicalSpliceSurr() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000366872_chr1_Ensembl84"), null) as NirvanaAnnotationSource; annotationSource?.AddPlugin(new VariantAnnotation.Loftee.Loftee()); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1 223722780 . G A\t.\tPASS\t.\t.\t."); Assert.NotNull(annotatedVariant); Assert.Contains("loftee", annotatedVariant.ToString()); Assert.Contains("non_can_splice_surr", annotatedVariant.ToString()); }
public void NonCanonicalSpliceReverseStrand() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000378156_chr1_Ensembl84"), null) as NirvanaAnnotationSource; annotationSource?.AddPlugin(new VariantAnnotation.Loftee.Loftee()); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1\t5935162\t.\tA\tT\t.\tPASS\t.\t.\t."); Assert.NotNull(annotatedVariant); Assert.Contains("loftee", annotatedVariant.ToString()); Assert.Contains("non_can_splice", annotatedVariant.ToString()); }
public void SingleExon() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000600779_chr1_Ensembl84"), null) as NirvanaAnnotationSource; annotationSource?.AddPlugin(new VariantAnnotation.Loftee.Loftee()); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1\t2258668\t.\tGACACAGAAAC\tG\t.\tPASS\t.\t.\t."); Assert.NotNull(annotatedVariant); Assert.Contains("loftee", annotatedVariant.ToString()); Assert.Contains("single_exon", annotatedVariant.ToString()); }
public void NagnagSiteForwardStrand() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000370165_chr1_Ensembl84"), null) as NirvanaAnnotationSource; annotationSource?.AddPlugin(new VariantAnnotation.Loftee.Loftee()); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1\t100316589\t.\tA\tG\t.\tPASS\t.\t.\t."); Assert.NotNull(annotatedVariant); Assert.Contains("loftee", annotatedVariant.ToString()); Assert.Contains("nagnag_site", annotatedVariant.ToString()); Assert.Contains("bioType", annotatedVariant.ToString()); }
public void MitochondriaStopGained() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000362079_chrM_Ensembl84"), null); annotationSource.EnableMitochondrialAnnotation(); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chrM\t9378\t.\tG\tA\t3070.00\tPASS\t."); Assert.NotNull(annotatedVariant); var transcriptAllele = DataUtilities.GetTranscript(annotatedVariant, "ENST00000362079", "A"); Assert.NotNull(transcriptAllele); Assert.Equal("stop_gained", string.Join("&", transcriptAllele.Consequence)); }
public void ReferenceNoCallsOverlapTranscript(bool enableRefNoCall, bool limitToTranscript, int numberOfAnnotatedAlleles) { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000483270_chr1_Ensembl84"), null) as NirvanaAnnotationSource; if (enableRefNoCall) { annotationSource?.EnableReferenceNoCalls(limitToTranscript); } var annotatedVariant = DataUtilities.GetVariant(annotationSource, "1 15886104 . C . . LowQ END=15890000 . ."); Assert.NotNull(annotatedVariant); AssertUtilities.CheckAlleleCount(numberOfAnnotatedAlleles, annotatedVariant); }
public void BasicCustomIntervalOutput() { var customIntervalProvider = new MockCustomIntervalProvider(ResourceUtilities.GetReadStream(Resources.CustomIntervals("chr1_IcslIntervals_69090_69091.nci")), _renamer); var annotationSource = ResourceUtilities.GetAnnotationSource(DataUtilities.EmptyCachePrefix, null, null, customIntervalProvider); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1 69092 . T C . LowGQX;HighDPFRatio END=10244;BLOCKAVG_min30p3a GT:GQX:DP:DPF .:.:0:1"); Assert.NotNull(annotatedVariant); const string expectedJson = "{\"altAllele\":\"C\",\"refAllele\":\"T\",\"begin\":69092,\"chromosome\":\"chr1\",\"end\":69092,\"variantType\":\"SNV\",\"vid\":\"1:69092:C\",\"IcslIntervals\":[{\"Start\":69091,\"End\":70008,\"gene\":\"OR4F5\",\"assesment\":\"Some_evidence_of_constraint\",\"score\":0.0,\"exacScore\":3.60208899915}]}"; var observedJson = JsonUtilities.GetFirstAlleleJson(annotatedVariant); Assert.Equal(expectedJson, observedJson); }
public void LofteeEndTruncation(bool enableLoftee, bool containLoftee) { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000369356_chr1_Ensembl84"), null) as NirvanaAnnotationSource; if (enableLoftee) { annotationSource?.AddPlugin(new VariantAnnotation.Loftee.Loftee()); } var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1\t144852390\t.\tC\tT . LowQ . . ."); Assert.NotNull(annotatedVariant); Assert.Equal(containLoftee, annotatedVariant.ToString().Contains("loftee")); Assert.Equal(containLoftee, annotatedVariant.ToString().Contains("end_trunc")); }
public void AddVariantToJsonOutputTests() { var customIntervals = new List <ICustomInterval> { new VariantAnnotation.DataStructures.CustomInterval("chr1", 118165685, 118165692, "Test", null, null) }; var customIntervalProvider = new MockCustomIntervalProvider(customIntervals, _renamer); var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000006101_chr17_Ensembl84"), null, null, customIntervalProvider); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "chr1 118165691 rs1630312 C T 156.00 PASS . GT:GQ:GQX:DP:DPF:AD 0/1:169:155:27:0:13,14"); var observedResult = annotatedVariant.ToString(); Assert.Contains("Start", observedResult); Assert.Contains("Test", observedResult); Assert.DoesNotContain("customIntervals", observedResult); }
public void EnableMitochondrialAnnotation() { var annotationSource = ResourceUtilities.GetAnnotationSource(Resources.CacheGRCh37("ENST00000387314_chrM_Ensembl84"), null); annotationSource.EnableMitochondrialAnnotation(); var annotatedVariant = DataUtilities.GetVariant(annotationSource, "MT 589 . C A . PASS . . ."); Assert.NotNull(annotatedVariant); AssertUtilities.CheckAlleleCount(1, annotatedVariant); var altAllele = annotatedVariant.AnnotatedAlternateAlleles.First(); Assert.NotNull(altAllele); AssertUtilities.CheckEnsemblTranscriptCount(1, altAllele); Assert.Contains("ENST00000387314", altAllele.ToString()); }