internal static ProteinChange GetProteinChange(int start, string refAminoAcids, string altAminoAcids, string peptideSeq, IVariantEffect variantEffect) { if (refAminoAcids == altAminoAcids || variantEffect.IsStopRetained()) { return(ProteinChange.None); } //insertion before the transcript if (refAminoAcids.Length == 0 && start == 1) { return(ProteinChange.None); } if (variantEffect.IsStartLost()) { return(ProteinChange.StartLost); } // todo: add start gained // according to var nom, only if the Stop codon is effected, we call it an extension if (variantEffect.IsStopLost() && refAminoAcids.StartsWith(AminoAcids.StopCodon)) { return(ProteinChange.Extension); } if (variantEffect.IsFrameshiftVariant()) { return(ProteinChange.Frameshift); } if (altAminoAcids.Length > refAminoAcids.Length && HgvsUtilities.IsAminoAcidDuplicate(start, altAminoAcids, peptideSeq)) { return(ProteinChange.Duplication); } if (refAminoAcids.Length == 0 && altAminoAcids.Length != 0) { return(ProteinChange.Insertion); } if (refAminoAcids.Length != 0 && altAminoAcids.Length == 0) { return(ProteinChange.Deletion); } if (refAminoAcids.Length == 1 && altAminoAcids.Length == 1) { return(ProteinChange.Substitution); } // the only remaining possibility is deletions/insertions return(ProteinChange.DelIns); }
/// <summary> /// populates the consequences list with tier 3 consequences if found (NOTE: Tests are done in rank order) /// </summary> private void GetTier3Types() { // SpliceDonorVariant if (_variantEffect.IsSpliceDonorVariant()) { _consequences.Add(ConsequenceTag.splice_donor_variant); } // SpliceAcceptorVariant if (_variantEffect.IsSpliceAcceptorVariant()) { _consequences.Add(ConsequenceTag.splice_acceptor_variant); } // StopGained if (_variantEffect.IsStopGained()) { _consequences.Add(ConsequenceTag.stop_gained); } // FrameshiftVariant if (_variantEffect.IsFrameshiftVariant()) { _consequences.Add(ConsequenceTag.frameshift_variant); } // StopLost if (_variantEffect.IsStopLost()) { _consequences.Add(ConsequenceTag.stop_lost); } if (_variantEffect.IsStartLost()) { _consequences.Add(ConsequenceTag.start_lost); } // InframeInsertion if (_variantEffect.IsInframeInsertion()) { _consequences.Add(ConsequenceTag.inframe_insertion); } // InframeDeletion if (_variantEffect.IsInframeDeletion()) { _consequences.Add(ConsequenceTag.inframe_deletion); } // MissenseVariant if (_variantEffect.IsMissenseVariant()) { _consequences.Add(ConsequenceTag.missense_variant); } // ProteinAlteringVariant if (_variantEffect.IsProteinAlteringVariant()) { _consequences.Add(ConsequenceTag.protein_altering_variant); } // SpliceRegionVariant if (_variantEffect.IsSpliceRegionVariant()) { _consequences.Add(ConsequenceTag.splice_region_variant); } // IncompleteTerminalCodonVariant if (_variantEffect.IsIncompleteTerminalCodonVariant()) { _consequences.Add(ConsequenceTag.incomplete_terminal_codon_variant); } // StartRetainedVariant if (_variantEffect.IsStartRetained()) { _consequences.Add(ConsequenceTag.start_retained_variant); } // StopRetainedVariant if (_variantEffect.IsStopRetained()) { _consequences.Add(ConsequenceTag.stop_retained_variant); } // SynonymousVariant if (_variantEffect.IsSynonymousVariant()) { _consequences.Add(ConsequenceTag.synonymous_variant); } // CodingSequenceVariant if (_variantEffect.IsCodingSequenceVariant()) { _consequences.Add(ConsequenceTag.coding_sequence_variant); } // FivePrimeUtrVariant if (_variantEffect.IsFivePrimeUtrVariant()) { _consequences.Add(ConsequenceTag.five_prime_UTR_variant); } // ThreePrimeUtrVariant if (_variantEffect.IsThreePrimeUtrVariant()) { _consequences.Add(ConsequenceTag.three_prime_UTR_variant); } // NonCodingTranscriptExonVariant if (_variantEffect.IsNonCodingTranscriptExonVariant()) { _consequences.Add(ConsequenceTag.non_coding_transcript_exon_variant); } // IntronVariant if (_variantEffect.IsWithinIntron()) { _consequences.Add(ConsequenceTag.intron_variant); } // NonsenseMediatedDecayTranscriptVariant if (_variantEffect.IsNonsenseMediatedDecayTranscriptVariant()) { _consequences.Add(ConsequenceTag.NMD_transcript_variant); } // NonCodingTranscriptVariant if (_variantEffect.IsNonCodingTranscriptVariant()) { _consequences.Add(ConsequenceTag.non_coding_transcript_variant); } // FeatureElongation if (_featureEffect.Elongation()) { _consequences.Add(ConsequenceTag.feature_elongation); } // TranscriptTruncation if (_featureEffect.Truncation()) { _consequences.Add(ConsequenceTag.transcript_truncation); } }