internal static Status DecideAnnotationStatus(IInterval variant, IInterval transcript, AnnotationBehavior behavior) { var overlapsTranscript = variant.Overlaps(transcript); if (!behavior.ReducedTranscriptAnnotation) { // handle small variants if (overlapsTranscript) { return(Status.FullAnnotation); } if (behavior.NeedFlankingTranscript && variant.Overlaps(transcript, OverlapBehavior.FlankingLength)) { return(Status.FlankingAnnotation); } } else if (overlapsTranscript) { // handle large variants if (behavior.CanonicalTranscriptOnly) { return(Status.RohAnnotation); } return(variant.Contains(transcript) ? Status.CompleteOverlapAnnotation : Status.ReducedAnnotation); } return(Status.NoAnnotation); }
internal static Status DecideAnnotationStatus(IInterval variant, IInterval transcript, AnnotationBehavior behavior, IInterval gene) { if (variant.Contains(gene) && behavior.ReducedTranscriptAnnotation) { return(Status.SvCompleteOverlapAnnotation); } if (variant.Contains(gene) && !behavior.ReducedTranscriptAnnotation) { return(Status.FullAnnotation); } if (!variant.Contains(gene) && variant.Overlaps(transcript) && behavior.ReducedTranscriptAnnotation) { return(Status.ReducedAnnotation); } if (!variant.Contains(gene) && variant.Overlaps(transcript) && !behavior.ReducedTranscriptAnnotation) { return(Status.FullAnnotation); } if (!variant.Overlaps(transcript) && variant.Overlaps(transcript, OverlapBehavior.FlankingLength) && behavior.NeedFlankingTranscript) { return(Status.FlankingAnnotation); } return(Status.NoAnnotation); }
internal static Status DecideAnnotationStatus(IInterval variant, IInterval transcript, AnnotationBehavior behavior, int flankingLength) { bool overlapsTranscript = variant.Overlaps(transcript); if (!behavior.ReducedTranscriptAnnotation) { // handle small variants if (overlapsTranscript) { return(Status.FullAnnotation); } if (behavior.NeedFlankingTranscripts && variant.Overlaps(transcript, flankingLength)) { return(Status.FlankingAnnotation); } } else if (overlapsTranscript) { // handle large variants if (behavior.CanonicalTranscriptOnly) { return(Status.RohAnnotation); } return(Status.ReducedAnnotation); } return(Status.NoAnnotation); }
private void CheckSpliceSiteOverlap(IInterval variant, IInterval region) { if (variant.Overlaps(region.Start, region.Start + 1)) { IsStartSpliceSite = true; } if (variant.Overlaps(region.End - 1, region.End)) { IsEndSpliceSite = true; } }
public static bool HasCds(IInterval codingRegion, IInterval exon) { if (codingRegion == null || codingRegion.Start == -1 || codingRegion.End == -1) { return(false); } return(exon.Overlaps(codingRegion)); }
internal bool IsWithinCds(int coveredCdsBegin, int coveredCdsEnd, IInterval codingRegion, IInterval variant) { if (IsWithinFrameshiftIntron) { return(variant.Overlaps(codingRegion)); } return(coveredCdsBegin != -1 && coveredCdsEnd != -1); }
private void CheckIntronOverlap(IInterval variant, bool isInsertion, IInterval region) { // we need to special case insertions between the donor and acceptor sites // make sure the size of intron is larger than 4 if (region.Start <= region.End - 4 && (variant.Overlaps(region.Start + 2, region.End - 2) || isInsertion && (variant.Start == region.Start + 2 || variant.End == region.End - 2))) { IsWithinIntron = true; } }
public FeatureVariantEffects(IInterval feature, VariantType vt, IInterval variant, bool isSv) { _isSv = isSv; _completelyOverlaps = Intervals.Utilities.Contains(variant.Start, variant.End, feature.Start, feature.End); _overlaps = feature.Overlaps(variant); _completelyWithin = variant.Start >= feature.Start && variant.End <= feature.End; _lossOrDeletion = vt == VariantType.copy_number_loss || vt == VariantType.deletion; _gainOrDuplication = vt == VariantType.copy_number_gain || vt == VariantType.duplication || vt == VariantType.tandem_duplication; _isInsertionDeletion = vt == VariantType.indel; _isInsertion = vt == VariantType.insertion; }
public void DetermineIntronicEffect(ITranscriptRegion[] regions, IInterval variant, VariantType variantType) { if (regions == null) { return; } var isInsertion = variantType == VariantType.insertion; foreach (var region in regions) { if (region.Type != TranscriptRegionType.Intron) { continue; } // skip this one if variant is out of range : the range is set to 3 instead of the original old: // all of the checking occured in the region between start-3 to end+3, if we set to 8, we can made mistakes when // checking IsWithinIntron when we have a small exon if (!variant.Overlaps(region.Start - 3, region.End + 3)) { continue; } // under various circumstances the genebuild process can introduce artificial // short (<= 12 nucleotide) introns into transcripts (e.g. to deal with errors // in the reference sequence etc.), we don't want to categorize variations that // fall in these introns as intronic, or as any kind of splice variant var isFrameshiftIntron = region.End - region.Start <= 12; if (isFrameshiftIntron && variant.Overlaps(region.Start, region.End)) { IsWithinFrameshiftIntron = true; continue; } CheckSpliceSiteOverlap(variant, region); CheckIntronOverlap(variant, isInsertion, region); // the definition of splice_region (SO:0001630) is "within 1-3 bases of the // exon or 3-8 bases of the intron." We also need to special case insertions // between the edge of an exon and a donor or acceptor site and between a donor // or acceptor site and the intron IsWithinSpliceSiteRegion = variant.Overlaps(region.Start + 2, region.Start + 7) || variant.Overlaps(region.End - 7, region.End - 2) || variant.Overlaps(region.Start - 3, region.Start - 1) || variant.Overlaps(region.End + 1, region.End + 3) || isInsertion && (variant.Start == region.Start || variant.End == region.End || variant.Start == region.Start + 2 || variant.End == region.End - 2); } }