/// <summary> /// constructor /// </summary> public BasicVariantEffects(TranscriptAnnotation ta) { var altAllele = ta.AlternateAllele; // codons ReferenceCodon = ta.ReferenceCodon ?? ""; AlternateCodon = ta.AlternateCodon ?? ""; ReferenceCodonLen = ReferenceCodon.Length; AlternateCodonLen = AlternateCodon.Length; // amino acids ReferenceAminoAcids = ta.ReferenceAminoAcids ?? ""; AlternateAminoAcids = ta.AlternateAminoAcids ?? ""; ReferenceAminoAcidsLen = ReferenceAminoAcids.Length; AlternateAminoAcidsLen = AlternateAminoAcids.Length; // variant type-specific IsDeletion = altAllele.NirvanaVariantType == VariantType.deletion; IsInsertion = altAllele.NirvanaVariantType == VariantType.insertion; // within coding region if (ta.HasValidCdsStart || ta.HasValidCdsEnd) { IsCoding = true; } //insertion in start codon and do not change start codon if (IsInsertion && ta.ProteinBegin <= 1 && AlternateAminoAcids.EndsWith(ReferenceAminoAcids)) { IsCoding = false; } }
public static void MapCoordinates(int start, int end, TranscriptAnnotation ta, Transcript transcript) { var isInsertion = start > end; if (isInsertion) { Swap.Int(ref start, ref end); } var results = MapInternalCoordinates(start, end, transcript); var coords = results; if (isInsertion) { coords = SetInsertionCdna(results, transcript); } var first = coords[0]; var last = coords[coords.Count - 1]; ta.HasValidCdnaStart = !first.IsGap; ta.HasValidCdnaEnd = !last.IsGap; ta.ComplementaryDnaBegin = first.IsGap ? -1 : first.Start; ta.ComplementaryDnaEnd = last.IsGap ? -1 : last.End; // grab the backup coordinates AssignBackupCdnaPositions(coords, ta); }
/// <summary> /// constructor /// </summary> public HgvsCodingNomenclature(TranscriptAnnotation ta, Transcript transcript, VariantFeature variant, ICompressedSequence compressedSequence, bool isGenomicDuplicate) { _ta = ta; _transcript = transcript; _variant = variant; _compressedSequence = compressedSequence; _isGenomicDuplicate = isGenomicDuplicate; _sb = new StringBuilder(); // get reference sequence strand var transcriptOnReverseStrand = transcript.Gene.OnReverseStrand; // this may be different to the input one for insertions/deletions var altAllele = ta.AlternateAllele; string variationFeatureSequence = altAllele.AlternateAllele; // get the reverse complement of the vfs if needed if (transcriptOnReverseStrand) { variationFeatureSequence = SequenceUtilities.GetReverseComplement(variationFeatureSequence); } // calculate the reference start and end GetReferenceCoordinates(transcript, altAllele, out _hgvsStart, out _hgvsEnd); // decide event type from HGVS nomenclature _hgvsNotation = new HgvsNotation(ta.TranscriptReferenceAllele, variationFeatureSequence, FormatUtilities.CombineIdAndVersion(transcript.Id, transcript.Version), _hgvsStart, _hgvsEnd, _transcript.Translation != null); }
private void AnnotateAltAllele(VariantFeature variant, VariantAlternateAllele altAllele, Transcript transcript) { // handle upstream or downstream transcripts if (!Overlap.Partial(transcript.Start, transcript.End, altAllele.Start, altAllele.End)) { return; } var ta = new TranscriptAnnotation { AlternateAllele = altAllele, HasValidCdnaCodingStart = false, HasValidCdsStart = false }; MapCdnaCoordinates(transcript, ta, altAllele); _pianoVariant.CreateAnnotationObject(transcript, altAllele); GetCodingAnnotations(transcript, ta, _compressedSequence); var consequence = new Consequences(new VariantEffect(ta, transcript, variant.InternalCopyNumberType)); consequence.DetermineVariantEffects(variant.InternalCopyNumberType); _pianoVariant.FinalizeAndAddAnnotationObject(transcript, ta, consequence.GetConsequenceStrings()); }
private string GetStopLostHgvsProtein(TranscriptAnnotation ta, string ret) { _hgvsNotation.AlternateAbbreviation = _hgvsNotation.AlternateAbbreviation.FirstAminoAcid3(); var translatedCds = GetTranslatedCodingSequence(ta); if (_hgvsNotation.Type == ProteinChange.Deletion) { var numExtraAminoAcids = GetNumAminoAcidsUntilStopCodon(translatedCds, _hgvsNotation.Start - 1, false); if (numExtraAminoAcids != -1) { _hgvsNotation.AlternateAbbreviation += "extTer" + numExtraAminoAcids; } } else if (_hgvsNotation.Type == ProteinChange.Substitution) { var numExtraAminoAcids = GetNumAminoAcidsUntilStopCodon(translatedCds, _hgvsNotation.Start - 1, false); if (numExtraAminoAcids != -1) { _hgvsNotation.AlternateAbbreviation += "extTer" + numExtraAminoAcids; } else { _hgvsNotation.AlternateAbbreviation += "extTer?"; } } return(ret + _hgvsNotation.ReferenceAbbreviation + _hgvsNotation.Start + _hgvsNotation.AlternateAbbreviation); }
public void FinalizeAndAddAnnotationObject(Transcript transcript, TranscriptAnnotation ta, string[] consequences) { if (ta.AlternateAllele.IsStructuralVariant) { return; } if (ta.HasValidCdnaCodingStart) { _currTranscript.ProteinID = transcript.Translation.ProteinId.ToString(); } _currTranscript.Consequence = consequences; if (ta.HasValidCdsStart || ta.HasValidCdsEnd) { _currTranscript.ProteinPosition = GetProtRangeString(ta); _currTranscript.UpStreamPeptides = GetFlankingPeptides(ta, transcript, 15, true); _currTranscript.AminoAcids = GetAlleleString(ta.ReferenceAminoAcids, ta.AlternateAminoAcids); if (!ta.HasFrameShift) { _currTranscript.DownStreamPeptides = GetFlankingPeptides(ta, transcript, 15, false); } } _currPianoAllele.Transcripts.Add(_currTranscript); }
public void FinalizeAndAddAnnotationObject(Transcript transcript, TranscriptAnnotation ta, string[] consequences) { if (!ta.AlternateAllele.IsStructuralVariant) { _currTranscript.ComplementaryDnaPosition = GetCdnaRangeString(ta); _currTranscript.HgvsCodingSequenceName = ta.HgvsCodingSequenceName; if (ta.HasValidCdnaCodingStart) { _currTranscript.ProteinID = TranscriptUtilities.GetProteinId(transcript); } } else { _currTranscript.ProteinID = ta.HasValidCdnaCodingStart ? TranscriptUtilities.GetProteinId(transcript) : null; if (ta.GeneFusionAnnotations != null && ta.GeneFusionAnnotations.Count == 1) { var sb = new StringBuilder(); ta.GeneFusionAnnotations.First().SerializeJson(sb); _currTranscript.GeneFusion = sb.ToString(); } else if (ta.GeneFusionAnnotations != null && ta.GeneFusionAnnotations.Count > 1) { throw new Exception("has mutiple gene fusions"); } } _currTranscript.Consequence = consequences; _currJsonVariant.AddTranscript(_currTranscript, transcript.TranscriptSource); }
/// <summary> /// returns a range string representation of two integers /// </summary> private static string GetCdnaRangeString(TranscriptAnnotation ta) { if (!ta.HasValidCdnaStart && !ta.HasValidCdnaEnd) { return(null); } if (!ta.HasValidCdnaStart && ta.HasValidCdnaEnd) { return("?-" + ta.ComplementaryDnaEnd); } if (!ta.HasValidCdnaEnd && ta.HasValidCdnaStart) { return(ta.ComplementaryDnaBegin + "-?"); } var begin = ta.ComplementaryDnaBegin; var end = ta.ComplementaryDnaEnd; if (end < begin) { Swap.Int(ref begin, ref end); } return(begin == end?begin.ToString(CultureInfo.InvariantCulture) : $"{begin}-{end}"); }
private string GetFlankingPeptides(TranscriptAnnotation ta, Transcript transcript, int nBase, bool upStrem) { var begin = ta.ProteinBegin; var end = ta.ProteinEnd; if (!ta.HasValidCdsStart && !ta.HasValidCdsEnd) { return(null); } if (!ta.HasValidCdsStart && ta.HasValidCdsEnd) { begin = end; } if (!ta.HasValidCdsEnd && ta.HasValidCdsStart) { end = begin; } if (upStrem) { var peptideStart = Math.Max(1, begin - nBase); return(transcript.Translation.PeptideSeq.Substring(peptideStart - 1, (begin - peptideStart))); } var peptideEnd = Math.Min(transcript.Translation.PeptideSeq.Length, end + nBase); return(peptideEnd > end + 1 ? transcript.Translation.PeptideSeq.Substring(end, (peptideEnd - end)) : ""); }
private static void CalculateCdsPositions(Transcript transcript, TranscriptAnnotation ta) { // sanity check: make sure we have a valid start position ta.HasValidCdsStart = true; ta.HasValidCdsEnd = true; if (ta.BackupCdnaEnd < transcript.Translation.CodingRegion.CdnaStart || ta.BackupCdnaBegin > transcript.Translation.CodingRegion.CdnaEnd) { // if the variant is completely non overlapping with the transcript's coding start ta.HasValidCdsStart = false; ta.HasValidCdsEnd = false; return; } // calculate the CDS position int beginOffset = transcript.StartExonPhase - transcript.Translation.CodingRegion.CdnaStart + 1; ta.CodingDnaSequenceBegin = ta.BackupCdnaBegin + beginOffset; ta.CodingDnaSequenceEnd = ta.BackupCdnaEnd + beginOffset; if (ta.CodingDnaSequenceBegin < 1 || ta.HasValidCdnaStart == false) { ta.HasValidCdsStart = false; } if (ta.CodingDnaSequenceEnd > transcript.Translation.CodingRegion.CdnaEnd + beginOffset || ta.HasValidCdnaEnd == false) { ta.HasValidCdsEnd = false; } }
/// <summary> /// returns a range string representation of two integers /// </summary> private static string GetProtRangeString(TranscriptAnnotation ta) { if (!ta.HasValidCdsStart && !ta.HasValidCdsEnd) { return(""); } if (!ta.HasValidCdsStart && ta.HasValidCdsEnd) { return("?-" + ta.ProteinEnd); } if (!ta.HasValidCdsEnd && ta.HasValidCdsStart) { return(ta.ProteinBegin + "-?"); } var begin = ta.ProteinBegin; var end = ta.ProteinEnd; if (end < begin) { Swap.Int(ref begin, ref end); } return(begin == end?begin.ToString(CultureInfo.InvariantCulture) : $"{begin}-{end}"); }
/// <summary> /// constructor /// </summary> public HgvsProteinNomenclature(VariantEffect variantEffect, TranscriptAnnotation ta, Transcript transcript, VariantFeature variant, ICompressedSequence compressedSequence, AminoAcids aminoAcids) { _variantEffect = variantEffect; _ta = ta; _transcript = transcript; _variant = variant; _compressedSequence = compressedSequence; _aminoAcids = aminoAcids; _hgvsNotation = new HgvsNotation(_ta.ReferenceAminoAcids, _ta.AlternateAminoAcids, FormatUtilities.CombineIdAndVersion(_transcript.Translation.ProteinId, _transcript.Translation.ProteinVersion), _ta.ProteinBegin, _ta.ProteinEnd); }
/// <summary> /// gets the reference and alternative amino acids for frameshifts [TranscriptVariationAllele.pm:1377 _get_fs_peptides] /// </summary> private void GetFrameshiftPeptides(TranscriptAnnotation ta) { var translatedCds = GetTranslatedCodingSequence(ta); if (translatedCds == null) { return; } var refTrans = _transcript.Translation.PeptideSeq + '*'; var translatedCdsLen = translatedCds.Length; _hgvsNotation.Start = ta.ProteinBegin; if (_hgvsNotation.Start > translatedCds.Length) { // TODO: careful as this might be the source of delinsdel _hgvsNotation.ReferenceAbbreviation = "del"; _hgvsNotation.AlternateAbbreviation = "del"; return; } while (_hgvsNotation.Start <= translatedCdsLen) { var refAminoAcid = refTrans[_hgvsNotation.Start - 1]; var altAminoAcid = translatedCds[_hgvsNotation.Start - 1]; // variation at stop codon, but maintains stop codon - set to synonymous if (refAminoAcid == '*' && altAminoAcid == '*') { _hgvsNotation.Type = ProteinChange.None; return; } if (refAminoAcid != altAminoAcid) { _hgvsNotation.SetReferenceAminoAcids(refAminoAcid.ToString()); _hgvsNotation.SetAlternateAminoAcids(altAminoAcid.ToString()); break; } _hgvsNotation.SetReferenceAminoAcids(refAminoAcid.ToString()); _hgvsNotation.SetAlternateAminoAcids(altAminoAcid.ToString()); _hgvsNotation.Start++; } }
/// <summary> /// constructor /// </summary> public VariantEffect(TranscriptAnnotation ta, Transcript transcript, VariantType internalCopyNumberType = VariantType.unknown) { _ta = ta; _transcript = transcript; _altAllele = ta.AlternateAllele; _preCache = new BasicVariantEffects(ta); _cache = new VariantEffectCache(); _tempCache = new TempVariantEffectCache(); _featureVariantEffects = new FeatureVariantEffects(transcript, _altAllele.NirvanaVariantType, _altAllele.Start, _altAllele.End, _altAllele.IsStructuralVariant, internalCopyNumberType); }
private static void MapCdnaCoordinates(Transcript transcript, TranscriptAnnotation ta, VariantAlternateAllele altAllele) { if (transcript.Gene.OnReverseStrand) { ta.TranscriptReferenceAllele = SequenceUtilities.GetReverseComplement(altAllele.ReferenceAllele); ta.TranscriptAlternateAllele = SequenceUtilities.GetReverseComplement(altAllele.AlternateAllele); } else { ta.TranscriptReferenceAllele = altAllele.ReferenceAllele; ta.TranscriptAlternateAllele = altAllele.AlternateAllele; } CdnaMapper.MapCoordinates(altAllele.Start, altAllele.End, ta, transcript); }
private string GetInsertionHgvsProtein(TranscriptAnnotation ta, string ret) { // list the first and last AA in reference only var firstInsPeptide = _hgvsNotation.ReferenceAbbreviation.FirstAminoAcid3(); var lastInsPeptide = _hgvsNotation.ReferenceAbbreviation.LastAminoAcid3(); if (_hgvsNotation.AlternateAbbreviation.StartsWith("Ter")) { var originalPepetide = _hgvsNotation.Type == ProteinChange.Insertion ? lastInsPeptide : firstInsPeptide; _hgvsNotation.AlternateAbbreviation = "Ter"; ret += originalPepetide + _hgvsNotation.Start + _hgvsNotation.AlternateAbbreviation; return(ret); } // for stops & add extX & distance to next stop to alt pep if (_hgvsNotation.ReferenceAminoAcids != null && _hgvsNotation.ReferenceAminoAcids.EndsWith("X")) { var translatedCds = GetTranslatedCodingSequence(ta); var numExtraAminoAcids = GetNumAminoAcidsUntilStopCodon(translatedCds, _hgvsNotation.Start - 1, false); if (numExtraAminoAcids != -1) { _hgvsNotation.AlternateAbbreviation += "extTer" + numExtraAminoAcids; } } if (_hgvsNotation.Start == _hgvsNotation.End && _hgvsNotation.Type == ProteinChange.InDel) { ret += firstInsPeptide + _hgvsNotation.Start + "delins" + _hgvsNotation.AlternateAbbreviation; } else { if (_hgvsNotation.Start > _hgvsNotation.End) { Swap.Int(ref _hgvsNotation.Start, ref _hgvsNotation.End); } if (_hgvsNotation.End > _transcript.Translation.PeptideSeq.Length) { ret = null; } else { ret += firstInsPeptide + _hgvsNotation.Start + '_' + lastInsPeptide + _hgvsNotation.End + (_hgvsNotation.Type == ProteinChange.Insertion ? "ins" : "delins") + _hgvsNotation.AlternateAbbreviation; } } return(ret); }
private void GetCodingAnnotations(Transcript transcript, TranscriptAnnotation ta, ICompressedSequence compressedSequence) { // coding annotations if (!ta.HasValidCdnaStart && !ta.HasValidCdnaEnd) { return; } CalculateCdsPositions(transcript, ta); // determine the protein position if (!ta.HasValidCdsStart && !ta.HasValidCdsEnd) { return; } GetProteinPosition(ta, transcript, compressedSequence); }
/// <summary> /// returns the translated coding sequence including the variant and the 3' UTR /// </summary> private string GetTranslatedCodingSequence(TranscriptAnnotation ta) { // get the sequence with the variant added string altCds = TranscriptUtilities.GetAlternateCds(_compressedSequence, ta.CodingDnaSequenceBegin, ta.CodingDnaSequenceEnd, ta.TranscriptAlternateAllele, _transcript.CdnaMaps, _transcript.Gene.OnReverseStrand, _transcript.StartExonPhase, _transcript.Translation.CodingRegion.CdnaStart); if (string.IsNullOrEmpty(altCds)) { return(null); } // get the new translation return(_aminoAcids.TranslateBases(altCds, true)); }
private void GetProteinPosition(TranscriptAnnotation ta, Transcript transcript, ICompressedSequence compressedSequence) { const int shift = 0; if (ta.HasValidCdsStart) { ta.ProteinBegin = (int)((ta.CodingDnaSequenceBegin + shift + 2.0) / 3.0); } if (ta.HasValidCdsEnd) { ta.ProteinEnd = (int)((ta.CodingDnaSequenceEnd + shift + 2.0) / 3.0); } // assign our codons and amino acids Codons.AssignExtended(ta, transcript, compressedSequence); _aminoAcids.Assign(ta); }
/// <summary> /// sets both the exon and intron number strings according to which were affected by the variant [BaseTranscriptVariation.pm:474 _exon_intron_number] /// </summary> public static void ExonIntronNumber(CdnaCoordinateMap[] cdnaMaps, SimpleInterval[] introns, bool onReverseStrand, TranscriptAnnotation ta, out string exonNumber, out string intronNumber) { int exonCount = 0; var altAllele = ta.AlternateAllele; var variantInterval = new AnnotationInterval(altAllele.Start, altAllele.End); var overlappedExons = new List <int>(); var overlappedIntrons = new List <int>(); var prevExon = CdnaCoordinateMap.Null(); foreach (var exon in cdnaMaps) { exonCount++; if (variantInterval.Overlaps(exon.GenomicStart, exon.GenomicEnd)) { overlappedExons.Add(exonCount); } if (!prevExon.IsNull) { int intronStart = prevExon.GenomicEnd + 1; int intronEnd = exon.GenomicStart - 1; if (variantInterval.Overlaps(intronStart, intronEnd)) { overlappedIntrons.Add(exonCount - 1); } } prevExon = exon; } exonNumber = GetExonIntronNumber(overlappedExons, cdnaMaps.Length, onReverseStrand); intronNumber = introns != null?GetExonIntronNumber(overlappedIntrons, introns.Length, onReverseStrand) : null; if (overlappedExons.Count > 0) { ta.HasExonOverlap = true; } }
public void AddExonData(TranscriptAnnotation ta, string exonNumber, bool isStructuralVariant) { var altAllele = ta.AlternateAllele; if (!isStructuralVariant && !altAllele.AlternateAllele.Contains("N")) { _currTranscript.AminoAcids = GetAlleleString(ta.ReferenceAminoAcids, ta.AlternateAminoAcids); } _currTranscript.Exons = exonNumber; _currTranscript.HgvsProteinSequenceName = ta.HgvsProteinSequenceName; if (!isStructuralVariant && (ta.HasValidCdsStart || ta.HasValidCdsEnd)) { _currTranscript.CdsPosition = GetCdsRangeString(ta); _currTranscript.ProteinPosition = GetProtRangeString(ta); _currTranscript.Codons = ta.GetCodonString(); } }
/// <summary> /// returns the HGVS protein string [TranscriptVariationAllele.pm:992 _get_hgvs_protein_format] /// </summary> private string GetHgvsProteinFormat(TranscriptAnnotation ta) { var ret = _hgvsNotation.ProteinId + ":p."; // handle stop_lost seperately regardless of cause by del/delins => p.TerposAA1extnum_AA_to_stop if (_variantEffect.IsStopLost()) { return(GetStopLostHgvsProtein(ta, ret)); } // handle the non stop-lost cases switch (_hgvsNotation.Type) { case ProteinChange.Duplication: ret = GetDupHgvsProtein(ret); break; case ProteinChange.Substitution: ret += _hgvsNotation.ReferenceAbbreviation + _hgvsNotation.Start + _hgvsNotation.AlternateAbbreviation; break; case ProteinChange.InDel: case ProteinChange.Insertion: ret = GetInsertionHgvsProtein(ta, ret); break; case ProteinChange.Frameshift: ret = GetFrameshiftHgvsProtein(ta, ret); break; case ProteinChange.Deletion: ret = GetDelHgvsProtein(ret); break; default: // default to substitution ret += GetHgvsRangeString(_hgvsNotation); break; } return(ret); }
public void AddFlankingTranscript(Transcript transcript, TranscriptAnnotation ta, string[] consequences) { _currTranscript = new JsonVariant.Transcript { IsCanonical = transcript.IsCanonical ? TrueTag : null, Consequence = consequences, ProteinID = ta.HasValidCdnaCodingStart ? TranscriptUtilities.GetProteinId(transcript) : null, TranscriptID = TranscriptUtilities.GetTranscriptId(transcript), BioType = BioTypeUtilities.GetBiotypeDescription(transcript.BioType), Gene = transcript.TranscriptSource == TranscriptDataSource.Ensembl ? transcript.Gene.EnsemblId.ToString() : transcript.Gene.EntrezGeneId.ToString(), Hgnc = transcript.Gene.Symbol }; if (ta.HasValidCdnaStart && ta.HasValidCdnaEnd) { _currTranscript.ComplementaryDnaPosition = GetCdnaRangeString(ta); } _currJsonVariant.AddTranscript(_currTranscript, transcript.TranscriptSource); }
/// <summary> /// assigns the backup cDNA positions (ignoring gaps) /// </summary> private static void AssignBackupCdnaPositions(List <Coordinate> coords, TranscriptAnnotation ta) { var nonGaps = new List <Coordinate>(); foreach (var coord in coords) { if (!coord.IsGap) { nonGaps.Add(coord); } } if (nonGaps.Count == 0) { ta.BackupCdnaBegin = -1; ta.BackupCdnaEnd = -1; return; } ta.BackupCdnaBegin = nonGaps[0].Start; ta.BackupCdnaEnd = nonGaps[nonGaps.Count - 1].End; }
private string GetFrameshiftHgvsProtein(TranscriptAnnotation ta, string ret) { ret += _hgvsNotation.ReferenceAbbreviation + _hgvsNotation.Start + _hgvsNotation.AlternateAbbreviation; if (_hgvsNotation.AlternateAbbreviation != "Ter") { // not immediate stop - count aa until next var translatedCds = GetTranslatedCodingSequence(ta); var numExtraAminoAcids = GetNumAminoAcidsUntilStopCodon(translatedCds, _hgvsNotation.Start - 1, true); if (numExtraAminoAcids == -1) { // new - ? to show new stop not predicted ret += "fsTer?"; } else { // use long form if new stop found ret += "fsTer" + numExtraAminoAcids; } } return(ret); }
/// <summary> /// gets the reference and alternative amino acids [TranscriptVariationAllele.pm:1204 _get_hgvs_peptides] /// </summary> private void GetHgvsPeptides(TranscriptAnnotation ta) { // frameshifts if (_hgvsNotation.Type == ProteinChange.Frameshift) { // original alt/ref peptides are not the same as HGVS alt/ref - look up seperately GetFrameshiftPeptides(ta); if (_hgvsNotation == null) { return; } } else if (_hgvsNotation.Type == ProteinChange.Insertion) { AminoAcids.Rotate3Prime(_hgvsNotation, _transcript.Translation.PeptideSeq); // check that inserted bases do not duplicate 3' reference sequence [set to type = dup and return if so] if (IsAminoAcidDuplicate(_hgvsNotation, _transcript.Translation.PeptideSeq)) { return; } // HGVS ref are peptides flanking insertion var min = Math.Min(_hgvsNotation.Start, _hgvsNotation.End); // the peptide positions start from 1. In case of insertions, the end might become 0,i.e., inserted before protein if (min == 0) { _hgvsNotation.Type = ProteinChange.None; return; } _hgvsNotation.SetReferenceAminoAcids(GetSurroundingPeptides(min)); } else if (_hgvsNotation.Type == ProteinChange.Deletion) { AminoAcids.Rotate3Prime(_hgvsNotation, _transcript.Translation.PeptideSeq); } // set the three-letter abbreviations if (_hgvsNotation.ReferenceAminoAcidsLen > 0) { _hgvsNotation.ReferenceAbbreviation = _aminoAcids.GetAbbreviations(_hgvsNotation.ReferenceAminoAcids); } _hgvsNotation.AlternateAbbreviation = _hgvsNotation.AlternateAminoAcidsLen == 0 ? "del" : _aminoAcids.GetAbbreviations(_hgvsNotation.AlternateAminoAcids); // handle special cases if (_variantEffect.IsStartLost()) { // handle initiator loss - probably no translation => alt allele is '?' _hgvsNotation.AlternateAbbreviation = "?"; _hgvsNotation.Type = ProteinChange.Unknown; } else if (_hgvsNotation.Type == ProteinChange.Deletion) { _hgvsNotation.AlternateAbbreviation = "del"; } else if (_hgvsNotation.Type == ProteinChange.Frameshift) { // only quote first ref peptide for frameshift if (_hgvsNotation.ReferenceAbbreviation != null) { _hgvsNotation.ReferenceAbbreviation = _hgvsNotation.ReferenceAbbreviation.FirstAminoAcid3(); } } }