AltAminoAcids, string RefCodons, string AltCodons, string TranscriptAltAllele) AnnotateTranscript(ITranscript transcript, ISimpleVariant variant, AminoAcids aminoAcids, ISequence refSequence) { var onReverseStrand = transcript.Gene.OnReverseStrand; var start = MappedPositionUtilities.FindRegion(transcript.TranscriptRegions, variant.Start); var end = MappedPositionUtilities.FindRegion(transcript.TranscriptRegions, variant.End); var position = GetMappedPosition(transcript.TranscriptRegions, start.Region, start.Index, end.Region, end.Index, variant, onReverseStrand, transcript.Translation?.CodingRegion, transcript.StartExonPhase, variant.Type == VariantType.insertion); var transcriptAltAllele = HgvsUtilities.GetTranscriptAllele(variant.AltAllele, onReverseStrand); var codingSequence = GetCodingSequence(transcript, refSequence); var codons = Codons.GetCodons(transcriptAltAllele, position.CdsStart, position.CdsEnd, position.ProteinStart, position.ProteinEnd, codingSequence); var coveredCdna = transcript.TranscriptRegions.GetCoveredCdnaPositions(position.CdnaStart, start.Index, position.CdnaEnd, end.Index, onReverseStrand); var aa = aminoAcids.Translate(codons.Reference, codons.Alternate); var coveredPositions = MappedPositionUtilities.GetCoveredCdsAndProteinPositions(coveredCdna.Start, coveredCdna.End, transcript.StartExonPhase, transcript.Translation?.CodingRegion); // only generate the covered version of ref & alt alleles when CDS start/end is -1 var coveredAa = position.CdsStart == -1 || position.CdsEnd == -1 ? GetCoveredAa(aminoAcids, transcriptAltAllele, coveredPositions, codingSequence) : aa; var positionalEffect = GetPositionalEffect(transcript, variant, position, aa.Reference, aa.Alternate, coveredCdna.Start, coveredCdna.End, coveredPositions.CdsStart, coveredPositions.CdsEnd); var variantEffect = new VariantEffect(positionalEffect, variant, transcript, aa.Reference, aa.Alternate, codons.Reference, codons.Alternate, position.ProteinStart, coveredAa.Reference, coveredAa.Alternate); return(variantEffect, position, aa.Reference, aa.Alternate, codons.Reference, codons.Alternate, transcriptAltAllele); }