Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
minerva
core
Commits
19e27c2d
Commit
19e27c2d
authored
Oct 24, 2016
by
Piotr Gawron
Browse files
fix on chembl api connector (new chembl api)
parent
243751d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
annotation/src/main/java/lcsb/mapviewer/annotation/services/ChEMBLParser.java
View file @
19e27c2d
...
...
@@ -68,7 +68,8 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
/**
* Url that list of all child nodes for chembl ontology term.
*/
private
static
final
String
PARENT_CHILD_API_URL
=
"https://www.ebi.ac.uk/chembl/api/data/molecule_form?parent="
;
private
static
final
String
PARENT_CHILD_API_URL
=
"https://www.ebi.ac.uk/chembl/api/data/molecule_form/"
;
private
static
final
String
PARENT_CHILD_API_URL_SUFFIX
=
".xml"
;
/**
* Url used for finding targets containing uniprot identifiers. Important -
...
...
@@ -420,7 +421,7 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
List
<
Target
>
targets
=
new
ArrayList
<>();
try
{
String
id
=
drugId
.
getResource
();
String
query
=
PARENT_CHILD_API_URL
+
id
;
String
query
=
PARENT_CHILD_API_URL
+
id
+
PARENT_CHILD_API_URL_SUFFIX
;
String
page
=
getWebPageContent
(
query
);
Document
document
=
super
.
getXmlDocumentFromString
(
page
);
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/ChEMBLParserTest.java
View file @
19e27c2d
...
...
@@ -213,11 +213,11 @@ public class ChEMBLParserTest extends AnnotationTestFunctions {
@Test
public
void
test9FindDrug
()
throws
Exception
{
try
{
String
n
=
"PONATINIB"
;
Drug
test
=
chemblParser
.
findDrug
(
n
);
String
n
ame
=
"PONATINIB"
;
Drug
test
=
chemblParser
.
findDrug
(
n
ame
);
assertEquals
(
"CHEMBL1171837"
,
test
.
getSources
().
get
(
0
).
getResource
());
assertEquals
(
"PONATINIB"
,
test
.
getName
());
assertEquals
(
name
,
test
.
getName
());
assertNull
(
test
.
getDescription
());
assertEquals
(
3
,
test
.
getTargets
().
size
());
}
catch
(
Exception
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment