Skip to content

Commit

Permalink
Merge pull request #18 from EBI-IntAct/develop
Browse files Browse the repository at this point in the history
Develop > Master
  • Loading branch information
jmedinaebi authored Sep 27, 2024
2 parents 218145d + 18f7fb6 commit 7732c6b
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 20 deletions.
2 changes: 1 addition & 1 deletion feature-shortlabel-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>uk.ac.ebi.intact.tools</groupId>
<artifactId>tools-master</artifactId>
<version>1.2.5</version>
<version>2.0.1</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ public interface ShortlabelGeneratorListener extends EventListener {
void onResultingSequenceChanged(ResultingSequenceChangedEvent event);

void onObjectTypeError(TypeErrorEvent event);

void onOtherErrorEvent(OtherErrorEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">none</prop>
<prop key="hibernate.connection.release_mode">after_transaction</prop>
<prop key="hibernate.enable_lazy_load_no_trans">true</prop>
<prop key="hibernate.default_schema">intact</prop>
</props>
</property>
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="databasePlatform" value="org.hibernate.dialect.Oracle12cDialect"/>
<property name="databasePlatform" value="org.hibernate.dialect.PostgreSQL82Dialect"/>
<property name="showSql" value="false"/>
<property name="generateDdl" value="false"/>
</bean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
16 changes: 6 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
<parent>
<groupId>uk.ac.ebi.intact.maven</groupId>
<artifactId>intact-hibernate-master</artifactId>
<version>47</version>
<version>48</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<groupId>uk.ac.ebi.intact.tools</groupId>
<artifactId>tools-master</artifactId>
<packaging>pom</packaging>
<version>1.2.5</version>
<version>2.0.1</version>

<name>IntAct Tools</name>
<description>Tools Master POM</description>

<properties>
<currentVersion>${project.version}</currentVersion>
<spring.version>4.3.30.RELEASE</spring.version>
<psi.jami.version>3.5.0</psi.jami.version>
<intact.jami.version>2.2.6</intact.jami.version>
<intact.bridges.version>2.2.2</intact.bridges.version>
<intact.core.version>2.8.1</intact.core.version>
<psi.jami.version>3.6.0</psi.jami.version>
<intact.jami.version>3.1.0</intact.jami.version>
<intact.bridges.version>2.2.3</intact.bridges.version>
<intact.core.version>3.1.0</intact.core.version>
<maven.pmd.skip>true</maven.pmd.skip>
</properties>

Expand Down Expand Up @@ -100,10 +100,6 @@
</dependencies>

<repositories>
<repository>
<id>nexus-ebi-repo-old</id>
<url>https://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/</url>
</repository>
<repository>
<id>nexus-ebi-release-repo</id>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/</url>
Expand Down
2 changes: 1 addition & 1 deletion protein-mapping/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>uk.ac.ebi.intact.tools</groupId>
<artifactId>tools-master</artifactId>
<version>1.2.5</version>
<version>2.0.1</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion protein-mapping/run_protein_sequence_blast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
mvn -U clean install -Pprotein-sequence-identification -Dinput.file=$1 -Douput.file=$2 -Dtaxid=$3 -Dmaven.repo.local=repository -Dmaven.test.skip -Ddb=postgres
Original file line number Diff line number Diff line change
Expand Up @@ -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' )");

Expand All @@ -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 ( " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.hbm2ddl.auto">create-drop</prop>
<prop key="hibernate.default_schema">intact</prop>
</props>
</property>

Expand All @@ -30,7 +31,7 @@

<bean id="intactCoreDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.h2.Driver"/>
<property name="url" value="jdbc:h2:mem:intactcore;DB_CLOSE_DELAY=-1;LOCK_MODE=0"/>
<property name="url" value="jdbc:h2:mem:intactcore;DB_CLOSE_DELAY=-1;LOCK_MODE=0;INIT=CREATE SCHEMA IF NOT EXISTS INTACT"/>
<property name="username" value="sa"/>
<property name="password" value=""/>
</bean>
Expand Down

0 comments on commit 7732c6b

Please sign in to comment.