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
f6e94c4f
Commit
f6e94c4f
authored
Nov 13, 2017
by
Piotr Gawron
Browse files
chembl provide taxonomy id - we don't need to translate name to id
parent
3e814ee6
Pipeline
#2583
passed with stage
in 43 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
annotation/src/main/java/lcsb/mapviewer/annotation/services/ChEMBLParser.java
View file @
f6e94c4f
...
...
@@ -170,8 +170,14 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
Node
node
=
list
.
item
(
i
);
if
(
node
.
getNodeType
()
==
Node
.
ELEMENT_NODE
)
{
if
(
node
.
getNodeName
().
equalsIgnoreCase
(
"organism"
))
{
// node with information abou organism
target
.
setOrganism
(
getTaxonomyBackend
().
getByName
(
node
.
getTextContent
()));
// nothing to do here, we use taxonomy id
}
else
if
(
node
.
getNodeName
().
equalsIgnoreCase
(
"tax_id"
))
{
String
value
=
node
.
getTextContent
();
MiriamData
taxonomy
=
new
MiriamData
(
MiriamType
.
TAXONOMY
,
value
);
String
organismName
=
getTaxonomyBackend
().
getNameForTaxonomy
(
taxonomy
);
if
(
organismName
!=
null
)
{
target
.
setOrganism
(
taxonomy
);
}
}
else
if
(
node
.
getNodeName
().
equalsIgnoreCase
(
"pref_name"
))
{
// node with information about name
target
.
setName
(
node
.
getTextContent
());
...
...
@@ -210,7 +216,7 @@ public class ChEMBLParser extends DrugAnnotation implements IExternalService {
// nothing to do here
continue
;
}
else
{
logger
.
warn
(
"Unknown node: "
+
node
.
getNodeName
());
logger
.
warn
(
"Unknown node: "
+
node
.
getNodeName
()
+
";"
+
node
.
getTextContent
()
);
}
}
}
...
...
annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomyBackend.java
View file @
f6e94c4f
...
...
@@ -167,7 +167,7 @@ public class TaxonomyBackend extends CachableInterface implements IExternalServi
* object representing taxonomy id
* @return name for given taxonomy id
* @throws TaxonomySearchException
* thrown when there is a problem with accessing external
da
databse
* thrown when there is a problem with accessing external datab
a
se
*/
public
String
getNameForTaxonomy
(
MiriamData
miriamData
)
throws
TaxonomySearchException
{
if
(
miriamData
==
null
)
{
...
...
annotation/src/test/java/lcsb/mapviewer/annotation/services/ChEMBLParserTest.java
View file @
f6e94c4f
This diff is collapsed.
Click to expand it.
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