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

search for drugs with rna components didn't work

parent 33056d70
......@@ -3,6 +3,8 @@ minerva (13.1.1) stable; urgency=medium
* Bug fix: "Terms of Use" change to "Terms of Service" in all places (#843)
* Bug fix: upgrade to 13.1.0 crashed on machines where every element was
inside compartment (#856)
* Bug fix: searching for some drugs in chembl didn't provide any results even
though that data exists, for instance 'DORLIMOMAB ARITOX' (#842)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 28 Jun 2019 17:00:00 +0200
......
......@@ -256,12 +256,15 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
MiriamData result = null;
Node uniprotAccessionId = XmlParser.getNode("accession", targetComponent.getChildNodes());
if (uniprotAccessionId != null) {
try {
result = uniprotAnnotator
.uniProtToHgnc(new MiriamData(MiriamType.UNIPROT, uniprotAccessionId.getTextContent()));
result.setAnnotator(null);
} catch (UniprotSearchException e) {
throw new DrugSearchException(e);
String uniprotId = uniprotAccessionId.getTextContent();
if (uniprotId != null && !uniprotId.isEmpty()) {
try {
result = uniprotAnnotator
.uniProtToHgnc(new MiriamData(MiriamType.UNIPROT, uniprotId));
result.setAnnotator(null);
} catch (UniprotSearchException e) {
throw new DrugSearchException(e);
}
}
}
return result;
......
......@@ -273,6 +273,19 @@ public class ChEMBLParserTest extends AnnotationTestFunctions {
}
@Test
public void testGetTargetWithRnaComponent() throws Exception {
try {
Target test = chemblParser.getTargetFromId(new MiriamData(MiriamType.CHEMBL_TARGET, "CHEMBL2363135"));
assertEquals(test.getSource().getResource(), "CHEMBL2363135");
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
@Test
public void testGetTargetFromInvalidId() throws Exception {
try {
......
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