Git Lab CI for docker build enabled! You can enable it using .gitlab-ci.yml in your project. Check file template at https://gitlab.bio.di.uminho.pt/snippets/5

Commit 9d81defd authored by Davide Lagoa's avatar Davide Lagoa
Browse files

neo4j upgrade to version 4

parent 723b01be
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
......
/target/
logs/
*.log
\ No newline at end of file
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=10
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=10
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
......@@ -11,6 +11,6 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=10
org.eclipse.jdt.core.compiler.source=11
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pt.uminho.ceb.biosystems.transyt</groupId>
<artifactId>service</artifactId>
<name>service</name>
<version>0.0.5-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version>
</dependency>
</dependencies>
<configuration>
<release>10</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer>
<mainClass>pt.uminho.ceb.biosystems.transyt.service.transyt.TransytMain</mainClass>
</transformer>
<transformer />
</transformers>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>nexus</id>
<name>Nexus BioSystems Server</name>
<url>https://www.bio.di.uminho.pt/nexus/content/groups/public/</url>
</repository>
<repository>
<id>ebi-repo</id>
<name>ebi-repo</name>
<url>http://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pt.uminho.ceb.biosystems.transyt</groupId>
<artifactId>service</artifactId>
<name>service</name>
<version>0.0.7-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version>
</dependency>
</dependencies>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer>
<mainClass>pt.uminho.ceb.biosystems.transyt.service.transyt.TransytMain</mainClass>
</transformer>
<transformer />
</transformers>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>nexus</id>
<name>Nexus BioSystems Server</name>
<url>https://www.bio.di.uminho.pt/nexus/content/groups/public/</url>
</repository>
<repository>
<id>ebi-repo</id>
<name>ebi-repo</name>
<url>http://www.ebi.ac.uk/intact/maven/nexus/content/repositories/ebi-repo/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.4.2.Final</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<hibernate.version>5.4.2.Final</hibernate.version>
</properties>
</project>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -4,10 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pt.uminho.ceb.biosystems.transyt</groupId>
<artifactId>service</artifactId>
<version>0.0.5-SNAPSHOT</version>
<description>
</description>
<version>0.0.7-SNAPSHOT</version>
<properties>
<hibernate.version>5.4.2.Final</hibernate.version>
</properties>
<repositories>
......@@ -39,7 +42,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<release>10</release>
<release>11</release>
</configuration>
<dependencies>
<dependency>
......@@ -102,13 +105,13 @@
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>1.7.2</version>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>pt.uminho.ceb.biosystems.transyt</groupId>
<artifactId>utilities</artifactId>
<version>0.0.5-SNAPSHOT</version>
<version>0.0.7-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
......@@ -138,7 +141,7 @@
<dependency>
<groupId>pt.uminho.ceb.biosystems.transyt</groupId>
<artifactId>scraper</artifactId>
<version>0.0.5-SNAPSHOT</version>
<version>0.0.7-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>uk.ac.ebi.uniprot</groupId>
......@@ -155,109 +158,38 @@
</dependency>
<!-- <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb-chebi</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>
pt.uminho.sysbio.biosynthframework
</groupId>
<artifactId>biosynth-biodb</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency> -->
<dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb-reactome</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-chemanalysis</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency> -->
<dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb-chebi</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId> pt.uminho.sysbio.biosynthframework </groupId>
<artifactId>biosynth-biodb</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId> </exclusion> </exclusions> </dependency>
<!-- <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-core</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency> -->
<dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb-reactome</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
</exclusion> </exclusions> </dependency> <dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-chemanalysis</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
</exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId>
</exclusion> </exclusions> </dependency>
<!-- <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-genome</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.biojava</groupId>
<artifactId>biojava-alignment</artifactId>
</exclusion>
<exclusion>
<groupId>org.biojava</groupId>
<artifactId>biojava-core</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency> -->
<dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-core</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
</exclusion> </exclusions> </dependency>
<dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-integration</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
</exclusion>
<exclusion>
<groupId>
pt.uminho.sysbio.biosynthframework
</groupId>
<artifactId>biosynth-biodb</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-genome</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId>org.biojava</groupId> <artifactId>biojava-alignment</artifactId>
</exclusion> <exclusion> <groupId>org.biojava</groupId> <artifactId>biojava-core</artifactId>
</exclusion> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
</exclusion> </exclusions> </dependency> <dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-integration</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId>
</exclusion> <exclusion> <groupId> pt.uminho.sysbio.biosynthframework </groupId>
<artifactId>biosynth-biodb</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> </exclusion> </exclusions> </dependency>
<dependency>
<groupId>org.neo4j</groupId>
......@@ -273,17 +205,10 @@
</dependency>
<!-- <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-visualization</artifactId>
<version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency> -->
<dependency> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-visualization</artifactId> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId>
</exclusion> </exclusions> </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
......@@ -291,11 +216,8 @@
<version>3.17</version>
</dependency>
<!-- <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version>
</dependency> -->
<!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId>
<version>6.0.6</version> </dependency> -->
<dependency>
<groupId>org.jsoup</groupId>
......@@ -334,6 +256,30 @@
<version>1.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
<type>pom</type>
</dependency>
<!-- http://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager%20 -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.2.RELEASE</version>
</dependency>
</dependencies>
<name>service</name>
</project>
......@@ -70,7 +70,7 @@ public class BIGG1 {
etlPipeline.exclude.add("D05511");
etlPipeline.setSkipLoad(false);
etlPipeline.setGraphDatabaseService(graphDatabaseService);
etlPipeline.setSessionFactory(null);
// etlPipeline.setSessionFactory(null);
etlPipeline.setEtlDataCleasingSubsystem(new CentralMetaboliteEtlDataCleansing(new CdkWrapper()));
etlPipeline.setExtractSubsystem(new DefaultMetaboliteEtlExtract<M>(src));
etlPipeline.setLoadSubsystem(new HeterogenousMetaboliteEtlLoad<GraphMetaboliteEntity>(dst));
......
......@@ -157,6 +157,9 @@ public class BlastAlignmentTransyt extends Observable implements ModelAlignments
// System.out.println(outputFile.getAbsolutePath());
if(forceBlast) {
System.out.println("blastp -query " + this.queryFasta + " -subject "
+ this.subjectFasta + " -out " + outputFile.getAbsolutePath() + " -outfmt 5");
Process p = Runtime.getRuntime().exec("blastp -query " + this.queryFasta + " -subject "
+ this.subjectFasta + " -out " + outputFile.getAbsolutePath() + " -outfmt 5");
......
......@@ -50,8 +50,8 @@ public class WriteByMetabolitesID {
Map<String, BiosynthMetaboliteProperties> data = getBiosynthDBData(service);
// Map<String, BiosynthMetaboliteProperties> data = null;
@SuppressWarnings("resource")
Scanner reader = new Scanner(System.in);
// @SuppressWarnings("resource")
// Scanner reader = new Scanner(System.in);
// System.out.println("Writing Excel...");
// WriteExcel.writeNeo4jKeggInfo(data);
......@@ -75,11 +75,11 @@ public class WriteByMetabolitesID {
//
// Map<String, String[]> forChildsSearch = metabolitesIdentification.getforChildsSearch();
int n = 1;
// int n = 1;
while (n != 99) {
n = 99;
// while (n != 99) {
//
// n = 99;
test(namesAndIDsContainer, data, service, null, reactionsData, null, properties); //uncomment
//
......@@ -87,15 +87,15 @@ public class WriteByMetabolitesID {
//
// System.out.println("Enter a random number to repeat (100 to repeat data retrieval) or 99 to finish: ");
try {
n = reader.nextInt();
} catch (Exception e) {
e.printStackTrace();
n = reader.nextInt();
}
}
// try {
// n = reader.nextInt();
// } catch (Exception e) {
// e.printStackTrace();
//
// n = reader.nextInt();
// }
//
// }
dataTx.failure();
dataTx.close();
service.shutdown();
......
......@@ -9,14 +9,22 @@ import java.util.Set;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.neo4j.driver.v1.AccessMode;
import org.neo4j.driver.v1.AuthTokens;
import org.neo4j.driver.v1.Driver;
import org.neo4j.driver.v1.GraphDatabase;
import org.neo4j.driver.v1.Record;
import org.neo4j.driver.v1.Session;
import org.neo4j.driver.v1.Statement;
import org.neo4j.driver.v1.StatementResult;
import org.neo4j.driver.AccessMode;
import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;
import org.neo4j.driver.Record;
import org.neo4j.driver.Result;
import org.neo4j.driver.Session;
import org.neo4j.driver.SessionConfig;
//import org.neo4j.driver.v1.AccessMode;
//import org.neo4j.driver.v1.AuthTokens;
//import org.neo4j.driver.v1.Driver;
//import org.neo4j.driver.v1.GraphDatabase;
//import org.neo4j.driver.v1.Record;
//import org.neo4j.driver.v1.Session;
//import org.neo4j.driver.v1.Statement;
//import org.neo4j.driver.v1.StatementResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -69,6 +77,8 @@ public class RestNeo4jGraphDatabase implements AutoCloseable{
temporaryCompoundsNames = new HashMap<>();
temporaryCompoundsFormulas = new HashMap<>();
// driver = GraphDatabase.driver(uri);
driver = GraphDatabase.driver( uri, AuthTokens.basic(username, password ) );
}
......@@ -79,12 +89,34 @@ public class RestNeo4jGraphDatabase implements AutoCloseable{
}
/**
* This method is used to change neo4j's database password. This step might be needed when using a default password.
*
* @param currentPassword
* @param newPassword
*/
public void changePassword(String currentPassword, String newPassword) {
Session session = driver.session();
this.password = newPassword;
session.run("ALTER CURRENT USER SET PASSWORD FROM + '" + currentPassword + "' TO '" + newPassword + "'");
logger.info("Neo4j password changed!");
restartDriver();
session.close();
}
/**
* Create constraints to avoid duplicated data.
*/
public void createContraints() {
Session session = driver.session(AccessMode.WRITE);
Session session = driver.session();
session.run("CREATE CONSTRAINT ON (a:" + TransytNodeLabel.Uniprot_Accession + ") assert a." + TransytGeneralProperties.Accession_Number + " IS UNIQUE");
session.run("CREATE CONSTRAINT ON (a:" + TransytNodeLabel.TC_Number + ") assert a." + TransytGeneralProperties.TC_Number + " IS UNIQUE");
......@@ -110,7 +142,7 @@ public class RestNeo4jGraphDatabase implements AutoCloseable{
*/
public void createIndexes(TransytNodeLabel label, TransytGeneralProperties property) {
Session session = driver.session(AccessMode.WRITE);
Session session = driver.session();