Closed egonw closed 7 months ago
Created the requested test class, however it results in a failure. Test class:
Xref xref = Xref.fromBioregistryIdentifier("ensembl:ENSGALG00000007562");
assertEquals("En:ENSGALG00000007562:T", xref.toString());
Test failure message:
Failures (1): JUnit Jupiter:XrefTest:testCheckCorrectBioregistryIdentifier() MethodSource [className = 'org.bridgedb.XrefTest', methodName = 'testCheckCorrectBioregistryIdentifier', methodParameterTypes = ''] => java.lang.NullPointerException: Cannot invoke "org.bridgedb.Xref.toString()" because "xref" is null org.bridgedb.XrefTest.testCheckCorrectBioregistryIdentifier(XrefTest.java:205) java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) java.base/java.lang.reflect.Method.invoke(Method.java:580) org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727) org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60) org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131) org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156) org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147) org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86) org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103) [...]
Created a test using a different identifier to check syntax, this results in a succesful test:
Xref xref = Xref.fromBioregistryIdentifier("uniprot:P12345");
assertEquals("S:P12345:T", xref.toString());
Found out the "ENSGALG00000007562" identifier is marked as " not in the current EnsEMBL database" on the ensembl website, maybe this has something to do with the issue?
Did not mean to close the issue since it is not fixed.
Created the requested test class, however it results in a failure. Test class:
Xref xref = Xref.fromBioregistryIdentifier("ensembl:ENSGALG00000007562"); assertEquals("En:ENSGALG00000007562:T", xref.toString());
I guess a assertNutNoll(xref)
should be added between these too lines.
Created a test using a different identifier to check syntax, this results in a succesful test:
Xref xref = Xref.fromBioregistryIdentifier("uniprot:P12345"); assertEquals("S:P12345:T", xref.toString());
Yes, this is what you would expect also for the failing code. But that fail is enough for the test.
Found out the "ENSGALG00000007562" identifier is marked as " not in the current EnsEMBL database"
The method does not check that, actually, so that cannot be the reason.
Fixed
When I create a
Xref
from the compact identifierensembl:ENSGALG00000007562
then it creates anXref
with theDataSource
for OpenTargets with the system codeOpt
. OpenTargets uses the same Ensembl identifiers so it sort of makes sense, but it's not good.We see this when we do the
Xref.toString()
and getOpt:ENSGALG00000007562:T
where it should returnEn:ENSGALG00000007562:T
.@youphendriks, can you please create a unit test in the class a new test class
XrefTest
in theorg.bridgedb.bio
java package in theorg.bridgedb.bio
module (whereDataSourceTxtTest.java
is too)?The test should check if
Xref.fromBioregistryIdentifier("ensembl:ENSGALG00000007562").toString()
equalsEn:ENSGALG00000007562:T
.