public void DecideAnnotationStatus_Flanking_ReturnFlankingAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 100), new Interval(102, 305), AnnotationBehavior.SmallVariants); Assert.Equal(TranscriptAnnotationFactory.Status.FlankingAnnotation, observedStatus); }
public void GetAnnotatedTranscripts_ReturnEmptyList() { var variant = new Mock <IVariant>(); var transcript1 = new Mock <ITranscript>(); var transcript2 = new Mock <ITranscript>(); var transcripts = new[] { transcript1.Object, transcript2.Object }; variant.SetupGet(x => x.Behavior).Returns(new AnnotationBehavior(true, false, false, true, false)); variant.SetupGet(x => x.Start).Returns(123456); variant.SetupGet(x => x.End).Returns(123456); transcript1.SetupGet(x => x.Id).Returns(CompactId.Convert("NR_046018.2")); transcript1.SetupGet(x => x.Start).Returns(108455); transcript1.SetupGet(x => x.End).Returns(118455); transcript1.SetupGet(x => x.Gene.Start).Returns(108455); transcript1.SetupGet(x => x.Gene.End).Returns(118455); transcript2.SetupGet(x => x.Id).Returns(CompactId.Convert("NR_106918.1")); transcript2.SetupGet(x => x.Start).Returns(128460); transcript2.SetupGet(x => x.End).Returns(129489); transcript2.SetupGet(x => x.Gene.Start).Returns(128460); transcript2.SetupGet(x => x.Gene.End).Returns(129489); var compressedSequence = new Mock <ISequence>(); var observedAnnotatedTranscripts = TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant.Object, transcripts, compressedSequence.Object, null, null); Assert.Empty(observedAnnotatedTranscripts); }
public void DecideAnnotationStatus_ROH_Return_RohAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 500), new Interval(102, 305), AnnotationBehavior.RohBehavior); Assert.Equal(TranscriptAnnotationFactory.Status.RohAnnotation, observedStatus); }
public void DecideAnnotationStatus_Full_CompleteOverlap_ReturnFullAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 500), new Interval(102, 305), new AnnotationBehavior(false, true, false, false, false)); Assert.Equal(TranscriptAnnotationFactory.Status.FullAnnotation, observedStatus); }
public void DecideAnnotationStatus_Full_PartialOverlap_ReturnFullAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 105), new Interval(102, 305), AnnotationBehavior.SmallVariants); Assert.Equal(TranscriptAnnotationFactory.Status.FullAnnotation, observedStatus); }
public void DecideAnnotationStatus_Reduced_TranscriptPartialOverlap_ReturnReducedAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 200), new Interval(102, 305), AnnotationBehavior.StructuralVariants, Chromosome.ShortFlankingLength); Assert.Equal(TranscriptAnnotationFactory.Status.ReducedAnnotation, observedStatus); }
public void GetAnnotatedTranscripts_RohAnnotation_ReturnsCanonicalOnly() { var variant = new Mock <IVariant>(); var transcript1 = new Mock <ITranscript>(); var transcript2 = new Mock <ITranscript>(); var transcripts = new[] { transcript1.Object, transcript2.Object }; variant.SetupGet(x => x.Behavior).Returns(AnnotationBehavior.RohBehavior); variant.SetupGet(x => x.Start).Returns(10000); variant.SetupGet(x => x.End).Returns(20000); transcript1.SetupGet(x => x.Id).Returns(CompactId.Convert("NM_123.1")); transcript1.SetupGet(x => x.Start).Returns(11000); transcript1.SetupGet(x => x.End).Returns(15000); transcript1.SetupGet(x => x.IsCanonical).Returns(true); transcript2.SetupGet(x => x.Id).Returns(CompactId.Convert("NM_456.2")); transcript2.SetupGet(x => x.Start).Returns(11000); transcript2.SetupGet(x => x.End).Returns(15000); transcript2.SetupGet(x => x.IsCanonical).Returns(false); var observedAnnotatedTranscripts = TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant.Object, transcripts, null, null, null); Assert.Single(observedAnnotatedTranscripts); Assert.Equal("NM_123", observedAnnotatedTranscripts[0].Transcript.Id.WithVersion); }
public void Annotate_return_null_when_no_flanking_over_transcript() { var variant = new Mock <IVariant>(); var transcript1 = new Mock <ITranscript>(); var transcript2 = new Mock <ITranscript>(); var transcripts = new[] { transcript1.Object, transcript2.Object }; variant.SetupGet(x => x.Behavior).Returns(new AnnotationBehavior(true, false, false, true, false, false)); variant.SetupGet(x => x.Start).Returns(123456); variant.SetupGet(x => x.End).Returns(123456); transcript1.SetupGet(x => x.Start).Returns(108455); transcript1.SetupGet(x => x.End).Returns(118455); transcript1.SetupGet(x => x.Gene.Start).Returns(108455); transcript1.SetupGet(x => x.Gene.End).Returns(118455); transcript2.SetupGet(x => x.Start).Returns(128460); transcript2.SetupGet(x => x.End).Returns(129489); transcript2.SetupGet(x => x.Gene.Start).Returns(128460); transcript2.SetupGet(x => x.Gene.End).Returns(129489); var compressedSequence = new Mock <ISequence>(); var observedAnnotatedTranscripts = new List <IAnnotatedTranscript>(); TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant.Object, transcripts, compressedSequence.Object, observedAnnotatedTranscripts, null, null, null, null); Assert.Empty(observedAnnotatedTranscripts); }
public void When_not_reducedTranscriptAnnotation_partially_overlapped_variant_get_full_annotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 105), new Interval(102, 305), new AnnotationBehavior(false, true, false, false, false, false), new Interval(102, 305)); Assert.Equal(TranscriptAnnotationFactory.Status.FullAnnotation, observedStatus); }
public void When_needFlankingTranscript_flankingTranscript_get_flankingAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 100), new Interval(102, 305), new AnnotationBehavior(false, true, false, true, false, false), new Interval(102, 305)); Assert.Equal(TranscriptAnnotationFactory.Status.FlankingAnnotation, observedStatus); }
public void When_reducedTranscriptAnnotation_and_gene_is_completely_overlapped_with_variant_get_SvCompleteOverlapAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 500), new Interval(102, 305), new AnnotationBehavior(false, true, true, false, false, false), new Interval(102, 305)); Assert.Equal(TranscriptAnnotationFactory.Status.SvCompleteOverlapAnnotation, observedStatus); }
public void When_reducedTranscriptAnnotation_and_transcript_completely_overlapped_variant_but_gene_partial_overlap_get_reducedAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 500), new Interval(102, 305), new AnnotationBehavior(false, true, true, false, false, false), new Interval(102, 503)); Assert.Equal(TranscriptAnnotationFactory.Status.ReducedAnnotation, observedStatus); }
public void GetAnnotatedTranscripts_ReturnEmptyList() { var variant = new Mock <IVariant>(); var transcript1 = new Mock <ITranscript>(); var transcript2 = new Mock <ITranscript>(); ITranscript[] transcripts = { transcript1.Object, transcript2.Object }; variant.SetupGet(x => x.Behavior).Returns(AnnotationBehavior.SmallVariants); variant.SetupGet(x => x.Chromosome.FlankingLength).Returns(Chromosome.ShortFlankingLength); variant.SetupGet(x => x.Start).Returns(123456); variant.SetupGet(x => x.End).Returns(123456); transcript1.SetupGet(x => x.Id).Returns(CompactId.Convert("NR_046018.2")); transcript1.SetupGet(x => x.Start).Returns(108455); transcript1.SetupGet(x => x.End).Returns(118455); transcript1.SetupGet(x => x.Gene.Start).Returns(108455); transcript1.SetupGet(x => x.Gene.End).Returns(118455); transcript2.SetupGet(x => x.Id).Returns(CompactId.Convert("NR_106918.1")); transcript2.SetupGet(x => x.Start).Returns(128460); transcript2.SetupGet(x => x.End).Returns(129489); transcript2.SetupGet(x => x.Gene.Start).Returns(128460); transcript2.SetupGet(x => x.Gene.End).Returns(129489); var compressedSequence = new Mock <ISequence>(); IList <IAnnotatedTranscript> observedAnnotatedTranscripts = TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant.Object, transcripts, compressedSequence.Object, null, null); Assert.Empty(observedAnnotatedTranscripts); }
public void NonOverlap_transcript_get_no_annotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 101), new Interval(5102, 6100), new AnnotationBehavior(true, false, false, true, false, false), new Interval(5102, 6100)); Assert.Equal(TranscriptAnnotationFactory.Status.NoAnnotation, observedStatus); }
public void DecideAnnotationStatus_Full_CompleteOverlap_ReturnFullAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 500), new Interval(102, 305), AnnotationBehavior.SmallVariants, Chromosome.ShortFlankingLength); Assert.Equal(TranscriptAnnotationFactory.Status.FullAnnotation, observedStatus); }
public void DecideAnnotationStatus_ROH_Return_RohAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 500), new Interval(102, 305), AnnotationBehavior.RunsOfHomozygosity, Chromosome.ShortFlankingLength); Assert.Equal(TranscriptAnnotationFactory.Status.RohAnnotation, observedStatus); }
public void DecideAnnotationStatus_Reduced_TranscriptPartialOverlap_ReturnReducedAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 200), new Interval(102, 305), new AnnotationBehavior(false, true, true, false, false)); Assert.Equal(TranscriptAnnotationFactory.Status.ReducedAnnotation, observedStatus); }
public void DecideAnnotationStatus_NoOverlap_ReturnNoAnnotation() { var observedStatus = TranscriptAnnotationFactory.DecideAnnotationStatus(new Interval(100, 101), new Interval(5102, 6100), AnnotationBehavior.SmallVariants, Chromosome.ShortFlankingLength); Assert.Equal(TranscriptAnnotationFactory.Status.NoAnnotation, observedStatus); }
public void GetAnnotatedTranscripts_RohAnnotation_ReturnsCanonicalOnly() { var variant = new Mock <IVariant>(); var transcript1 = new Mock <ITranscript>(); var transcript2 = new Mock <ITranscript>(); ITranscript[] transcripts = { transcript1.Object, transcript2.Object }; variant.SetupGet(x => x.Behavior).Returns(AnnotationBehavior.RunsOfHomozygosity); variant.SetupGet(x => x.Chromosome.FlankingLength).Returns(Chromosome.ShortFlankingLength); variant.SetupGet(x => x.Start).Returns(10000); variant.SetupGet(x => x.End).Returns(20000); transcript1.SetupGet(x => x.Id).Returns(CompactId.Convert("NM_123.1")); transcript1.SetupGet(x => x.Start).Returns(11000); transcript1.SetupGet(x => x.End).Returns(15000); transcript1.SetupGet(x => x.IsCanonical).Returns(true); transcript2.SetupGet(x => x.Id).Returns(CompactId.Convert("NM_456.2")); transcript2.SetupGet(x => x.Start).Returns(11000); transcript2.SetupGet(x => x.End).Returns(15000); transcript2.SetupGet(x => x.IsCanonical).Returns(false); IList <IAnnotatedTranscript> observedAnnotatedTranscripts = TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant.Object, transcripts, null, null, null); Assert.Single(observedAnnotatedTranscripts); Assert.Equal("NM_123", observedAnnotatedTranscripts[0].Transcript.Id.WithVersion); }
private void AddTranscripts(IAnnotatedVariant[] annotatedVariants, IIntervalForest <ITranscript> transcriptIntervalForest) { foreach (var annotatedVariant in annotatedVariants) { var variant = annotatedVariant.Variant; if (variant.Behavior.Equals(AnnotationBehavior.MinimalAnnotationBehavior)) { continue; } ITranscript[] geneFusionCandidates = GetGeneFusionCandidates(variant.BreakEnds, transcriptIntervalForest); ITranscript[] transcripts = transcriptIntervalForest.GetAllFlankingValues(variant); if (transcripts == null) { continue; } IList <IAnnotatedTranscript> annotatedTranscripts = TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant, transcripts, _sequence, _siftCache, _polyphenCache, geneFusionCandidates); if (annotatedTranscripts.Count == 0) { continue; } foreach (var annotatedTranscript in annotatedTranscripts) { annotatedVariant.Transcripts.Add(annotatedTranscript); } } }
private void AddTranscripts(IAnnotatedVariant[] annotatedVariants) { foreach (var annotatedVariant in annotatedVariants) { var variant = annotatedVariant.Variant; if (variant.Behavior.MinimalTranscriptAnnotation) { continue; } ITranscript[] transcripts = _transcriptCache.TranscriptIntervalForest.GetAllFlankingValues(variant); if (transcripts == null) { continue; } IList <IAnnotatedTranscript> annotatedTranscripts = TranscriptAnnotationFactory.GetAnnotatedTranscripts(variant, transcripts, _sequence, _siftCache, _polyphenCache); if (annotatedTranscripts.Count == 0) { continue; } foreach (var annotatedTranscript in annotatedTranscripts) { AddConservationScore(annotatedTranscript); } foreach (var annotatedTranscript in annotatedTranscripts) { annotatedVariant.Transcripts.Add(annotatedTranscript); } } }
private void AddTranscripts(IAnnotatedPosition annotatedPosition) { var overlappingTranscripts = _transcriptCache.GetOverlappingTranscripts(annotatedPosition.Position); if (overlappingTranscripts == null) { return; } foreach (var annotatedVariant in annotatedPosition.AnnotatedVariants) { var geneFusionCandidates = GetGeneFusionCandiates(annotatedVariant.Variant.BreakEnds); var annotatedTranscripts = new List <IAnnotatedTranscript>(); TranscriptAnnotationFactory.GetAnnotatedTranscripts(annotatedVariant.Variant, overlappingTranscripts, _sequence, annotatedTranscripts, annotatedVariant.OverlappingGenes, annotatedVariant.OverlappingTranscripts, _siftCache, _polyphenCache, geneFusionCandidates); if (annotatedTranscripts.Count == 0) { continue; } foreach (var annotatedTranscript in annotatedTranscripts) { if (annotatedTranscript.Transcript.Source == Source.Ensembl) { annotatedVariant.EnsemblTranscripts.Add(annotatedTranscript); } else { annotatedVariant.RefSeqTranscripts.Add(annotatedTranscript); } } } }