use complement for negative strand, allows MNVs to calculate consequence types correctly when phased
@@ -816,8 +816,14 @@ public class VariantAnnotationCalculator {
if (consequenceType3 != null) {
String referenceCodon = consequenceType1.getCodon().split("/")[0].toUpperCase();
// WARNING: assumes variants are sorted according to their coordinates
- String alternateCodon = variant0.getAlternate() + variant1.getAlternate()
- + variant2.getAlternate();
+ String alternateCodon = null;
+ if ("-".equals(variant0.getStrand())) {
+ alternateCodon = "" + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant2.getAlternate())
+ + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant1.getAlternate())
+ + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant0.getAlternate());
+ } else {
+ alternateCodon = variant0.getAlternate() + variant1.getAlternate() + variant2.getAlternate();
+ }
codon = referenceCodon + "/" + alternateCodon;
alternateAA = VariantAnnotationUtils.CODON_TO_A.get(alternateCodon);
soTerms = updatePhasedSoTerms(consequenceType1.getSequenceOntologyTerms(),
@@ -849,8 +855,16 @@ public class VariantAnnotationCalculator {
referenceCodonArray[codonIdx1] = Character.toUpperCase(referenceCodonArray[codonIdx1]);
referenceCodonArray[codonIdx2] = Character.toUpperCase(referenceCodonArray[codonIdx2]);
char[] alternateCodonArray = referenceCodonArray.clone();
+ // negative strand
+ if ("-".equals(variant0.getStrand())) {
+ alternateCodonArray[codonIdx1] =
+ VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant0.getAlternate().toUpperCase().toCharArray()[0]);
+ alternateCodonArray[codonIdx2] =
+ VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant1.getAlternate().toUpperCase().toCharArray()[0]);
+ } else {
alternateCodonArray[codonIdx1] = variant0.getAlternate().toUpperCase().toCharArray()[0];
alternateCodonArray[codonIdx2] = variant1.getAlternate().toUpperCase().toCharArray()[0];
+ }
codon = String.valueOf(referenceCodonArray) + "/" + String.valueOf(alternateCodonArray);
alternateAA = VariantAnnotationUtils.CODON_TO_A.get(String.valueOf(alternateCodonArray).toUpperCase());
