diff --git a/cellbase-app/pom.xml b/cellbase-app/pom.xml
index ade62138f5..3d95e0b09e 100644
--- a/cellbase-app/pom.xml
+++ b/cellbase-app/pom.xml
@@ -6,7 +6,7 @@
org.opencb.cellbase
cellbase
- 4.12.6
+ 4.12.7
../pom.xml
diff --git a/cellbase-client/pom.xml b/cellbase-client/pom.xml
index 6adb767a33..817870d588 100644
--- a/cellbase-client/pom.xml
+++ b/cellbase-client/pom.xml
@@ -6,7 +6,7 @@
org.opencb.cellbase
cellbase
- 4.12.6
+ 4.12.7
../pom.xml
diff --git a/cellbase-core/pom.xml b/cellbase-core/pom.xml
index bd7acfad54..2fc5c47bba 100644
--- a/cellbase-core/pom.xml
+++ b/cellbase-core/pom.xml
@@ -6,7 +6,7 @@
org.opencb.cellbase
cellbase
- 4.12.6
+ 4.12.7
../pom.xml
diff --git a/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationCalculator.java b/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationCalculator.java
index 4bac571215..88b7853f60 100644
--- a/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationCalculator.java
+++ b/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationCalculator.java
@@ -671,11 +671,14 @@ private void adjustPhasedConsequenceTypes(Object[] variantArray) {
// negative strand
if ("-".equals(consequenceType1.getStrand())) {
- alternateCodon = "" + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant2.getAlternate().toUpperCase().toCharArray()[0])
- + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant1.getAlternate().toUpperCase().toCharArray()[0])
- + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant0.getAlternate().toUpperCase().toCharArray()[0]);
+ alternateCodon = ""
+ + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant2.getAlternate().toUpperCase().toCharArray()[0])
+ + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant1.getAlternate().toUpperCase().toCharArray()[0])
+ + VariantAnnotationUtils.COMPLEMENTARY_NT.get(variant0.getAlternate().toUpperCase().toCharArray()[0]);
} else {
- alternateCodon = variant0.getAlternate().toUpperCase() + variant1.getAlternate().toUpperCase() + variant2.getAlternate().toUpperCase();
+ alternateCodon = variant0.getAlternate().toUpperCase()
+ + variant1.getAlternate().toUpperCase()
+ + variant2.getAlternate().toUpperCase();
}
diff --git a/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationUtils.java b/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationUtils.java
index 383d122ba5..367a6635c7 100644
--- a/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationUtils.java
+++ b/cellbase-core/src/main/java/org/opencb/cellbase/core/variant/annotation/VariantAnnotationUtils.java
@@ -667,7 +667,12 @@ public static VariantType getVariantType(Variant variant) throws UnsupportedURLV
// FIXME: remove the if block below as soon as the Variant.inferType method is able to differentiate between
// FIXME: insertions and deletions
// if (variant.getType().equals(VariantType.INDEL) || variant.getType().equals(VariantType.SV)) {
- if (variant.getType().equals(VariantType.INDEL)) {
+ if (variant.getType().equals(VariantType.INDEL)
+ || (variant.getType().equals(VariantType.SV)
+ && !variant.isSymbolic()
+ && variant.getReference().length() <= MAX_MNV_THRESHOLD
+ && variant.getAlternate().length() <= MAX_MNV_THRESHOLD)
+ ) {
if (variant.getReference().isEmpty()) {
// variant.setType(VariantType.INSERTION);
return VariantType.INSERTION;
@@ -677,15 +682,6 @@ public static VariantType getVariantType(Variant variant) throws UnsupportedURLV
} else {
return VariantType.MNV;
}
- } else if (!variant.isSymbolic() && (variant.getReference().length() > 1 || variant.getAlternate().length() > 1)
- &&
- (!variant.getReference().startsWith(variant.getAlternate()) && !variant.getAlternate().startsWith(variant.getReference()))
- ) {
- if (variant.getReference().length() <= MAX_MNV_THRESHOLD && variant.getAlternate().length() <= MAX_MNV_THRESHOLD) {
- return VariantType.MNV;
- } else {
- logger.warn("Provided alleles for variant are too long to be considered an MNV: %s", variant);
- }
}
return variant.getType();
// return getVariantType(variant.getReferenceStart(), variant.getAlternate());
diff --git a/cellbase-core/src/test/java/org/opencb/cellbase/core/variant/VariantAnnotationUtilsTest.java b/cellbase-core/src/test/java/org/opencb/cellbase/core/variant/VariantAnnotationUtilsTest.java
new file mode 100644
index 0000000000..2014a24038
--- /dev/null
+++ b/cellbase-core/src/test/java/org/opencb/cellbase/core/variant/VariantAnnotationUtilsTest.java
@@ -0,0 +1,42 @@
+package org.opencb.cellbase.core.variant;
+
+import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.opencb.biodata.models.variant.Variant;
+import org.opencb.biodata.models.variant.avro.VariantType;
+import org.opencb.cellbase.core.variant.annotation.VariantAnnotationUtils;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import static org.junit.Assert.assertEquals;
+
+@RunWith(Enclosed.class)
+public class VariantAnnotationUtilsTest {
+ @RunWith(Parameterized.class)
+ public static class GetVariantAnnotationTest {
+ private String variant;
+ private VariantType expectedVariantType;
+ public GetVariantAnnotationTest(String variant, VariantType expectedVariantType){
+ this.variant = variant;
+ this.expectedVariantType = expectedVariantType;
+ }
+ @Test
+ public void test() {
+ assertEquals(VariantAnnotationUtils.getVariantType(new Variant(variant)), expectedVariantType);
+ }
+ @Parameterized.Parameters
+ public static Collection