Commit b379b2c0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

remove prefix from hgnc symbol

parent de66946a
Pipeline #27525 passed with stage
in 12 minutes and 35 seconds
minerva (14.0.13) stable; urgency=medium
* Bug fix: chrome modified default css and service looked ugly in chrome
(#1260)
* Bug fix: uploaded HGNC identifiers that looks like "HGNC:HGNC:1234" are
changed to "HGNC:1234" (#1252)
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 3 Jun 2020 17:00:00 +0200
......
......@@ -177,6 +177,11 @@ public class MiriamData implements Comparable<MiriamData>, Serializable {
this.resource = null;
} else {
this.resource = resource.replace("%3A", ":");
if (this.dataType == MiriamType.HGNC && this.resource.toLowerCase().startsWith("hgnc:")) {
String newResource = this.resource.substring(5);
logger.debug("hgnc identifier: \"" + this.resource + "\" is changed to: \"" + newResource + "\"");
this.resource = newResource;
}
}
}
......
......@@ -79,4 +79,11 @@ public class MiriamDataTest extends ModelTestFunctions {
md2.setAnnotator(Integer.class);
assertTrue(md1.compareTo(md2) == 0);
}
@Test
public void testHgncIdWithPrefix() {
assertEquals(new MiriamData(MiriamType.HGNC,"1234"), new MiriamData(MiriamType.HGNC,"HGNC:1234"));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment