diff --git a/feature-shortlabel-generator/pom.xml b/feature-shortlabel-generator/pom.xml index 6c348e0..66675c5 100644 --- a/feature-shortlabel-generator/pom.xml +++ b/feature-shortlabel-generator/pom.xml @@ -4,7 +4,7 @@ uk.ac.ebi.intact.tools tools-master - 1.2.5 + 2.0.1 4.0.0 diff --git a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/ShortlabelGenerator.java b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/ShortlabelGenerator.java index 0fffd1e..12482d0 100644 --- a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/ShortlabelGenerator.java +++ b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/ShortlabelGenerator.java @@ -11,6 +11,7 @@ import uk.ac.ebi.intact.jami.model.extension.ExperimentalRange; import uk.ac.ebi.intact.jami.model.extension.IntactFeatureEvidence; import uk.ac.ebi.intact.jami.model.extension.IntactInteractor; +import uk.ac.ebi.intact.jami.utils.IntactUtils; import uk.ac.ebi.intact.tools.feature.shortlabel.generator.events.*; import uk.ac.ebi.intact.tools.feature.shortlabel.generator.listener.ShortlabelGeneratorListener; import uk.ac.ebi.intact.tools.feature.shortlabel.generator.manager.ShortlabelGeneratorManager; @@ -368,6 +369,9 @@ public void generateNewShortLabel(IntactFeatureEvidence featureEvidence) { if (noMutationUpdate || orgShortlabel.equals(featureEvidence.getShortName())) { UnmodifiedMutationShortlabelEvent event = new UnmodifiedMutationShortlabelEvent(featureAc, interactorAc, featureEvidence, noMutationUpdate); manager.fireOnUnmodifiedMutationShortlabelEvent(event); + } else if (featureEvidence.getShortName().length() > IntactUtils.MAX_SHORT_LABEL_LEN) { + OtherErrorEvent event = new OtherErrorEvent(featureAc, OtherErrorEvent.ErrorType.SHORT_LABEL_TOO_LONG, featureEvidence.getShortName()); + manager.fireOnOtherErrorEvent(event); } else { ModifiedMutationShortlabelEvent event = new ModifiedMutationShortlabelEvent(featureAc, interactorAc, featureEvidence, orgShortlabel, false); manager.fireOnModifiedMutationShortlabelEvent(event); diff --git a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/events/OtherErrorEvent.java b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/events/OtherErrorEvent.java new file mode 100644 index 0000000..bcc1dcf --- /dev/null +++ b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/events/OtherErrorEvent.java @@ -0,0 +1,39 @@ +package uk.ac.ebi.intact.tools.feature.shortlabel.generator.events; + +public class OtherErrorEvent { + private final String featureAc; + private final ErrorType errorType; + private final String errorDetails; + + public OtherErrorEvent(String featureAc, ErrorType errorType, String errorDetails) { + this.featureAc = (featureAc == null) ? "undefined" : featureAc; + this.errorType = errorType; + this.errorDetails = errorDetails; + } + + public String getFeatureAc() { + return featureAc; + } + + public ErrorType getErrorType() { + return errorType; + } + + public String getErrorDetails() { + return errorDetails; + } + + public enum ErrorType { + SHORT_LABEL_TOO_LONG("New short label is too long"); + + private final String message; + + ErrorType(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + } +} diff --git a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/listener/ShortlabelGeneratorListener.java b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/listener/ShortlabelGeneratorListener.java index ca94dd4..cf5f3d3 100644 --- a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/listener/ShortlabelGeneratorListener.java +++ b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/listener/ShortlabelGeneratorListener.java @@ -23,4 +23,6 @@ public interface ShortlabelGeneratorListener extends EventListener { void onResultingSequenceChanged(ResultingSequenceChangedEvent event); void onObjectTypeError(TypeErrorEvent event); + + void onOtherErrorEvent(OtherErrorEvent event); } diff --git a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/manager/ShortlabelGeneratorManager.java b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/manager/ShortlabelGeneratorManager.java index c42ab9e..3018cc0 100644 --- a/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/manager/ShortlabelGeneratorManager.java +++ b/feature-shortlabel-generator/src/main/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/manager/ShortlabelGeneratorManager.java @@ -62,6 +62,11 @@ public void fireOnObjectTypeErrorEvent(TypeErrorEvent event) { } } + public void fireOnOtherErrorEvent(OtherErrorEvent event) { + for (ShortlabelGeneratorListener eventListener : getListeners(ShortlabelGeneratorListener.class)){ + eventListener.onOtherErrorEvent(event); + } + } public void addListener(ShortlabelGeneratorListener listener) { listenerList.add(ShortlabelGeneratorListener.class, listener); diff --git a/feature-shortlabel-generator/src/main/resources/META-INF/shortlabel-generator-config.xml b/feature-shortlabel-generator/src/main/resources/META-INF/shortlabel-generator-config.xml index 70451b7..1748aeb 100644 --- a/feature-shortlabel-generator/src/main/resources/META-INF/shortlabel-generator-config.xml +++ b/feature-shortlabel-generator/src/main/resources/META-INF/shortlabel-generator-config.xml @@ -64,13 +64,13 @@ true false none - after_transaction true + intact - + diff --git a/feature-shortlabel-generator/src/test/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/impl/FeatureListener.java b/feature-shortlabel-generator/src/test/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/impl/FeatureListener.java index ff2b6b9..c6f7634 100644 --- a/feature-shortlabel-generator/src/test/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/impl/FeatureListener.java +++ b/feature-shortlabel-generator/src/test/java/uk/ac/ebi/intact/tools/feature/shortlabel/generator/impl/FeatureListener.java @@ -32,6 +32,11 @@ public void onUnmodifiedMutationShortlabel(UnmodifiedMutationShortlabelEvent eve System.out.println(event.getFeatureAc() + "\t original shortlabel is correct: " + "\t" + event.getFeatureEvidence().getShortName()); } + @Override + public void onOtherErrorEvent(OtherErrorEvent event) { + System.out.println(event.getFeatureAc() + "\t " + event.getErrorType().getMessage() + ":\t" + event.getErrorDetails()); + } + @Override public void onRetrieveObjectError(ObjRetrieveErrorEvent event) { System.out.println(event.getMessage()); diff --git a/pom.xml b/pom.xml index 448ec0a..4e06d41 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.maven intact-hibernate-master - 47 + 48 4.0.0 @@ -11,7 +11,7 @@ uk.ac.ebi.intact.tools tools-master pom - 1.2.5 + 2.0.1 IntAct Tools Tools Master POM @@ -19,10 +19,10 @@ ${project.version} 4.3.30.RELEASE - 3.5.0 - 2.2.6 - 2.2.2 - 2.8.1 + 3.6.0 + 3.1.0 + 2.2.3 + 3.1.0 true @@ -100,10 +100,6 @@ - - nexus-ebi-repo-old - https://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/ - nexus-ebi-release-repo https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/ diff --git a/protein-mapping/pom.xml b/protein-mapping/pom.xml index 9bc6cd3..900b3f4 100644 --- a/protein-mapping/pom.xml +++ b/protein-mapping/pom.xml @@ -3,7 +3,7 @@ uk.ac.ebi.intact.tools tools-master - 1.2.5 + 2.0.1 diff --git a/protein-mapping/run_protein_sequence_blast.sh b/protein-mapping/run_protein_sequence_blast.sh index e3aa760..9ccede9 100644 --- a/protein-mapping/run_protein_sequence_blast.sh +++ b/protein-mapping/run_protein_sequence_blast.sh @@ -9,4 +9,4 @@ echo "input file $1" echo "ouput file $2" echo "taxid $3" -mvn -U clean install -Pprotein-sequence-identification -Dinput.file=$1 -Douput.file=$2 -Dtaxid=$3 -Dmaven.repo.local=repository -Dmaven.test.skip -Ddb=oracle \ No newline at end of file +mvn -U clean install -Pprotein-sequence-identification -Dinput.file=$1 -Douput.file=$2 -Dtaxid=$3 -Dmaven.repo.local=repository -Dmaven.test.skip -Ddb=postgres \ No newline at end of file diff --git a/protein-mapping/src/main/java/uk/ac/ebi/intact/protein/mapping/update/ProteinUpdateManager.java b/protein-mapping/src/main/java/uk/ac/ebi/intact/protein/mapping/update/ProteinUpdateManager.java index 85336cf..eb694c6 100644 --- a/protein-mapping/src/main/java/uk/ac/ebi/intact/protein/mapping/update/ProteinUpdateManager.java +++ b/protein-mapping/src/main/java/uk/ac/ebi/intact/protein/mapping/update/ProteinUpdateManager.java @@ -78,10 +78,11 @@ protected Query getProteinsWithoutUniprotXrefs(DataContext dataContext){ "left join p.xrefs as xrefs " + "left join p.annotations as annotations " + "where p.objClass = 'uk.ac.ebi.intact.model.ProteinImpl' "+ - "and p not in ( "+ + "and not exists ( "+ "select p2 "+ "from InteractorImpl p2 join p2.xrefs as xrefs "+ - "where p2.objClass = 'uk.ac.ebi.intact.model.ProteinImpl' "+ + "where p2.ac = p.ac " + + "and p2.objClass = 'uk.ac.ebi.intact.model.ProteinImpl' "+ "and xrefs.cvDatabase.ac = 'EBI-31' " + "and xrefs.cvXrefQualifier.shortLabel <> 'uniprot-removed-ac' )"); @@ -96,10 +97,11 @@ protected Query getProteinsWithUniprotXrefsWithoutIdentity(DataContext dataConte "left join p.xrefs as xrefs " + "left join p.annotations as annotations " + "where p.objClass = 'uk.ac.ebi.intact.model.ProteinImpl' "+ - "and p not in ( "+ + "and not exists ( "+ "select p2 "+ "from InteractorImpl p2 join p2.xrefs as xrefs "+ - "where p2.objClass = 'uk.ac.ebi.intact.model.ProteinImpl' "+ + "where p2.ac = p.ac " + + "and p2.objClass = 'uk.ac.ebi.intact.model.ProteinImpl' "+ "and xrefs.cvDatabase.ac = 'EBI-31' " + "and xrefs.cvXrefQualifier.shortLabel = 'identity') " + "and p in ( " + diff --git a/protein-mapping/src/test/resources/META-INF/jpa.test.spring.xml b/protein-mapping/src/test/resources/META-INF/jpa.test.spring.xml index d79d728..5aca713 100644 --- a/protein-mapping/src/test/resources/META-INF/jpa.test.spring.xml +++ b/protein-mapping/src/test/resources/META-INF/jpa.test.spring.xml @@ -16,6 +16,7 @@ true false create-drop + intact @@ -30,7 +31,7 @@ - +