Skip to content

Commit

Permalink
Merge pull request #88 from MICommunity/fix-rna-central-and-ensembl-f…
Browse files Browse the repository at this point in the history
…etchers

Fix enrichers and fetchers for mRNA and miRNA
  • Loading branch information
EliotRagueneau authored Mar 21, 2024
2 parents 6ed22ec + 587395c commit c621f90
Show file tree
Hide file tree
Showing 34 changed files with 62 additions and 38 deletions.
2 changes: 1 addition & 1 deletion jami-batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-batch</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/bridges-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>bridges-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-chebi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-chebi</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-ensembl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-ensembl</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-europubmedcentral/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>jami-bridges</artifactId>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-europubmedcentral</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-imexcentral/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-imexcentral</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-obo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-obo</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-ols/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-ols</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-ontology-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-ontology-manager</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-rna-central/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-rna-central</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import psidev.psi.mi.jami.model.Organism;
import psidev.psi.mi.jami.model.Xref;
import psidev.psi.mi.jami.model.impl.*;
import psidev.psi.mi.jami.utils.XrefUtils;

import java.io.IOException;
import java.net.URL;
Expand Down Expand Up @@ -88,6 +89,7 @@ private void addXRefs(NucleicAcid nucleicAcid, String pureIdentifier, Organism o

private void extractXrefsAndAliases(NucleicAcid nucleicAcid, ApiXrefs.Result result) {
Collection<Xref> xrefs = nucleicAcid.getXrefs();
Collection<Xref> identifiers = nucleicAcid.getIdentifiers();

XrefType xrefType = XrefType.getByDatabase(result.getDatabase());

Expand All @@ -100,15 +102,27 @@ private void extractXrefsAndAliases(NucleicAcid nucleicAcid, ApiXrefs.Result res
.map(PartialCvTerm::complete)
.findFirst().orElse(OLSUtils.secondaryAcCV);

xrefs.add(new DefaultXref(database, result.getAccession().getExternalId(), qualifier));
Xref newXref = new DefaultXref(database, result.getAccession().getExternalId(), qualifier);

if (XrefUtils.isXrefAnIdentifier(newXref)) {
identifiers.add(newXref);
} else {
xrefs.add(newXref);
}

xrefType.extraReferenceBuilders.stream()
.map(builder -> builder.apply(result))
.map(partialXref -> partialXref.complete(
PartialXref.builder()
.database(PartialCvTerm.from(database))
.build()))
.forEach(xrefs::add);
.forEach(xref -> {
if (XrefUtils.isXrefAnIdentifier(xref)) {
identifiers.add(xref);
} else {
xrefs.add(xref);
}
});
}

xrefType.aliasBuilders.stream()
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-uniprot-protein-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-uniprot-protein-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-uniprot-taxonomy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-uniprot-taxonomy</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-uniprot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-uniprot</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/jami-unisave/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami.bridges</groupId>
<artifactId>jami-bridges</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-unisave</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-bridges/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<groupId>psidev.psi.mi.jami.bridges</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jami-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-commons</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public interface NucleicAcid extends Polymer {
public static final String NULCEIC_ACID="nucleic acid";
/** Constant <code>NULCEIC_ACID_MI="MI:0318"</code> */
public static final String NULCEIC_ACID_MI="MI:0318";
public static final String MRNA = "mrna";
public static final String MRNA_MI = "MI:0324";
public static final String MIRNA = "mirna";
public static final String MIRNA_MI = "MI:2204";

/**
* The unique DDBJ/EMBL/GemBank identifier which identifies the nucleic acid.
Expand Down
3 changes: 2 additions & 1 deletion jami-core/src/main/resources/interactorDatabase.properties
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ MI\:1097(uniprot)=protein
MI\:0485(uniparc)=protein
MI\:0486(uniprotkb)=protein
MI\:1098(swiss-prot)=protein
MI\:1099(trembl)=protein
MI\:1099(trembl)=protein
MI\:1357(rnacentral)=nucleic_acid
3 changes: 2 additions & 1 deletion jami-core/src/main/resources/interactorType.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ MI\:0250(gene)=gene
MI\:1304(molecule\ set)=interactor_set
MI\:1305(candidate\ set)=interactor_set
MI\:1307(defined\ set)=interactor_set
MI\:1306(open\ set)=interactor_set
MI\:1306(open\ set)=interactor_set
MI\:2204(mirna)=nucleic_acid
2 changes: 1 addition & 1 deletion jami-crosslink-csv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-crosslink-csv</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-enricher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-enricher</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ public void enrich(Interactor object) throws EnricherException {
if (object instanceof Polymer) {
if (object instanceof Protein && this.proteinEnricher != null) {
this.proteinEnricher.enrich((Protein) object);
} else if (object instanceof NucleicAcid && this.nucleicAcidEnricher != null) {
this.nucleicAcidEnricher.enrich((NucleicAcid) object);
} else if (this.polymerBaseEnricher != null) {
this.polymerBaseEnricher.enrich((Polymer) object);
} else {
this.interactorBaseEnricher.enrich(object);
}
} else if (object instanceof Gene && this.geneEnricher != null) {
this.geneEnricher.enrich((Gene) object);
} else if (object instanceof NucleicAcid && this.nucleicAcidEnricher != null) {
this.nucleicAcidEnricher.enrich((NucleicAcid) object);
} else if (object instanceof BioactiveEntity && this.bioactiveEntityEnricher != null) {
this.bioactiveEntityEnricher.enrich((BioactiveEntity) object);
} else if (object instanceof Complex && this.complexEnricher != null) {
Expand Down Expand Up @@ -222,6 +222,8 @@ public void enrich(Interactor object, Interactor objectSource) throws EnricherEx
if (object instanceof Polymer && objectSource instanceof Polymer) {
if (object instanceof Protein && objectSource instanceof Protein && this.proteinEnricher != null) {
this.proteinEnricher.enrich((Protein) object, (Protein) objectSource);
} else if (object instanceof NucleicAcid && objectSource instanceof NucleicAcid && this.nucleicAcidEnricher != null) {
this.nucleicAcidEnricher.enrich((NucleicAcid) object, (NucleicAcid) objectSource);
} else if (this.polymerBaseEnricher != null) {
this.polymerBaseEnricher.enrich((Polymer) object, (Polymer) objectSource);
} else {
Expand Down Expand Up @@ -306,6 +308,9 @@ public void setCvTermEnricher(CvTermEnricher<CvTerm> enricher) {
if (getInteractorPoolEnricher() != null) {
getInteractorPoolEnricher().setCvTermEnricher(enricher);
}
if (getNucleicAcidEnricher() != null) {
getNucleicAcidEnricher().setCvTermEnricher(enricher);
}
}

/**
Expand All @@ -331,5 +336,8 @@ public void setOrganismEnricher(OrganismEnricher enricher) {
if (getInteractorPoolEnricher() != null) {
getInteractorPoolEnricher().setOrganismEnricher(enricher);
}
if (getNucleicAcidEnricher() != null) {
getNucleicAcidEnricher().setOrganismEnricher(enricher);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import psidev.psi.mi.jami.bridges.fetcher.GeneFetcher;
import psidev.psi.mi.jami.bridges.fetcher.NucleicAcidFetcher;
import psidev.psi.mi.jami.enricher.impl.minimal.MinimalGeneEnricher;
import psidev.psi.mi.jami.enricher.impl.minimal.MinimalNucleicAcidEnricher;
import psidev.psi.mi.jami.enricher.listener.NucleicAcidEnricherListener;
import psidev.psi.mi.jami.enricher.listener.ProteinEnricherListener;
import psidev.psi.mi.jami.model.NucleicAcid;
import psidev.psi.mi.jami.model.Protein;

/**
* A full enricher for genes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import psidev.psi.mi.jami.bridges.fetcher.GeneFetcher;
import psidev.psi.mi.jami.bridges.fetcher.NucleicAcidFetcher;
import psidev.psi.mi.jami.enricher.impl.minimal.MinimalGeneUpdater;
import psidev.psi.mi.jami.enricher.impl.minimal.MinimalNucleicAcidUpdater;
import psidev.psi.mi.jami.enricher.listener.NucleicAcidEnricherListener;
import psidev.psi.mi.jami.enricher.listener.ProteinEnricherListener;
import psidev.psi.mi.jami.model.NucleicAcid;
import psidev.psi.mi.jami.model.Protein;

/**
* A full updater for genes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ protected boolean canEnrichInteractor(NucleicAcid entityToEnrich, NucleicAcid fe
// if the interactor type is not a valid bioactive entity interactor type, we cannot enrich
if (entityToEnrich.getInteractorType() != null &&
!CvTermUtils.isCvTerm(entityToEnrich.getInteractorType(), NucleicAcid.NULCEIC_ACID_MI, NucleicAcid.NULCEIC_ACID)
&& !CvTermUtils.isCvTerm(entityToEnrich.getInteractorType(), NucleicAcid.MRNA_MI, NucleicAcid.MRNA)
&& !CvTermUtils.isCvTerm(entityToEnrich.getInteractorType(), NucleicAcid.MIRNA_MI, NucleicAcid.MIRNA)
&& !CvTermUtils.isCvTerm(entityToEnrich.getInteractorType(), Interactor.UNKNOWN_INTERACTOR_MI, Interactor.UNKNOWN_INTERACTOR)) {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion jami-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-html/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-html</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-imex-updater/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-imex-updater</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-interactionviewer-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-interactionviewer-json</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-mitab/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-mitab</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jami-xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>
</parent>

<artifactId>jami-xml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>psidev.psi.mi.jami</groupId>
<artifactId>psi-jami</artifactId>
<version>3.5.0</version>
<version>3.5.1-SNAPSHOT</version>

<packaging>pom</packaging>
<name>PSI :: JAMI - Java framework for molecular interactions</name>
Expand Down

0 comments on commit c621f90

Please sign in to comment.