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 5bb841d1 authored by Davide Lagoa's avatar Davide Lagoa
Browse files

logger and TRIAGE neo4j database

parent d0a77108
...@@ -15,14 +15,16 @@ ...@@ -15,14 +15,16 @@
<attributes> <attributes>
<attribute name="optional" value="true"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
......
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=10
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=10
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=10
...@@ -9,42 +9,66 @@ ...@@ -9,42 +9,66 @@
</description> </description>
<repositories> <repositories>
<repository> <repository>
<id>nexus</id> <id>nexus</id>
<name>Nexus BioSystems Server</name> <name>Nexus BioSystems Server</name>
<!-- <url>http://192.168.1.99/nexus/content/groups/public/</url> --> <!-- <url>http://192.168.1.99/nexus/content/groups/public/</url> -->
<url>http://193.137.11.210/nexus/content/groups/public/</url> <url>http://193.137.11.210/nexus/content/groups/public/</url>
</repository> </repository>
</repositories> </repositories>
<build>
<build> <plugins>
<plugins> <!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId>
<plugin> <version>3.7.0</version> <configuration> <source>9</source> <target>9</target>
<groupId>org.apache.maven.plugins</groupId> </configuration> </plugin> -->
<artifactId>maven-compiler-plugin</artifactId> <plugin>
<version>3.7.0</version> <groupId>org.apache.maven.plugins</groupId>
<configuration> <artifactId>maven-compiler-plugin</artifactId>
<source>1.8</source> <version>3.7.0</version>
<target>1.8</target> <configuration>
</configuration> <release>10</release>
</plugin> </configuration>
</plugins> <dependencies>
</build> <dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.2</version> <!-- Use newer version of ASM -->
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies> <dependencies>
<!-- <dependency> <dependency>
<groupId>utilities</groupId> <groupId>utilities</groupId>
<artifactId>triage-utilities</artifactId> <artifactId>triage-utilities</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
</dependency> --> <exclusions>
<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> <dependency>
<groupId>tcdb</groupId> <groupId>tcdb</groupId>
<artifactId>triage</artifactId> <artifactId>triage</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>uk.ac.ebi.uniprot</groupId>
<artifactId>japi</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
...@@ -52,40 +76,67 @@ ...@@ -52,40 +76,67 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb</artifactId> <artifactId>biosynth-biodb-chebi</artifactId>
<version>0.9.0-SNAPSHOT</version> <version>0.9.0-SNAPSHOT</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.apache.httpcomponents</groupId> <groupId>
<artifactId>httpclient</artifactId> 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> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb-chebi</artifactId>
<version>0.9.0-SNAPSHOT</version>
</dependency>
<dependency> <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-biodb-reactome</artifactId> <artifactId>biosynth-biodb-reactome</artifactId>
<version>0.9.0-SNAPSHOT</version> <version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-chemanalysis</artifactId> <artifactId>biosynth-chemanalysis</artifactId>
<version>0.9.0-SNAPSHOT</version> <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>
<dependency> <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-core</artifactId> <artifactId>biosynth-core</artifactId>
<version>0.9.0-SNAPSHOT</version> <version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -101,6 +152,10 @@ ...@@ -101,6 +152,10 @@
<groupId>org.biojava</groupId> <groupId>org.biojava</groupId>
<artifactId>biojava-core</artifactId> <artifactId>biojava-core</artifactId>
</exclusion> </exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
...@@ -113,19 +168,35 @@ ...@@ -113,19 +168,35 @@
<groupId>org.neo4j</groupId> <groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId> <artifactId>neo4j</artifactId>
</exclusion> </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> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.neo4j</groupId> <groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId> <artifactId>neo4j</artifactId>
<version>3.4.1</version> <version>3.4.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>pt.uminho.sysbio.biosynthframework</groupId> <groupId>pt.uminho.sysbio.biosynthframework</groupId>
<artifactId>biosynth-visualization</artifactId> <artifactId>biosynth-visualization</artifactId>
<version>0.9.0-SNAPSHOT</version> <version>0.9.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -149,6 +220,12 @@ ...@@ -149,6 +220,12 @@
<groupId>org.biojava</groupId> <groupId>org.biojava</groupId>
<artifactId>biojava-alignment</artifactId> <artifactId>biojava-alignment</artifactId>
<version>5.0.0</version> <version>5.0.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -156,13 +233,23 @@ ...@@ -156,13 +233,23 @@
<artifactId>json-simple</artifactId> <artifactId>json-simple</artifactId>
<version>1.1.1</version> <version>1.1.1</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --> <dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
</dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>logback-classic</artifactId>
<version>1.8.0-beta1</version> <version>1.1.7</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -5,13 +5,18 @@ import java.util.Set; ...@@ -5,13 +5,18 @@ import java.util.Set;
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.uminho.biosynth.core.data.integration.neo4j.HelperNeo4jConfigInitializer; import edu.uminho.biosynth.core.data.integration.neo4j.HelperNeo4jConfigInitializer;
import internalDB.WriteByMetabolitesID;
import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel; import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel;
import pt.uminho.sysbio.biosynth.integration.neo4j.BiodbMetaboliteNode; import pt.uminho.sysbio.biosynth.integration.neo4j.BiodbMetaboliteNode;
import pt.uminho.sysbio.biosynthframework.BiodbGraphDatabaseService; import pt.uminho.sysbio.biosynthframework.BiodbGraphDatabaseService;
public class initializeNeo4jdb { public class initializeNeo4jdb {
private static final Logger logger = LoggerFactory.getLogger(initializeNeo4jdb.class);
public static void main(String[] args) { public static void main(String[] args) {
...@@ -49,12 +54,12 @@ public class initializeNeo4jdb { ...@@ -49,12 +54,12 @@ public class initializeNeo4jdb {
public static GraphDatabaseService getDataDatabase(GraphDatabaseService dataDb) { public static GraphDatabaseService getDataDatabase(GraphDatabaseService dataDb) {
if (dataDb == null) { if (dataDb == null) {
// logger.info("[INIT] graph database...");
System.out.println("[INIT] graph database..."); logger.info("[INIT] graph database...");
dataDb = HelperNeo4jConfigInitializer.initializeNeo4jDataDatabaseConstraints("C:\\Users\\Davide\\Documents\\BASE DE DADOS BIOSYNTH\\db3_0"); dataDb = HelperNeo4jConfigInitializer.initializeNeo4jDataDatabaseConstraints("C:\\Users\\Davide\\Documents\\BASE DE DADOS BIOSYNTH\\db3_0");
// logger.info("[INIT] graph database... done!"); logger.info("[INIT] graph database... done!");
System.out.println("[INIT] graph database... done!");
} }
return dataDb; return dataDb;
} }
......
package internalDB; package internalDB;
import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.Scanner; import java.util.Scanner;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import org.biojava.nbio.core.sequence.io.FastaReaderHelper;
import org.biojava.nbio.core.sequence.template.AbstractSequence;
import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship; import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType; import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import biosynth.initializeNeo4jdb; import biosynth.initializeNeo4jdb;
import blast.Blast;
import containers.BiosynthMetabolites; import containers.BiosynthMetabolites;
import enumerators.MetaboliteReferenceDatabaseEnum; import enumerators.MetaboliteReferenceDatabaseEnum;
import files.FilesUtils; import files.FilesUtils;
import files.JSONFilesUtils; import files.JSONFilesUtils;
import pt.uminho.ceb.biosystems.merlin.bioapis.externalAPI.ncbi.CreateGenomeFile;
//import pt.uminho.ceb.biosystems.merlin.local.alignments.core.RunSimilaritySearch;
import pt.uminho.ceb.biosystems.merlin.utilities.Enumerators.AlignmentScoreType;
import pt.uminho.ceb.biosystems.merlin.utilities.Enumerators.Method;
import pt.uminho.ceb.biosystems.merlin.utilities.containers.capsules.AlignmentCapsule;
import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel; import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel;
import pt.uminho.sysbio.biosynth.integration.neo4j.BiodbMetaboliteNode; import pt.uminho.sysbio.biosynth.integration.neo4j.BiodbMetaboliteNode;
import pt.uminho.sysbio.biosynthframework.BiodbGraphDatabaseService; import pt.uminho.sysbio.biosynthframework.BiodbGraphDatabaseService;
...@@ -49,11 +36,12 @@ import utilities.triage_utilities.Utilities; ...@@ -49,11 +36,12 @@ import utilities.triage_utilities.Utilities;
*/ */
public class WriteByMetabolitesID { public class WriteByMetabolitesID {
// private static final Logger logger = LoggerFactory.getLogger(WriteByMetabolitesID.class); private static final Logger logger = LoggerFactory.getLogger(WriteByMetabolitesID.class);
public static void main(String[] args) { public static void main(String[] args) {
try { try {
GraphDatabaseService graphDatabaseService = initializeNeo4jdb.getDataDatabase(null); GraphDatabaseService graphDatabaseService = initializeNeo4jdb.getDataDatabase(null);
Transaction dataTx = graphDatabaseService.beginTx(); Transaction dataTx = graphDatabaseService.beginTx();
...@@ -61,10 +49,7 @@ public class WriteByMetabolitesID { ...@@ -61,10 +49,7 @@ public class WriteByMetabolitesID {
// BiodbGraphDatabaseService service = null; // BiodbGraphDatabaseService service = null;
// logger.info("Retrieving data..."); logger.info("Retrieving data from Biosynth database...");
System.out.println("Retrieving data...");
// logger.trace("salfnafsn");
// Map<String, BiosynthMetaboliteProperties> data = getBiosynthDBData(service); // Map<String, BiosynthMetaboliteProperties> data = getBiosynthDBData(service);
Map<String, BiosynthMetaboliteProperties> data = null; Map<String, BiosynthMetaboliteProperties> data = null;
...@@ -74,7 +59,8 @@ public class WriteByMetabolitesID { ...@@ -74,7 +59,8 @@ public class WriteByMetabolitesID {
// System.out.println("Writing Excel..."); // System.out.println("Writing Excel...");
// WriteExcel.writeNeo4jKeggInfo(data); // WriteExcel.writeNeo4jKeggInfo(data);
System.out.println("Retrieving names..."); logger.info("Retrieving data from Biosynth database by metabolite name...");
BiosynthMetabolites namesAndIDsContainer = getBiosynthDataByName(service, true); //154225 names BiosynthMetabolites namesAndIDsContainer = getBiosynthDataByName(service, true); //154225 names
// BiosynthMetabolites namesAndIDsContainer = null; // BiosynthMetabolites namesAndIDsContainer = null;
...@@ -138,18 +124,18 @@ public class WriteByMetabolitesID { ...@@ -138,18 +124,18 @@ public class WriteByMetabolitesID {
// Map<String, Set<TcNumberContainer2>> newData2 = new HashMap<>(); // Map<String, Set<TcNumberContainer2>> newData2 = new HashMap<>();
// //
// newData2.put("Q8SKU2", newData.get("Q8SKU2")); // newData2.put("P29897", newData.get("P29897"));
// newData2.put("Q9MUK5", newData.get("Q9MUK5")); // newData2.put("C9RT46", newData.get("C9RT46"));
// newData2.put("Q9SC41", newData.get("Q9SC41")); // newData2.put("A8IJF8", newData.get("A8IJF8"));
// newData2.put("O43715", newData.get("O43715")); // newData2.put("A9VJD5", newData.get("A9VJD5"));
// newData2.put("O24303", newData.get("O24303")); // newData2.put("P54854", newData.get("P54854"));
// newData2.put("Q41010", newData.get("Q41010")); // newData2.put("Q93HR7", newData.get("Q93HR7"));
// newData2.put("Q41009", newData.get("Q41009")); // newData2.put("O67092", newData.get("O67092"));
// newData2.put("P0C891", newData.get("P0C891")); // newData2.put("Q9UL62", newData.get("Q9UL62"));
// newData2.put("Q02028", newData.get("Q02028")); // newData2.put("Q9LQZ0", newData.get("Q9LQZ0"));
// newData2.put("O49931", newData.get("O49931")); // newData2.put("O67095", newData.get("O67095"));
// newData2.put("Q9ZST8", newData.get("Q9ZST8")); // newData2.put("P54862", newData.get("P54862"));
// newData2.put("Q9ZST9", newData.get("Q9ZST9")); // newData2.put("P27243", newData.get("P27243"));
new PopulateTriageNeo4jDatabase(newData); new PopulateTriageNeo4jDatabase(newData);
......
package reactions; package reactions;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.Scanner;
import java.util.Set;
import connection.ReadTcdbFastaFile; import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import blast.Blast;
import enumerators.TypeOfTransporter;
import files.ReadExcelFile; import files.ReadExcelFile;
import internalDB.WriteByMetabolitesID;
import javafx.util.Pair;
import pt.uminho.ceb.biosystems.merlin.bioapis.externalAPI.ebi.uniprot.UniProtAPI; import pt.uminho.ceb.biosystems.merlin.bioapis.externalAPI.ebi.uniprot.UniProtAPI;
import pt.uminho.ceb.biosystems.merlin.utilities.containers.capsules.AlignmentCapsule;
import tcdb.capsules.FastaTcdb; import tcdb.capsules.FastaTcdb;
import tcdb.capsules.GeneContainer; import tcdb.capsules.GeneContainer;
import tcdb.capsules.TcdbGene; import tcdb.capsules.ReactionContainer;
import triageDatabase.TriageGeneralProperties;
import triageDatabase.TriageGraphDatabaseService;
import triageDatabase.TriageNeo4jInitializer;
import triageDatabase.TriageNodeLabel;
import triageDatabase.TriageRelationshipType;
import uk.ac.ebi.kraken.interfaces.uniprot.NcbiTaxon; import uk.ac.ebi.kraken.interfaces.uniprot.NcbiTaxon;
import uk.ac.ebi.kraken.interfaces.uniprot.Organism;
import uk.ac.ebi.kraken.interfaces.uniprot.UniProtEntry; import uk.ac.ebi.kraken.interfaces.uniprot.UniProtEntry;