HGVS - Update to skip first codon if it's a frameshift, and the AA is M but the first codon is not ATG
@@ -872,21 +872,42 @@ public class HgvsProteinCalculator {
}
String hgvsString;
-
int phaseOffset = 0;
int currentAaIndex = 0;
+
StringBuilder alternateProteinSeq = new StringBuilder();
+ String alternateCdnaSeq = transcriptUtils.getAlternateCdnaSequence(variant);
+ if (alternateCdnaSeq == null) {
+ return null;
+ }
+ int codonIndex = transcript.getCdnaCodingStart() + phaseOffset - 1;
if (transcriptUtils.hasUnconfirmedStart()) {
phaseOffset = transcriptUtils.getFirstCodonPhase();
+ codonIndex += phaseOffset;
+
// if reference protein sequence start with X, prepend X to our new alternate sequence also
if (transcript.getProteinSequence().startsWith(HgvsCalculator.UNKNOWN_AMINOACID)) {
alternateProteinSeq.append("X");
currentAaIndex++;
}
+ } else if (transcript.getProteinSequence().startsWith("M") && !"ATG".equals(alternateCdnaSeq.substring(transcript.getCdnaCodingStart(), 3))) {
+
+ /*
+ First codon is NOT ATG but protein sequence starts with M. This is due to Ensembl curation. From Ensembl:
+ "We have some information about non-ATG start codons in our blog post from release 102:
+ https://www.ensembl.info/2020/11/30/ensembl-102-has-been-released/
+ Quite simply, there is not a rule. This is a situation of exceptional biology which we are only able to annotate correctly
+ because of our expert manual gene annotators analysing the data in detail."
+ Only relevant for frameshifts, and transcripts with confirmed starts.
+ */
+ // fast forward past first
+ alternateProteinSeq.append("M");
+ currentAaIndex++;
+ codonIndex += 3;
}
- int codonIndex = transcript.getCdnaCodingStart() + phaseOffset - 1;
+
int firstDiffIndex = -1;
String firstReferencedAa = "";
String firstAlternateAa = "";
