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

transyt debugger improved

parent 5969a426
...@@ -8,10 +8,6 @@ import java.util.Set; ...@@ -8,10 +8,6 @@ import java.util.Set;
import org.json.simple.JSONObject; import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser; import org.json.simple.parser.JSONParser;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.ReactionContainer;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcNumberContainer;
import pt.uminho.ceb.biosystems.transyt.utilities.enumerators.Enumerators.TypeOfTransporter;
public class ModelSEEDCompoundsFileReader { public class ModelSEEDCompoundsFileReader {
/** /**
......
...@@ -448,14 +448,14 @@ public class TransportReactionsBuilder { ...@@ -448,14 +448,14 @@ public class TransportReactionsBuilder {
boolean isChild = false; boolean isChild = false;
String reaction = reactionContainer.getReaction(); String reaction = reactionContainer.getReaction() + " "; //important for correct following replacements
reactionBase = reactionContainer.getReaction(); reactionBase = reaction;
reactionMetaCyc = reactionContainer.getReaction(); reactionMetaCyc = reaction;
reactionModelSeed = reactionContainer.getReaction(); reactionModelSeed = reaction;
reactionBiGG = reactionContainer.getReaction(); reactionBiGG = reaction;
reactionKEGG = reactionContainer.getReaction(); reactionKEGG = reaction;
String formulasReaction = reactionContainer.getReaction(); String formulasReaction = reaction;
boolean go = true; boolean go = true;
...@@ -473,12 +473,16 @@ public class TransportReactionsBuilder { ...@@ -473,12 +473,16 @@ public class TransportReactionsBuilder {
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) { //PEP dependent if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) { //PEP dependent
reaction = reaction.replaceAll(replace + "\\s+\\(", childNames.get(id) + " \\("); replace = replace + "\\s+\\(";
reactionBase = reactionBase.replaceAll(replace + "\\s+\\(", metabolites.get(id) + " \\(");
reaction = reaction.replaceAll(replace, childNames.get(id) + " \\(");
reactionBase = reactionBase.replaceAll(replace, metabolites.get(id) + " \\(");
} }
else { else {
reaction = reaction.replace(replace, childNames.get(id)); replace = replace + " ";
reactionBase = reactionBase.replace(replace, metabolites.get(id));
reaction = reaction.replace(replace, childNames.get(id) + " ");
reactionBase = reactionBase.replace(replace, metabolites.get(id) + " ");
} }
String repl = ""; String repl = "";
...@@ -489,9 +493,9 @@ public class TransportReactionsBuilder { ...@@ -489,9 +493,9 @@ public class TransportReactionsBuilder {
repl = mappingModelSeed.get(entryID); repl = mappingModelSeed.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionModelSeed = reactionModelSeed.replaceAll(replace + "\\s+\\(", repl + " \\("); reactionModelSeed = reactionModelSeed.replaceAll(replace, repl + " \\(");
else else
reactionModelSeed = reactionModelSeed.replace(replace, repl); reactionModelSeed = reactionModelSeed.replace(replace, repl + " ");
} }
else { else {
reactionModelSeed = null; reactionModelSeed = null;
...@@ -500,9 +504,9 @@ public class TransportReactionsBuilder { ...@@ -500,9 +504,9 @@ public class TransportReactionsBuilder {
if(mappingBiGG.containsKey(entryID) && reactionBiGG != null) { if(mappingBiGG.containsKey(entryID) && reactionBiGG != null) {
repl = mappingBiGG.get(entryID); repl = mappingBiGG.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionBiGG = reactionBiGG.replaceAll(replace + "\\s+\\(", repl + " \\("); reactionBiGG = reactionBiGG.replaceAll(replace, repl + " \\(");
else else
reactionBiGG = reactionBiGG.replace(replace, repl); reactionBiGG = reactionBiGG.replace(replace, repl+ " ");
} }
else { else {
reactionBiGG = null; reactionBiGG = null;
...@@ -511,9 +515,9 @@ public class TransportReactionsBuilder { ...@@ -511,9 +515,9 @@ public class TransportReactionsBuilder {
if(mappingKEGG.containsKey(entryID) && reactionKEGG != null) { if(mappingKEGG.containsKey(entryID) && reactionKEGG != null) {
repl = mappingKEGG.get(entryID); repl = mappingKEGG.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionKEGG = reactionKEGG.replaceAll(replace + "\\s+\\(", repl + " \\("); reactionKEGG = reactionKEGG.replaceAll(replace, repl + " \\(");
else else
reactionKEGG = reactionKEGG.replace(replace, repl); reactionKEGG = reactionKEGG.replace(replace, repl+ " ");
} }
else { else {
reactionKEGG = null; reactionKEGG = null;
...@@ -522,9 +526,9 @@ public class TransportReactionsBuilder { ...@@ -522,9 +526,9 @@ public class TransportReactionsBuilder {
if(mappingMetaCyc.containsKey(entryID) && reactionMetaCyc != null) { if(mappingMetaCyc.containsKey(entryID) && reactionMetaCyc != null) {
repl = mappingMetaCyc.get(entryID); repl = mappingMetaCyc.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionMetaCyc = reactionMetaCyc.replaceAll(replace + "\\s+\\(", repl + " \\("); reactionMetaCyc = reactionMetaCyc.replaceAll(replace, repl + " \\(");
else else
reactionMetaCyc = reactionMetaCyc.replace(replace, repl); reactionMetaCyc = reactionMetaCyc.replace(replace, repl + " ");
} }
else { else {
reactionMetaCyc = null; reactionMetaCyc = null;
...@@ -539,11 +543,11 @@ public class TransportReactionsBuilder { ...@@ -539,11 +543,11 @@ public class TransportReactionsBuilder {
String previousFormula = formulasReaction; String previousFormula = formulasReaction;
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
formulasReaction = formulasReaction.replaceAll(replace + "\\s+\\(", formulasReaction = formulasReaction.replaceAll(replace,
formulas.get(entryID).concat("@") + " \\("); formulas.get(entryID).concat("@") + " \\(");
else else
formulasReaction = formulasReaction.replaceAll(replace, formulasReaction = formulasReaction.replace(replace,
formulas.get(entryID).concat("@")); //@ is added to control if replacements are really happening bacause some names might be like the formula formulas.get(entryID).concat("@") + " "); //@ is added to control if replacements are really happening bacause some names might be like the formula
if(formulasReaction.equals(previousFormula)) if(formulasReaction.equals(previousFormula))
formulasReaction = null; formulasReaction = null;
...@@ -553,7 +557,7 @@ public class TransportReactionsBuilder { ...@@ -553,7 +557,7 @@ public class TransportReactionsBuilder {
childNames.get(id).equalsIgnoreCase(ReactionContainer.LIGHT_NAME)) || childNames.get(id).equalsIgnoreCase(ReactionContainer.LIGHT_NAME)) ||
childNames.get(id).equalsIgnoreCase(ReactionContainer.ELECTRON_NAME)) { childNames.get(id).equalsIgnoreCase(ReactionContainer.ELECTRON_NAME)) {
formulasReaction = formulasReaction.replace(replace, ""); formulasReaction = formulasReaction.replace(replace, " ");
} }
else { else {
formulasReaction = null; formulasReaction = null;
...@@ -590,8 +594,6 @@ public class TransportReactionsBuilder { ...@@ -590,8 +594,6 @@ public class TransportReactionsBuilder {
String reactantIDs = reactionIDsSplit[0]; String reactantIDs = reactionIDsSplit[0];
String productIDs = reactionIDsSplit[1]; String productIDs = reactionIDsSplit[1];
boolean print = false;
// if(tcNumber.equals("3.A.1.7.1")) { // if(tcNumber.equals("3.A.1.7.1")) {
// //
// System.out.println(reaction); // System.out.println(reaction);
...@@ -615,9 +617,9 @@ public class TransportReactionsBuilder { ...@@ -615,9 +617,9 @@ public class TransportReactionsBuilder {
// System.out.println(formulasReaction); // System.out.println(formulasReaction);
// System.out.println(reactant + " <<>> " + product); System.out.println(reactant + " <<>> " + product);
// System.out.println(reactantIDs + " <<>> " + productIDs); System.out.println(reactantIDs + " <<>> " + productIDs);
// System.out.println(formulasReaction); System.out.println(formulasReaction);
if((reactant.contains("ATP") && product.contains("ADP")) || (reactant.contains("GTP") && product.contains("GDP"))) { if((reactant.contains("ATP") && product.contains("ADP")) || (reactant.contains("GTP") && product.contains("GDP"))) {
...@@ -668,6 +670,8 @@ public class TransportReactionsBuilder { ...@@ -668,6 +670,8 @@ public class TransportReactionsBuilder {
// System.out.println(reactionContainer.getDirectionRegex()); // System.out.println(reactionContainer.getDirectionRegex());
// System.out.println(); // System.out.println();
boolean print = false;
boolean balanced = isEquationBalanced(formulasReaction, reactionContainer.getDirectionRegex(), print); boolean balanced = isEquationBalanced(formulasReaction, reactionContainer.getDirectionRegex(), print);
// System.out.println("balanced: " + balanced); // System.out.println("balanced: " + balanced);
...@@ -677,12 +681,6 @@ public class TransportReactionsBuilder { ...@@ -677,12 +681,6 @@ public class TransportReactionsBuilder {
// System.out.println(reactionKEGG); // System.out.println(reactionKEGG);
// System.out.println(); // System.out.println();
// if(idsReaction.contains("META:BUTYRIC_ACID=MetaCyc (out) + META:CO-A=MetaCyc (in) + META:ATP=MetaCyc (in) $IRREV$ META:BU"))
// System.out.println(balanced);
// if(tcNumber.equals("3.A.1.7.1"))
// System.out.println("balanceada " + "\t" + balanced);
boolean sugarPEPcorrect = true; boolean sugarPEPcorrect = true;
if(balanced && reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) { if(balanced && reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) {
...@@ -1021,6 +1019,7 @@ public class TransportReactionsBuilder { ...@@ -1021,6 +1019,7 @@ public class TransportReactionsBuilder {
if(print) { if(print) {
System.out.println(reactantsCounts); System.out.println(reactantsCounts);
System.out.println(productsCounts); System.out.println(productsCounts);
System.out.println();
} }
if(reactantsCounts.equals(productsCounts)) if(reactantsCounts.equals(productsCounts))
......
...@@ -63,7 +63,7 @@ public class TransyTestMain { ...@@ -63,7 +63,7 @@ public class TransyTestMain {
logger.info("Scraper and database service option selected!"); logger.info("Scraper and database service option selected!");
Retriever.runRetriever(true); Retriever.runRetriever(true, true, null);
// WriteByMetabolitesID.start(properties); // WriteByMetabolitesID.start(properties);
break; break;
...@@ -72,7 +72,7 @@ public class TransyTestMain { ...@@ -72,7 +72,7 @@ public class TransyTestMain {
logger.info("Database service option selected!"); logger.info("Database service option selected!");
WriteByMetabolitesID.start(properties); WriteByMetabolitesID.start(properties, true);
break; break;
......
...@@ -23,7 +23,7 @@ public class TransytMain { ...@@ -23,7 +23,7 @@ public class TransytMain {
// Integer taxID = Integer.valueOf(args[0]); // Integer taxID = Integer.valueOf(args[0]);
logger.info("############################################ TranSyT - v0.0.12.4-SNAPSHOT ############################################"); logger.info("############################################ TranSyT - v0.0.12.6-SNAPSHOT ############################################");
String command = args[0]; String command = args[0];
...@@ -40,8 +40,8 @@ public class TransytMain { ...@@ -40,8 +40,8 @@ public class TransytMain {
logger.info("Scraper and database service option selected!"); logger.info("Scraper and database service option selected!");
Retriever.runRetriever(useCache); Retriever.runRetriever(useCache, false, null);
WriteByMetabolitesID.start(new Properties()); WriteByMetabolitesID.start(new Properties(), false);
break; break;
...@@ -49,7 +49,7 @@ public class TransytMain { ...@@ -49,7 +49,7 @@ public class TransytMain {
logger.info("Database service option selected!"); logger.info("Database service option selected!");
WriteByMetabolitesID.start(new Properties()); WriteByMetabolitesID.start(new Properties(), false);
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment