From 29aeebab2f2ace12d0371d44dabaf5a2b7eef6fb Mon Sep 17 00:00:00 2001 From: jmedinaebi Date: Tue, 3 Sep 2024 13:00:09 +0100 Subject: [PATCH 1/4] Add xrefs to interactors --- complex-go-export/pom.xml | 2 +- complex-pdb-export/pom.xml | 2 +- complex-tab-export/pom.xml | 2 +- complex-uniprot-dr-export/pom.xml | 2 +- cttv-exporter/pom.xml | 2 +- imex-id-update/pom.xml | 2 +- intact-cvutils/pom.xml | 2 +- intact-db-importer/pom.xml | 2 +- intact-enricher/pom.xml | 2 +- intact-mi-cluster-score/pom.xml | 2 +- intact-mutation-export/pom.xml | 2 +- intact-pdbe-import/pom.xml | 2 +- intact-tasks/pom.xml | 2 +- intact-uniprot-export/pom.xml | 2 +- pom.xml | 2 +- psimi/intact-psimi-exporter/pom.xml | 2 +- psimi/pom.xml | 2 +- .../intact-calimocho-converters/pom.xml | 2 +- psimi/psimitab/intact-jami-mitab/pom.xml | 2 +- .../intact-psimitab-converters/pom.xml | 2 +- psimi/psimitab/intact-solr-home/pom.xml | 2 +- psimi/psimitab/intact-solr/pom.xml | 2 +- .../psimi/solr/complex/ComplexInteractor.java | 15 ++++- .../solr/complex/ComplexInteractorXref.java | 66 +++++++++++++++++++ .../solr/enricher/ComplexSolrEnricher.java | 13 +++- .../psimi/solr/util/ComplexUtils.java | 4 ++ psimi/psimitab/pom.xml | 2 +- psimi/psixml/intact-jami-xml/pom.xml | 2 +- psimi/psixml/intact-psixml-converters/pom.xml | 2 +- psimi/psixml/intact-psixml-dbimporter/pom.xml | 2 +- psimi/psixml/intact-psixml-exchange/pom.xml | 2 +- psimi/psixml/pom.xml | 2 +- structured-abstract/pom.xml | 2 +- 33 files changed, 125 insertions(+), 31 deletions(-) create mode 100644 psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractorXref.java diff --git a/complex-go-export/pom.xml b/complex-go-export/pom.xml index 3b8d6eec4..ee2287dce 100644 --- a/complex-go-export/pom.xml +++ b/complex-go-export/pom.xml @@ -5,7 +5,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT complex-go-export diff --git a/complex-pdb-export/pom.xml b/complex-pdb-export/pom.xml index 0ee01f1c7..d016a72e8 100644 --- a/complex-pdb-export/pom.xml +++ b/complex-pdb-export/pom.xml @@ -5,7 +5,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT complex-pdb-export diff --git a/complex-tab-export/pom.xml b/complex-tab-export/pom.xml index d8045b4fa..177f8e586 100644 --- a/complex-tab-export/pom.xml +++ b/complex-tab-export/pom.xml @@ -5,7 +5,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT diff --git a/complex-uniprot-dr-export/pom.xml b/complex-uniprot-dr-export/pom.xml index 0a3f660ab..2f856cc92 100644 --- a/complex-uniprot-dr-export/pom.xml +++ b/complex-uniprot-dr-export/pom.xml @@ -5,7 +5,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT complex-uniprot-dr-export diff --git a/cttv-exporter/pom.xml b/cttv-exporter/pom.xml index 269d6861d..79324b587 100644 --- a/cttv-exporter/pom.xml +++ b/cttv-exporter/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/imex-id-update/pom.xml b/imex-id-update/pom.xml index bf2ab507d..db7459438 100755 --- a/imex-id-update/pom.xml +++ b/imex-id-update/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT uk.ac.ebi.intact.dataexchange.imex diff --git a/intact-cvutils/pom.xml b/intact-cvutils/pom.xml index e721bd51e..87f67fce4 100644 --- a/intact-cvutils/pom.xml +++ b/intact-cvutils/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/intact-db-importer/pom.xml b/intact-db-importer/pom.xml index a13cb4d64..c8f39ae26 100644 --- a/intact-db-importer/pom.xml +++ b/intact-db-importer/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-db-importer diff --git a/intact-enricher/pom.xml b/intact-enricher/pom.xml index bce209919..0cb4bfcf3 100644 --- a/intact-enricher/pom.xml +++ b/intact-enricher/pom.xml @@ -4,7 +4,7 @@ intact-dataexchange-master uk.ac.ebi.intact.dataexchange - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/intact-mi-cluster-score/pom.xml b/intact-mi-cluster-score/pom.xml index 97154cd91..d88af8727 100644 --- a/intact-mi-cluster-score/pom.xml +++ b/intact-mi-cluster-score/pom.xml @@ -4,7 +4,7 @@ intact-dataexchange-master uk.ac.ebi.intact.dataexchange - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-mi-cluster-score diff --git a/intact-mutation-export/pom.xml b/intact-mutation-export/pom.xml index 3fbc37c52..4668f9e57 100644 --- a/intact-mutation-export/pom.xml +++ b/intact-mutation-export/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/intact-pdbe-import/pom.xml b/intact-pdbe-import/pom.xml index feab18848..fbf09bcf4 100644 --- a/intact-pdbe-import/pom.xml +++ b/intact-pdbe-import/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/intact-tasks/pom.xml b/intact-tasks/pom.xml index 92ccd0d3a..0634e4a85 100644 --- a/intact-tasks/pom.xml +++ b/intact-tasks/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/intact-uniprot-export/pom.xml b/intact-uniprot-export/pom.xml index 354c75f13..4b8731580 100644 --- a/intact-uniprot-export/pom.xml +++ b/intact-uniprot-export/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index e828ba93c..ef0ec8a0a 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master pom - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT IntAct Data Exchange Data Exchange Master POM diff --git a/psimi/intact-psimi-exporter/pom.xml b/psimi/intact-psimi-exporter/pom.xml index f1f9df9fa..e3ded35b2 100644 --- a/psimi/intact-psimi-exporter/pom.xml +++ b/psimi/intact-psimi-exporter/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange.psimi intact-psimi-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-psimi-exporter diff --git a/psimi/pom.xml b/psimi/pom.xml index 770b76615..5663f78cc 100644 --- a/psimi/pom.xml +++ b/psimi/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psimitab/intact-calimocho-converters/pom.xml b/psimi/psimitab/intact-calimocho-converters/pom.xml index d74f8a9a1..9a10354f5 100644 --- a/psimi/psimitab/intact-calimocho-converters/pom.xml +++ b/psimi/psimitab/intact-calimocho-converters/pom.xml @@ -4,7 +4,7 @@ psimitab-master uk.ac.ebi.intact.dataexchange.psimi - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-calimocho-converters diff --git a/psimi/psimitab/intact-jami-mitab/pom.xml b/psimi/psimitab/intact-jami-mitab/pom.xml index 0f01a89f2..d600dcf50 100644 --- a/psimi/psimitab/intact-jami-mitab/pom.xml +++ b/psimi/psimitab/intact-jami-mitab/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange.psimi psimitab-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-jami-mitab diff --git a/psimi/psimitab/intact-psimitab-converters/pom.xml b/psimi/psimitab/intact-psimitab-converters/pom.xml index 870687f08..639da1468 100755 --- a/psimi/psimitab/intact-psimitab-converters/pom.xml +++ b/psimi/psimitab/intact-psimitab-converters/pom.xml @@ -3,7 +3,7 @@ psimitab-master uk.ac.ebi.intact.dataexchange.psimi - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psimitab/intact-solr-home/pom.xml b/psimi/psimitab/intact-solr-home/pom.xml index 2636ef9e7..70d92f92b 100644 --- a/psimi/psimitab/intact-solr-home/pom.xml +++ b/psimi/psimitab/intact-solr-home/pom.xml @@ -3,7 +3,7 @@ psimitab-master uk.ac.ebi.intact.dataexchange.psimi - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psimitab/intact-solr/pom.xml b/psimi/psimitab/intact-solr/pom.xml index d5cf73368..e5ab81cde 100644 --- a/psimi/psimitab/intact-solr/pom.xml +++ b/psimi/psimitab/intact-solr/pom.xml @@ -6,7 +6,7 @@ psimitab-master uk.ac.ebi.intact.dataexchange.psimi - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractor.java b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractor.java index d2241f99b..18f9658dd 100644 --- a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractor.java +++ b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractor.java @@ -1,5 +1,7 @@ package uk.ac.ebi.intact.dataexchange.psimi.solr.complex; +import java.util.List; + public class ComplexInteractor { /*************************/ @@ -15,7 +17,8 @@ public ComplexInteractor(String identifier, String description, String stochiometry, String interactorType, - String organismName) { + String organismName, + List xrefs) { this.identifier = identifier; this.identifierLink = identifierLink; this.name = name; @@ -23,6 +26,7 @@ public ComplexInteractor(String identifier, this.stochiometry = stochiometry; this.interactorType = interactorType; this.organismName = organismName; + this.xrefs = xrefs; } /*********************************/ @@ -85,6 +89,14 @@ public void setOrganismName(String organismName) { this.organismName = organismName; } + public List getXrefs() { + return xrefs; + } + + public void setXrefs(List xrefs) { + this.xrefs = xrefs; + } + /********************************/ /* Private attributes */ /********************************/ @@ -96,4 +108,5 @@ public void setOrganismName(String organismName) { private String stochiometry = null; private String interactorType; private String organismName; + private List xrefs; } diff --git a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractorXref.java b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractorXref.java new file mode 100644 index 000000000..7df01def6 --- /dev/null +++ b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/complex/ComplexInteractorXref.java @@ -0,0 +1,66 @@ +package uk.ac.ebi.intact.dataexchange.psimi.solr.complex; + +public class ComplexInteractorXref { + + /*************************/ + /* Constructors */ + /*************************/ + + public ComplexInteractorXref() { + } + + public ComplexInteractorXref(String identifier, + String identifierLink, + String database, + String qualifier) { + this.identifier = identifier; + this.identifierLink = identifierLink; + this.database = database; + this.qualifier = qualifier; + } + + /*********************************/ + /* Getters and Setters */ + /*********************************/ + + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(String identifier) { + this.identifier = identifier; + } + + public String getIdentifierLink() { + return identifierLink; + } + + public void setIdentifierLink(String identifierLink) { + this.identifierLink = identifierLink; + } + + public String getDatabase() { + return database; + } + + public void setDatabase(String database) { + this.database = database; + } + + public String getQualifier() { + return qualifier; + } + + public void setQualifier(String qualifier) { + this.qualifier = qualifier; + } + + /********************************/ + /* Private attributes */ + /********************************/ + + private String identifier = null; + private String identifierLink = null; + private String database = null; + private String qualifier = null; +} diff --git a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java index 1a8418617..c0c551653 100644 --- a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java +++ b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java @@ -12,6 +12,7 @@ import uk.ac.ebi.intact.bridges.ontologies.term.OntologyTerm; import uk.ac.ebi.intact.dataexchange.psimi.solr.complex.ComplexFieldNames; import uk.ac.ebi.intact.dataexchange.psimi.solr.complex.ComplexInteractor; +import uk.ac.ebi.intact.dataexchange.psimi.solr.complex.ComplexInteractorXref; import uk.ac.ebi.intact.dataexchange.psimi.solr.ontology.OntologySearcher; import uk.ac.ebi.intact.dataexchange.psimi.solr.util.ComplexUtils; import uk.ac.ebi.intact.model.*; @@ -20,6 +21,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.*; +import java.util.stream.Collectors; /** * Complex Field Enricher is such as Ontoly Field Enricher @@ -202,6 +204,14 @@ public void enrichSerialisedParticipant(Component participant, SolrInputDocument Interactor interactor = participant.getInteractor(); String identifier = ComplexUtils.getParticipantIdentifier(participant); + List xrefs = interactor.getXrefs().stream() + .map(xref -> new ComplexInteractorXref( + xref.getPrimaryId(), + ComplexUtils.getIdentifierLink(xref, xref.getPrimaryId()), + xref.getCvDatabase() != null ? xref.getCvDatabase().getShortLabel() : null, + xref.getCvXrefQualifier() != null ? xref.getCvXrefQualifier().getShortLabel() : null)) + .collect(Collectors.toList()); + ComplexInteractor complexInteractor = new ComplexInteractor( identifier, ComplexUtils.getParticipantIdentifierLink(participant, identifier), @@ -209,7 +219,8 @@ public void enrichSerialisedParticipant(Component participant, SolrInputDocument interactor.getFullName(), ComplexUtils.getParticipantStoichiometry(participant), interactor.getCvInteractorType().getFullName(), - findInteractorOrganismName(interactor)); + findInteractorOrganismName(interactor), + xrefs); String serialisedInteractor = mapper.writeValueAsString(complexInteractor); solrDocument.addField(ComplexFieldNames.SERIALISED_INTERACTION, serialisedInteractor); } diff --git a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/util/ComplexUtils.java b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/util/ComplexUtils.java index aad8cd0ef..0f4bed800 100644 --- a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/util/ComplexUtils.java +++ b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/util/ComplexUtils.java @@ -59,6 +59,10 @@ public static String getParticipantIdentifier(Component participant) { public static String getParticipantIdentifierLink(Component participant, String identifier) { InteractorXref xref = getParticipantIdentifierXref(participant); + return getIdentifierLink(xref, identifier); + } + + public static String getIdentifierLink(InteractorXref xref, String identifier) { if (xref != null && xref.getParent() != null) { Annotation annot = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(xref.getCvDatabase(), SEARCH_MI); if (annot == null) { diff --git a/psimi/psimitab/pom.xml b/psimi/psimitab/pom.xml index d0f4895f1..1c6be957e 100644 --- a/psimi/psimitab/pom.xml +++ b/psimi/psimitab/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange.psimi intact-psimi-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psixml/intact-jami-xml/pom.xml b/psimi/psixml/intact-jami-xml/pom.xml index cce169634..9c33a49b7 100644 --- a/psimi/psixml/intact-jami-xml/pom.xml +++ b/psimi/psixml/intact-jami-xml/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange.psimi intact-psixml - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-jami-xml diff --git a/psimi/psixml/intact-psixml-converters/pom.xml b/psimi/psixml/intact-psixml-converters/pom.xml index 599258646..492417902 100644 --- a/psimi/psixml/intact-psixml-converters/pom.xml +++ b/psimi/psixml/intact-psixml-converters/pom.xml @@ -4,7 +4,7 @@ intact-psixml uk.ac.ebi.intact.dataexchange.psimi - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psixml/intact-psixml-dbimporter/pom.xml b/psimi/psixml/intact-psixml-dbimporter/pom.xml index 8e38ae60c..977d5a259 100644 --- a/psimi/psixml/intact-psixml-dbimporter/pom.xml +++ b/psimi/psixml/intact-psixml-dbimporter/pom.xml @@ -6,7 +6,7 @@ intact-psixml uk.ac.ebi.intact.dataexchange.psimi - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-psixml-dbimporter diff --git a/psimi/psixml/intact-psixml-exchange/pom.xml b/psimi/psixml/intact-psixml-exchange/pom.xml index 830e2d10e..d5e00573c 100644 --- a/psimi/psixml/intact-psixml-exchange/pom.xml +++ b/psimi/psixml/intact-psixml-exchange/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.dataexchange.psimi intact-psixml - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/psimi/psixml/pom.xml b/psimi/psixml/pom.xml index 7c1472b27..7ae8dff8f 100644 --- a/psimi/psixml/pom.xml +++ b/psimi/psixml/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange.psimi intact-psimi-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT 4.0.0 diff --git a/structured-abstract/pom.xml b/structured-abstract/pom.xml index 0bd6ee7b2..2005f81e8 100644 --- a/structured-abstract/pom.xml +++ b/structured-abstract/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT structured-abstract From 58b7c79376b9aa2a8693b5bf0d7fe0b1a3b8854c Mon Sep 17 00:00:00 2001 From: jmedinaebi Date: Tue, 3 Sep 2024 13:02:23 +0100 Subject: [PATCH 2/4] TODO comment --- .../dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java | 1 + 1 file changed, 1 insertion(+) diff --git a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java index c0c551653..94423ed23 100644 --- a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java +++ b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java @@ -204,6 +204,7 @@ public void enrichSerialisedParticipant(Component participant, SolrInputDocument Interactor interactor = participant.getInteractor(); String identifier = ComplexUtils.getParticipantIdentifier(participant); + // TODO: filter, maybe by database, to not store all xrefs, only those we want (like panther) List xrefs = interactor.getXrefs().stream() .map(xref -> new ComplexInteractorXref( xref.getPrimaryId(), From 287e1b33ca5711159d9f5af729eda2ed7838e473 Mon Sep 17 00:00:00 2001 From: jmedinaebi Date: Thu, 12 Sep 2024 12:18:28 +0100 Subject: [PATCH 3/4] Filter interactors xrefs to serialise and store in SOLR --- .../psimi/solr/enricher/ComplexSolrEnricher.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java index 94423ed23..0cad4ecc0 100644 --- a/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java +++ b/psimi/psimitab/intact-solr/src/main/java/uk/ac/ebi/intact/dataexchange/psimi/solr/enricher/ComplexSolrEnricher.java @@ -40,8 +40,12 @@ public class ComplexSolrEnricher extends AbstractOntologyEnricher{ private PsimiTabReader reader; private final ObjectMapper mapper; - private final static String EXP_EVIDENCE="exp-evidence"; - private final static String INTACT_SECONDARY="intact-secondary"; + private static final String EXP_EVIDENCE="exp-evidence"; + private static final String INTACT_SECONDARY="intact-secondary"; + + // Currently, we are only storing interactors xrefs from the following databases: + // - panther (MI:0702) + private static final Set INTERACTOR_XREF_DATABASE_MIS_TO_STORE = Set.of("MI:0702"); /*************************/ /* Constructor */ @@ -204,8 +208,9 @@ public void enrichSerialisedParticipant(Component participant, SolrInputDocument Interactor interactor = participant.getInteractor(); String identifier = ComplexUtils.getParticipantIdentifier(participant); - // TODO: filter, maybe by database, to not store all xrefs, only those we want (like panther) List xrefs = interactor.getXrefs().stream() + .filter(xref -> xref.getCvDatabase() != null) + .filter(xref -> INTERACTOR_XREF_DATABASE_MIS_TO_STORE.contains(xref.getCvDatabase().getIdentifier())) .map(xref -> new ComplexInteractorXref( xref.getPrimaryId(), ComplexUtils.getIdentifierLink(xref, xref.getPrimaryId()), From 181ee86b3f232121f4a0f967cdcb3c61cbed182d Mon Sep 17 00:00:00 2001 From: jmedinaebi Date: Wed, 25 Sep 2024 08:58:31 +0100 Subject: [PATCH 4/4] Update version on new module --- intact-orthology-import/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intact-orthology-import/pom.xml b/intact-orthology-import/pom.xml index 093a36abb..ff10e1961 100644 --- a/intact-orthology-import/pom.xml +++ b/intact-orthology-import/pom.xml @@ -8,7 +8,7 @@ uk.ac.ebi.intact.dataexchange intact-dataexchange-master - 4.1.0-SNAPSHOT + 4.2.0-SNAPSHOT intact-orthology-import