Skip to content
Snippets Groups Projects
Commit 47bacc4e authored by Piotr Gawron's avatar Piotr Gawron
Browse files

bugfix when drug is targetting more than once single protein

it could happen when the drug is markerd to target the protein and
protein being a part of some complex
parent 9b8dfe6b
No related branches found
No related tags found
1 merge request!98Resolve "doubled results when searching for dugs"
......@@ -131,6 +131,7 @@ AbstractTargettingDbOverlay.prototype.getDetailDataByIdentifiedElement = functio
});
} else {
return new Promise(function(resolve) {
var drugNames = [];
var result = [];
var queries = self.getQueries();
for (var i = 0; i < queries.length; i++) {
......@@ -144,8 +145,9 @@ AbstractTargettingDbOverlay.prototype.getDetailDataByIdentifiedElement = functio
for (var k = 0; k < targets.length; k++) {
var elements = targets[k].getTargetElements();
for (var l = 0; l < elements.length; l++) {
if (element.equals(elements[l])) {
if (element.equals(elements[l]) && drugNames[drug.getName()] === undefined) {
result.push(drug);
drugNames[drug.getName()] = true;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment