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

coa reactions fixed

parent 82d3fd82
...@@ -155,11 +155,14 @@ public class WriteByMetabolitesID { ...@@ -155,11 +155,14 @@ public class WriteByMetabolitesID {
Map<String, Set<TcNumberContainer2>> reactionsData, Properties properties) { Map<String, Set<TcNumberContainer2>> reactionsData, Properties properties) {
try { try {
Boolean generate = true;
String accession = "P77211";
String accession = "Q56582"; Retriever.runRetriever(true, true, accession);
// Retriever.runRetriever(true, true, accession); if(generate) {
// reactionsData = JSONFilesUtils.readJSONtcdbReactionsFile();
reactionsData = JSONFilesUtils.readJSONtcdbReactionsFile();
Map<String, Set<TcNumberContainer2>> reactionsData2 = new HashMap<>(); Map<String, Set<TcNumberContainer2>> reactionsData2 = new HashMap<>();
String[] accessions = new String[] {accession}; String[] accessions = new String[] {accession};
...@@ -193,12 +196,13 @@ public class WriteByMetabolitesID { ...@@ -193,12 +196,13 @@ public class WriteByMetabolitesID {
System.out.println(); System.out.println();
} }
}
// JSONFilesUtils.writeJSONTriageReactions(newData); // JSONFilesUtils.writeJSONTriageReactions(newData);
System.out.println("Done!!!"); System.out.println("Done!!!");
return newData; return null;
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -266,6 +270,11 @@ public class WriteByMetabolitesID { ...@@ -266,6 +270,11 @@ public class WriteByMetabolitesID {
if(node.hasProperty("formula")) if(node.hasProperty("formula"))
bioSynMetab.setFormula((String) nodeProperties.get("formula")); bioSynMetab.setFormula((String) nodeProperties.get("formula"));
if(entryID.equalsIgnoreCase("cpd03805"))
bioSynMetab.setFormula("C6H11O8P"); //there's an error in the database, it needs to be updated
else if(entryID.equalsIgnoreCase("cpd15391"))
bioSynMetab.setFormula("C11H17NO11P"); //there's an error in the database, it needs to be updated
if(node.hasProperty("remark")) if(node.hasProperty("remark"))
bioSynMetab.setRemark((String) nodeProperties.get("remark")); bioSynMetab.setRemark((String) nodeProperties.get("remark"));
......
...@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory; ...@@ -12,6 +12,7 @@ import org.slf4j.LoggerFactory;
import pt.uminho.ceb.biosystems.transyt.service.containers.BiosynthMetabolites; import pt.uminho.ceb.biosystems.transyt.service.containers.BiosynthMetabolites;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.ReactionContainer; import pt.uminho.ceb.biosystems.transyt.utilities.capsules.ReactionContainer;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcNumberContainer2; import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcNumberContainer2;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcdbMetabolitesContainer;
import pt.uminho.ceb.biosystems.transyt.utilities.dictionary.Synonyms; import pt.uminho.ceb.biosystems.transyt.utilities.dictionary.Synonyms;
import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel; import pt.uminho.sysbio.biosynth.integration.io.dao.neo4j.MetaboliteMajorLabel;
import pt.uminho.sysbio.biosynthframework.BiodbGraphDatabaseService; import pt.uminho.sysbio.biosynthframework.BiodbGraphDatabaseService;
...@@ -423,7 +424,8 @@ public class IdentifyReactionsMetabolites { ...@@ -423,7 +424,8 @@ public class IdentifyReactionsMetabolites {
reactionContainer.getOriginalReaction()}; reactionContainer.getOriginalReaction()};
for(String reaction : reactions) { for(String reaction : reactions) {
for(Entry<String, Set<String>> entry : getMetabolitesToBeReplaced(reaction, dictionary).entrySet()) { for(Entry<String, Set<String>> entry : getMetabolitesToBeReplaced(reaction,
dictionary, reactionContainer.isCombineSameMetabolite()).entrySet()) {
if(metabolites.containsKey(entry.getKey())) if(metabolites.containsKey(entry.getKey()))
metabolites.get(entry.getKey()).addAll(entry.getValue()); metabolites.get(entry.getKey()).addAll(entry.getValue());
else else
...@@ -443,7 +445,7 @@ public class IdentifyReactionsMetabolites { ...@@ -443,7 +445,7 @@ public class IdentifyReactionsMetabolites {
* @param dictionary * @param dictionary
* @return * @return
*/ */
public static Set<String> getMetabolitesFromReaction(String reaction, Synonyms dictionary){ public static Set<String> getMetabolitesFromReaction(String reaction, Synonyms dictionary, boolean combineWithItself){
Set<String> metabolites = new HashSet<>(); Set<String> metabolites = new HashSet<>();
...@@ -460,9 +462,16 @@ public class IdentifyReactionsMetabolites { ...@@ -460,9 +462,16 @@ public class IdentifyReactionsMetabolites {
metab = metab.replaceAll("^(\\+\\s)", "").trim(); metab = metab.replaceAll("^(\\+\\s)", "").trim();
if(!metab.isEmpty()) if(!metab.isEmpty()) {
if(combineWithItself) {
if(!metab.endsWith(TcdbMetabolitesContainer.SAME_METABOLITE_COMBINATION_SUFFIX))
metabolites.add(metab); metabolites.add(metab);
} }
else {
metabolites.add(metab);
}
}
}
return metabolites; return metabolites;
} }
...@@ -473,9 +482,9 @@ public class IdentifyReactionsMetabolites { ...@@ -473,9 +482,9 @@ public class IdentifyReactionsMetabolites {
* @param reaction * @param reaction
* @return * @return
*/ */
public static Map<String, Set<String>> getMetabolitesToBeReplaced(String reaction, Synonyms dictionary){ public static Map<String, Set<String>> getMetabolitesToBeReplaced(String reaction, Synonyms dictionary, boolean combineWithItself){
Set<String> metabolites = getMetabolitesFromReaction(reaction, dictionary); Set<String> metabolites = getMetabolitesFromReaction(reaction, dictionary, combineWithItself);
// System.out.println(metabolites); // System.out.println(metabolites);
......
...@@ -25,6 +25,7 @@ import pt.uminho.ceb.biosystems.transyt.service.utilities.MappingMetabolites; ...@@ -25,6 +25,7 @@ import pt.uminho.ceb.biosystems.transyt.service.utilities.MappingMetabolites;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.BiosynthMetaboliteProperties; import pt.uminho.ceb.biosystems.transyt.utilities.capsules.BiosynthMetaboliteProperties;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.ReactionContainer; import pt.uminho.ceb.biosystems.transyt.utilities.capsules.ReactionContainer;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcNumberContainer2; import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcNumberContainer2;
import pt.uminho.ceb.biosystems.transyt.utilities.capsules.TcdbMetabolitesContainer;
import pt.uminho.ceb.biosystems.transyt.utilities.dictionary.Synonyms; import pt.uminho.ceb.biosystems.transyt.utilities.dictionary.Synonyms;
import pt.uminho.ceb.biosystems.transyt.utilities.enumerators.Enumerators.TypeOfTransporter; import pt.uminho.ceb.biosystems.transyt.utilities.enumerators.Enumerators.TypeOfTransporter;
import pt.uminho.ceb.biosystems.transyt.utilities.enumerators.MetaboliteReferenceDatabaseEnum; import pt.uminho.ceb.biosystems.transyt.utilities.enumerators.MetaboliteReferenceDatabaseEnum;
...@@ -51,14 +52,19 @@ public class TransportReactionsBuilder { ...@@ -51,14 +52,19 @@ public class TransportReactionsBuilder {
private Map<String, Map<MetaboliteMajorLabel, String>> allMetabolitesIDs; private Map<String, Map<MetaboliteMajorLabel, String>> allMetabolitesIDs;
private MetaboliteMajorLabel defaultLabel; private MetaboliteMajorLabel defaultLabel;
private String reaction;
private String reactionBase; private String reactionBase;
private String reactionMetaCyc; private String reactionMetaCyc;
private String reactionModelSeed; private String reactionModelSeed;
private String reactionBiGG; private String reactionBiGG;
private String reactionKEGG; private String reactionKEGG;
private String formulasReaction;
private Properties properties; private Properties properties;
private boolean go;
private boolean isChild;
public static final List<String> ELEMENTS_EXCEPTIONS = List.of("Ac", "Ar", "As", "Au", "Ba", "Be", public static final List<String> ELEMENTS_EXCEPTIONS = List.of("Ac", "Ar", "As", "Au", "Ba", "Be",
"Ca", "Cd", "Ce", "Cm", "Cu", "Db", "Es", "Eu", "He", "Hg", "Fe", "Fm", "Ca", "Cd", "Ce", "Cm", "Cu", "Db", "Es", "Eu", "He", "Hg", "Fe", "Fm",
"Li", "Lu", "Mn", "Mo", "Na", "Nb", "Nd", "Ne", "Pa", "Pd", "Pm", "Li", "Lu", "Mn", "Mo", "Na", "Nb", "Nd", "Ne", "Pa", "Pd", "Pm",
...@@ -169,14 +175,15 @@ public class TransportReactionsBuilder { ...@@ -169,14 +175,15 @@ public class TransportReactionsBuilder {
ReactionContainer reactionContainer = tcContainer.getReactionContainer(key); ReactionContainer reactionContainer = tcContainer.getReactionContainer(key);
Map<String, Set<String>> metabolitesForReplacement = IdentifyReactionsMetabolites.getMetabolitesToBeReplaced(reactionContainer.getReaction(), dictionary); Map<String, Set<String>> metabolitesForReplacement = IdentifyReactionsMetabolites.getMetabolitesToBeReplaced(reactionContainer.getReaction(),
dictionary, reactionContainer.isCombineSameMetabolite());
// System.out.println(metabolitesForReplacement); // System.out.println(metabolitesForReplacement);
Set<String> originalMetabolites = new HashSet<>(); Set<String> originalMetabolites = new HashSet<>();
if(originalMetabolites.isEmpty()) if(originalMetabolites.isEmpty())
originalMetabolites =IdentifyReactionsMetabolites.getMetabolitesFromReaction(reactionContainer.getOriginalReaction(), dictionary); originalMetabolites =IdentifyReactionsMetabolites.getMetabolitesFromReaction(reactionContainer.getOriginalReaction(), dictionary, false);
if(!originalMetabolites.isEmpty() && !(originalMetabolites.size() == 1 && originalMetabolites.contains(BiosynthMetaboliteProperties.NONE))) { if(!originalMetabolites.isEmpty() && !(originalMetabolites.size() == 1 && originalMetabolites.contains(BiosynthMetaboliteProperties.NONE))) {
for(String originalM : new HashSet<>(originalMetabolites)) { for(String originalM : new HashSet<>(originalMetabolites)) {
...@@ -326,7 +333,7 @@ public class TransportReactionsBuilder { ...@@ -326,7 +333,7 @@ public class TransportReactionsBuilder {
if(allReactions != null) { if(allReactions != null) {
if(commonOntologyMetabolites != null) { if(commonOntologyMetabolites != null) {
List<Set<String>> distributions = DistributionsAlgorithm.getAllDistributions(commonOntologyMetabolites); List<Set<String>> distributions = DistributionsAlgorithm.getAllDistributions(commonOntologyMetabolites, reactionContainer.isCombineSameMetabolite());
Map<ReactionContainer, Boolean> reactionsGenerated = generateAllPossibleReactions(distributions, reverseKeys, childNames, metabolites, formulas, Map<ReactionContainer, Boolean> reactionsGenerated = generateAllPossibleReactions(distributions, reverseKeys, childNames, metabolites, formulas,
reactionContainer, tcContainer.getTcNumber(), metabolitesForReplacement, mainMetabolites, defaultLabel); reactionContainer, tcContainer.getTcNumber(), metabolitesForReplacement, mainMetabolites, defaultLabel);
...@@ -344,7 +351,7 @@ public class TransportReactionsBuilder { ...@@ -344,7 +351,7 @@ public class TransportReactionsBuilder {
} }
} }
List<Set<String>> distributions = DistributionsAlgorithm.getAllDistributions(sets); List<Set<String>> distributions = DistributionsAlgorithm.getAllDistributions(sets, reactionContainer.isCombineSameMetabolite());
Map<ReactionContainer, Boolean> reactionsGenerated = generateAllPossibleReactions(distributions, reverseKeys, childNames, metabolites, formulas, Map<ReactionContainer, Boolean> reactionsGenerated = generateAllPossibleReactions(distributions, reverseKeys, childNames, metabolites, formulas,
reactionContainer, tcContainer.getTcNumber(), metabolitesForReplacement, mainMetabolites, defaultLabel); reactionContainer, tcContainer.getTcNumber(), metabolitesForReplacement, mainMetabolites, defaultLabel);
...@@ -446,137 +453,39 @@ public class TransportReactionsBuilder { ...@@ -446,137 +453,39 @@ public class TransportReactionsBuilder {
for(Set<String> distribution : distributions) { for(Set<String> distribution : distributions) {
boolean isChild = false; this.isChild = false;
String reaction = reactionContainer.getReaction() + " "; //important for correct following replacements reaction = reactionContainer.getReaction() + " "; //important for correct following replacements
reactionBase = reaction; reactionBase = reaction;
reactionMetaCyc = reaction; reactionMetaCyc = reaction;
reactionModelSeed = reaction; reactionModelSeed = reaction;
reactionBiGG = reaction; reactionBiGG = reaction;
reactionKEGG = reaction; reactionKEGG = reaction;
String formulasReaction = reaction; formulasReaction = reaction;
boolean go = true;
for(String id : distribution) {
if(metabolites.get(id).contains("=") && MetaboliteMajorLabel.valueOf(metabolites.get(id).split("=")[1]).equals(defaultLabel) && metabolitesForReplacement.size() == distribution.size()) {
if(!mainMetabolites.contains(id))
isChild = true;
// System.out.println(metabolitesForReplacement);
// System.out.println("reverse" + metabolitesForReplacement.get(reverseKeys.get(id)));
for(String replace : metabolitesForReplacement.get(reverseKeys.get(id))) {
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) { //PEP dependent
replace = replace + "\\s+\\(";
reaction = reaction.replaceAll(replace, childNames.get(id) + " \\(");
reactionBase = reactionBase.replaceAll(replace, metabolites.get(id) + " \\(");
}
else {
replace = replace + " ";
reaction = reaction.replace(replace, childNames.get(id) + " ");
reactionBase = reactionBase.replace(replace, metabolites.get(id) + " ");
}
String repl = "";
String entryID = metabolites.get(id).split("=")[0];
if(mappingModelSeed.containsKey(entryID) && reactionModelSeed != null) { this.go = true;
repl = mappingModelSeed.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) Set<String> metabolitesToReplace = new HashSet<>();
reactionModelSeed = reactionModelSeed.replaceAll(replace, repl + " \\(");
else
reactionModelSeed = reactionModelSeed.replace(replace, repl + " ");
}
else {
reactionModelSeed = null;
}
if(mappingBiGG.containsKey(entryID) && reactionBiGG != null) {
repl = mappingBiGG.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionBiGG = reactionBiGG.replaceAll(replace, repl + " \\(");
else
reactionBiGG = reactionBiGG.replace(replace, repl+ " ");
}
else {
reactionBiGG = null;
}
if(mappingKEGG.containsKey(entryID) && reactionKEGG != null) { for(String id : distribution) {
repl = mappingKEGG.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionKEGG = reactionKEGG.replaceAll(replace, repl + " \\(");
else
reactionKEGG = reactionKEGG.replace(replace, repl+ " ");
}
else {
reactionKEGG = null;
}
if(mappingMetaCyc.containsKey(entryID) && reactionMetaCyc != null) {
repl = mappingMetaCyc.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionMetaCyc = reactionMetaCyc.replaceAll(replace, repl + " \\(");
else
reactionMetaCyc = reactionMetaCyc.replace(replace, repl + " ");
}
else {
reactionMetaCyc = null;
}
metabolitesMapByName.put(childNames.get(id), metabolites.get(id));
metabolitesMapById.put(metabolites.get(id).split("=")[0], childNames.get(id));
if(formulasReaction != null && formulas.containsKey(entryID) && formulas.get(entryID) != null
&& !formulas.get(entryID).equals(BiosynthMetaboliteProperties.NONE)) {
String previousFormula = formulasReaction;
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
formulasReaction = formulasReaction.replaceAll(replace,
formulas.get(entryID).concat("@") + " \\(");
else
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
if(formulasReaction.equals(previousFormula))
formulasReaction = null;
} if(reactionContainer.isCombineSameMetabolite() && distribution.size() < 2)
else if((reactionContainer.getTransportType().equals(TypeOfTransporter.Light) && this.go = false;
childNames.get(id).equalsIgnoreCase(ReactionContainer.LIGHT_NAME)) || else if(go)
childNames.get(id).equalsIgnoreCase(ReactionContainer.ELECTRON_NAME)) { executeSubstitutions(id, metabolitesToReplace, reactionContainer, distribution,
childNames, metabolites, metabolitesForReplacement, metabolitesMapById,
metabolitesMapByName, reverseKeys, mainMetabolites, formulas);
formulasReaction = formulasReaction.replace(replace, " ");
}
else {
formulasReaction = null;
}
}
}
else {
go = false;
break;
}
} }
String[] res = reaction.replace(ReactionContainer.EXTERIOR_COMPARTMENT_TOKEN, "").replace(ReactionContainer.INTERIOR_COMPARTMENT_TOKEN, "") String[] res = reaction.replace(ReactionContainer.EXTERIOR_COMPARTMENT_TOKEN, "").replace(ReactionContainer.INTERIOR_COMPARTMENT_TOKEN, "")
.split(reactionContainer.getDirectionRegex()); .split(reactionContainer.getDirectionRegex());
if(go) if(this.go)
go = areCompoundsRepeated(res[0]) && areCompoundsRepeated(res[1]); //check if the same metabolite is twice+ in the reaction this.go = areCompoundsNotRepeated(res[0]) && areCompoundsNotRepeated(res[1]); //check if the same metabolite is twice+ in the reaction
if(go && formulasReaction != null) { if(this.go && formulasReaction != null) {
// System.out.println(reaction); // System.out.println(reaction);
// System.out.println(reactionBase); // System.out.println(reactionBase);
...@@ -617,10 +526,6 @@ public class TransportReactionsBuilder { ...@@ -617,10 +526,6 @@ public class TransportReactionsBuilder {
// System.out.println(formulasReaction); // System.out.println(formulasReaction);
System.out.println(reactant + " <<>> " + product);
System.out.println(reactantIDs + " <<>> " + productIDs);
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"))) {
newTransportType = TypeOfTransporter.BiochemicalATP; newTransportType = TypeOfTransporter.BiochemicalATP;
...@@ -670,7 +575,13 @@ public class TransportReactionsBuilder { ...@@ -670,7 +575,13 @@ public class TransportReactionsBuilder {
// System.out.println(reactionContainer.getDirectionRegex()); // System.out.println(reactionContainer.getDirectionRegex());
// System.out.println(); // System.out.println();
boolean print = false; boolean print = true;
if(print) {
System.out.println(reactant + " <<>> " + product);
System.out.println(reactantIDs + " <<>> " + productIDs);
System.out.println(formulasReaction);
}
boolean balanced = isEquationBalanced(formulasReaction, reactionContainer.getDirectionRegex(), print); boolean balanced = isEquationBalanced(formulasReaction, reactionContainer.getDirectionRegex(), print);
...@@ -757,6 +668,138 @@ public class TransportReactionsBuilder { ...@@ -757,6 +668,138 @@ public class TransportReactionsBuilder {
return reactionsGenerated; return reactionsGenerated;
} }
public void executeSubstitutions(String id, Set<String> metabolitesToReplace, ReactionContainer reactionContainer, Set<String> distribution,
Map<String, String> childNames, Map<String, String> metabolites, Map<String, Set<String>> metabolitesForReplacement,
Map<String, String> metabolitesMapById, Map<String, String> metabolitesMapByName, Map<String, String> reverseKeys,
Set<String> mainMetabolites, Map<String, String> formulas) {
if(metabolites.get(id).contains("=") && MetaboliteMajorLabel.valueOf(metabolites.get(id).split("=")[1]).equals(defaultLabel)
&& (metabolitesForReplacement.size() == distribution.size() || reactionContainer.isCombineSameMetabolite())) {
if(!mainMetabolites.contains(id))
isChild = true;
// System.out.println(metabolitesForReplacement);
// System.out.println("reverse" + metabolitesForReplacement.get(reverseKeys.get(id)));
if(metabolitesToReplace.isEmpty()) {
for(String s : metabolitesForReplacement.get(reverseKeys.get(id))) {
metabolitesToReplace.add(s); //deep copy
if(reactionContainer.isCombineSameMetabolite())
metabolitesToReplace.add(s.concat(TcdbMetabolitesContainer.SAME_METABOLITE_COMBINATION_SUFFIX));
}
}
String replace = metabolitesToReplace.iterator().next();
metabolitesToReplace.remove(replace);
// for(String replace : metabolitesToReplace) {
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent)) { //PEP dependent
replace = replace + "\\s+\\(";
reaction = reaction.replaceAll(replace, childNames.get(id) + " \\(");
reactionBase = reactionBase.replaceAll(replace, metabolites.get(id) + " \\(");
}
else {
replace = replace + " ";
reaction = reaction.replace(replace, childNames.get(id) + " ");
reactionBase = reactionBase.replace(replace, metabolites.get(id) + " ");
}
String repl = "";
String entryID = metabolites.get(id).split("=")[0];
if(mappingModelSeed.containsKey(entryID) && reactionModelSeed != null) {
repl = mappingModelSeed.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionModelSeed = reactionModelSeed.replaceAll(replace, repl + " \\(");
else
reactionModelSeed = reactionModelSeed.replace(replace, repl + " ");
}
else {
reactionModelSeed = null;
}
if(mappingBiGG.containsKey(entryID) && reactionBiGG != null) {
repl = mappingBiGG.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionBiGG = reactionBiGG.replaceAll(replace, repl + " \\(");
else
reactionBiGG = reactionBiGG.replace(replace, repl+ " ");
}
else {
reactionBiGG = null;
}
if(mappingKEGG.containsKey(entryID) && reactionKEGG != null) {
repl = mappingKEGG.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionKEGG = reactionKEGG.replaceAll(replace, repl + " \\(");
else
reactionKEGG = reactionKEGG.replace(replace, repl+ " ");
}
else {
reactionKEGG = null;
}
if(mappingMetaCyc.containsKey(entryID) && reactionMetaCyc != null) {
repl = mappingMetaCyc.get(entryID);
if(reactionContainer.getTransportType().equals(TypeOfTransporter.PEPdependent))
reactionMetaCyc = reactionMetaCyc.replaceAll(replace, repl + " \\(");
else
reactionMetaCyc = reactionMetaCyc.replace(replace, repl + " ");
}
else {
reactionMetaCyc = null;
}
metabolitesMapByName.put(childNames.get(id), metabolites.get(id));
metabolitesMapById.put(metabolites.get(id).split("=")[0], childNames.get(id));
if(formulasReaction != null && formulas.containsKey(entryID) && formulas.get(entryID) != null
&& !formulas.get(entryID).equals(BiosynthMetaboliteProperties.NONE)) {
String previousFormula = formulasReaction;