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

Merge branch '1377-chembl-target-without-gene-name' into 'devel_15.1.x'

uniprot withough gene name caused issues

See merge request !1256
parents 40685204 51734250
Pipeline #34557 failed with stage
in 23 minutes and 38 seconds
......@@ -5,6 +5,8 @@ minerva (15.1.1) stable; urgency=medium
opened (#1338)
* Bug fix: API call returning list of overlays returned for non existing
project returned access denied status insted Not Found (#1370)
* Bug fix: results for chembl targetting uniprot without gene name (for
example P0C2L1) could crash caching (#1377)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 23 Nov 2020 15:00:00 +0200
......
......@@ -217,7 +217,7 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
* @throws DrugSearchException
* thrown when there is a problem with annotations
*/
private MiriamData targetComponentToMiriamData(Node targetComponent) throws DrugSearchException {
MiriamData targetComponentToMiriamData(Node targetComponent) throws DrugSearchException {
MiriamData result = null;
Node uniprotAccessionId = XmlParser.getNode("accession", targetComponent.getChildNodes());
if (uniprotAccessionId != null) {
......@@ -226,7 +226,9 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
try {
result = uniprotAnnotator
.uniProtToHgnc(new MiriamData(MiriamType.UNIPROT, uniprotId));
result.setAnnotator(null);
if (result != null) {
result.setAnnotator(null);
}
} catch (UniprotSearchException e) {
throw new DrugSearchException(e);
}
......
......@@ -864,4 +864,12 @@ public class ChEMBLParserTest extends AnnotationTestFunctions {
assertNotNull(parser.findDrug("CABOZANTINIB"));
}
@Test
public void testTargetComponentToMiriamDataForNonHgncUniprotId() throws Exception {
ChEMBLParser parser = Mockito.spy(chemblParser);
Node node = getNodeFromXmlString("<xml><accession>P0C2L1</accession></xml>");
MiriamData result = parser.targetComponentToMiriamData(node);
assertNull(result);
}
}
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