Commit 9f5b78b7 authored by Piotr Gawron's avatar Piotr Gawron

Merge branch '66-mirna-target-interface-entrez-vs-gene-name-link' into 'master'

Resolve "miRNA target interface: Entrez vs Gene name link"

Closes #66

See merge request !816
parents 0f328b00 c87802f1
Pipeline #10685 passed with stage
in 9 minutes and 27 seconds
......@@ -10,6 +10,8 @@ minerva (14.0.0~alpha.0) unstable; urgency=low
* Small improvement: when removing overlay in admin panel there is a
confirmation dialog (#696)
* Small improvement: overlay name is obligatory (#698)
* Small improvement: target gene in search panel contains also information
about type of database that identifies the target (#66)
* Bug fix: export to CellDesigner of reaction with two modifiers connected
with boolean operator resulted was skipping some layout information
* Bug fix: reaction in SBGNML file containing two products was improperly
......@@ -18,6 +20,8 @@ minerva (14.0.0~alpha.0) unstable; urgency=low
inside boolean gateway
* Bug fix: CellDesigner file exported from minerva was not fully compliant
with SBML standard (#831)
* Bug fix: MiRNA targets are limited only to the organism associated with the
map (#66)
-- Sascha Herzinger <sascha.herzinger@uni.lu> Wed, 22 May 2019 10:30:00 +0200
......
......@@ -426,7 +426,7 @@ AbstractDbPanel.prototype.createTargetRow = function (target, icon) {
descColumn.appendChild(guiUtils.createAnnotations({
label: "Elements: ",
annotations: target.getTargetParticipants(),
showType: false,
showType: true,
inline: true,
groupAnnotations: false
}));
......
......@@ -371,13 +371,6 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
Object.keys(grouppedAnnotations).sort().forEach(function (annotatorClass) {
var groupContainer = createGroupContainer(inline, annotatorClass, annotatorsClassMapping, groupAnnotations);
var par;
if (inline) {
par = document.createElement("span");
par.innerHTML = "(";
groupContainer.appendChild(par);
}
grouppedAnnotations[annotatorClass] = grouppedAnnotations[annotatorClass].sort(function (a, b) {
var aType = a.getType().toUpperCase();
var bType = b.getType().toUpperCase();
......@@ -424,12 +417,6 @@ GuiUtils.prototype.createAnnotationList = function (annotations, options) {
}
}
if (inline) {
par = document.createElement("span");
par.innerHTML = ")";
groupContainer.appendChild(par);
}
result.appendChild(groupContainer);
});
......
......@@ -7,7 +7,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.logging.log4j.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -71,6 +72,7 @@ public class MiRNAService extends DbSearchService implements IMiRNAService {
names.add(name);
List<MiRNA> miRNAs = miRNAParser.getMiRnasByNames(names);
if (miRNAs.size() > 0) {
removeUnknownOrganisms(miRNAs.get(0), searchCriteria.getOrganisms());
return miRNAs.get(0);
}
return null;
......@@ -117,8 +119,8 @@ public class MiRNAService extends DbSearchService implements IMiRNAService {
logger.error("Problem with accessing mirna database", e);
}
for (MiRNA drug : mirnaList) {
removeUnknownOrganisms(drug, searchCriteria.getOrganisms());
for (MiRNA mirna : mirnaList) {
removeUnknownOrganisms(mirna, searchCriteria.getOrganisms());
}
Collections.sort(mirnaList, new MiRNA.NameComparator());
......@@ -128,15 +130,15 @@ public class MiRNAService extends DbSearchService implements IMiRNAService {
/**
* Removes targets for unknown organisms from the mirna.
*
* @param drug
* drug from which we want to remove targets
* @param mirna
* mirna from which we want to remove targets
* @param organisms
* organisms that should be kept
*/
private void removeUnknownOrganisms(MiRNA drug, List<MiriamData> organisms) {
private void removeUnknownOrganisms(MiRNA mirna, List<MiriamData> organisms) {
if (organisms.size() > 0) {
List<Target> toRemove = new ArrayList<Target>();
for (Target target : drug.getTargets()) {
for (Target target : mirna.getTargets()) {
boolean remove = true;
for (MiriamData organism : organisms) {
if (target.getOrganism() == null) {
......@@ -151,7 +153,7 @@ public class MiRNAService extends DbSearchService implements IMiRNAService {
toRemove.add(target);
}
}
drug.getTargets().removeAll(toRemove);
mirna.getTargets().removeAll(toRemove);
}
}
......
package lcsb.mapviewer.services.search.mirna;
import org.apache.logging.log4j.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import lcsb.mapviewer.annotation.data.MiRNA;
import lcsb.mapviewer.annotation.data.Target;
import lcsb.mapviewer.annotation.services.TaxonomyBackend;
import lcsb.mapviewer.common.IProgressUpdater;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelFullIndexed;
import lcsb.mapviewer.services.ServiceTestFunctions;
import lcsb.mapviewer.services.search.mirna.IMiRNAService;
import lcsb.mapviewer.services.search.DbSearchCriteria;
public class MiRNAServiceTest extends ServiceTestFunctions {
Logger logger = LogManager.getLogger(MiRNAServiceTest.class);
......@@ -45,4 +54,22 @@ public class MiRNAServiceTest extends ServiceTestFunctions {
}
}
@Test
public void testFindMiRNAFilteredByOrganism() throws Exception {
try {
MiRNA test = miRNAService.getByName("hsa-miR-29a-3p",
new DbSearchCriteria().organisms(TaxonomyBackend.HUMAN_TAXONOMY));
assertNotNull(test);
for (Target t : test.getTargets()) {
for (MiriamData md : t.getGenes()) {
assertEquals("Only hgnc symbols should be used for gene annotations", MiriamType.HGNC_SYMBOL,
md.getDataType());
}
}
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
}
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