Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TranSyT
transyt-service
Commits
82d3fd82
Commit
82d3fd82
authored
Apr 25, 2020
by
Davide Lagoa
Browse files
transyt debugger improved
parent
5969a426
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
src/main/java/pt/uminho/ceb/biosystems/transyt/service/internalDB/WriteByMetabolitesID.java
View file @
82d3fd82
This diff is collapsed.
Click to expand it.
src/main/java/pt/uminho/ceb/biosystems/transyt/service/kbase/ModelSEEDCompoundsFileReader.java
View file @
82d3fd82
...
...
@@ -8,10 +8,6 @@ import java.util.Set;
import
org.json.simple.JSONObject
;
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
{
/**
...
...
src/main/java/pt/uminho/ceb/biosystems/transyt/service/reactions/TransportReactionsBuilder.java
View file @
82d3fd82
...
...
@@ -448,14 +448,14 @@ public class TransportReactionsBuilder {
boolean
isChild
=
false
;
String
reaction
=
reactionContainer
.
getReaction
()
;
String
reaction
=
reactionContainer
.
getReaction
()
+
" "
;
//important for correct following replacements
reactionBase
=
reaction
Container
.
getReaction
()
;
reactionMetaCyc
=
reaction
Container
.
getReaction
()
;
reactionModelSeed
=
reaction
Container
.
getReaction
()
;
reactionBiGG
=
reaction
Container
.
getReaction
()
;
reactionKEGG
=
reaction
Container
.
getReaction
()
;
String
formulasReaction
=
reaction
Container
.
getReaction
()
;
reactionBase
=
reaction
;
reactionMetaCyc
=
reaction
;
reactionModelSeed
=
reaction
;
reactionBiGG
=
reaction
;
reactionKEGG
=
reaction
;
String
formulasReaction
=
reaction
;
boolean
go
=
true
;
...
...
@@ -473,12 +473,16 @@ public class TransportReactionsBuilder {
if
(
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
{
//PEP dependent
reaction
=
reaction
.
replaceAll
(
replace
+
"\\s+\\("
,
childNames
.
get
(
id
)
+
" \\("
);
reactionBase
=
reactionBase
.
replaceAll
(
replace
+
"\\s+\\("
,
metabolites
.
get
(
id
)
+
" \\("
);
replace
=
replace
+
"\\s+\\("
;
reaction
=
reaction
.
replaceAll
(
replace
,
childNames
.
get
(
id
)
+
" \\("
);
reactionBase
=
reactionBase
.
replaceAll
(
replace
,
metabolites
.
get
(
id
)
+
" \\("
);
}
else
{
reaction
=
reaction
.
replace
(
replace
,
childNames
.
get
(
id
));
reactionBase
=
reactionBase
.
replace
(
replace
,
metabolites
.
get
(
id
));
replace
=
replace
+
" "
;
reaction
=
reaction
.
replace
(
replace
,
childNames
.
get
(
id
)
+
" "
);
reactionBase
=
reactionBase
.
replace
(
replace
,
metabolites
.
get
(
id
)
+
" "
);
}
String
repl
=
""
;
...
...
@@ -489,9 +493,9 @@ public class TransportReactionsBuilder {
repl
=
mappingModelSeed
.
get
(
entryID
);
if
(
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
reactionModelSeed
=
reactionModelSeed
.
replaceAll
(
replace
+
"\\s+\\("
,
repl
+
" \\("
);
reactionModelSeed
=
reactionModelSeed
.
replaceAll
(
replace
,
repl
+
" \\("
);
else
reactionModelSeed
=
reactionModelSeed
.
replace
(
replace
,
repl
);
reactionModelSeed
=
reactionModelSeed
.
replace
(
replace
,
repl
+
" "
);
}
else
{
reactionModelSeed
=
null
;
...
...
@@ -500,9 +504,9 @@ public class TransportReactionsBuilder {
if
(
mappingBiGG
.
containsKey
(
entryID
)
&&
reactionBiGG
!=
null
)
{
repl
=
mappingBiGG
.
get
(
entryID
);
if
(
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
reactionBiGG
=
reactionBiGG
.
replaceAll
(
replace
+
"\\s+\\("
,
repl
+
" \\("
);
reactionBiGG
=
reactionBiGG
.
replaceAll
(
replace
,
repl
+
" \\("
);
else
reactionBiGG
=
reactionBiGG
.
replace
(
replace
,
repl
);
reactionBiGG
=
reactionBiGG
.
replace
(
replace
,
repl
+
" "
);
}
else
{
reactionBiGG
=
null
;
...
...
@@ -511,9 +515,9 @@ public class TransportReactionsBuilder {
if
(
mappingKEGG
.
containsKey
(
entryID
)
&&
reactionKEGG
!=
null
)
{
repl
=
mappingKEGG
.
get
(
entryID
);
if
(
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
reactionKEGG
=
reactionKEGG
.
replaceAll
(
replace
+
"\\s+\\("
,
repl
+
" \\("
);
reactionKEGG
=
reactionKEGG
.
replaceAll
(
replace
,
repl
+
" \\("
);
else
reactionKEGG
=
reactionKEGG
.
replace
(
replace
,
repl
);
reactionKEGG
=
reactionKEGG
.
replace
(
replace
,
repl
+
" "
);
}
else
{
reactionKEGG
=
null
;
...
...
@@ -522,9 +526,9 @@ public class TransportReactionsBuilder {
if
(
mappingMetaCyc
.
containsKey
(
entryID
)
&&
reactionMetaCyc
!=
null
)
{
repl
=
mappingMetaCyc
.
get
(
entryID
);
if
(
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
reactionMetaCyc
=
reactionMetaCyc
.
replaceAll
(
replace
+
"\\s+\\("
,
repl
+
" \\("
);
reactionMetaCyc
=
reactionMetaCyc
.
replaceAll
(
replace
,
repl
+
" \\("
);
else
reactionMetaCyc
=
reactionMetaCyc
.
replace
(
replace
,
repl
);
reactionMetaCyc
=
reactionMetaCyc
.
replace
(
replace
,
repl
+
" "
);
}
else
{
reactionMetaCyc
=
null
;
...
...
@@ -539,11 +543,11 @@ public class TransportReactionsBuilder {
String
previousFormula
=
formulasReaction
;
if
(
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
formulasReaction
=
formulasReaction
.
replaceAll
(
replace
+
"\\s+\\("
,
formulasReaction
=
formulasReaction
.
replaceAll
(
replace
,
formulas
.
get
(
entryID
).
concat
(
"@"
)
+
" \\("
);
else
formulasReaction
=
formulasReaction
.
replace
All
(
replace
,
formulas
.
get
(
entryID
).
concat
(
"@"
));
//@ is added to control if replacements are really happening bacause some names might be like the formula
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
;
...
...
@@ -553,7 +557,7 @@ public class TransportReactionsBuilder {
childNames
.
get
(
id
).
equalsIgnoreCase
(
ReactionContainer
.
LIGHT_NAME
))
||
childNames
.
get
(
id
).
equalsIgnoreCase
(
ReactionContainer
.
ELECTRON_NAME
))
{
formulasReaction
=
formulasReaction
.
replace
(
replace
,
""
);
formulasReaction
=
formulasReaction
.
replace
(
replace
,
"
"
);
}
else
{
formulasReaction
=
null
;
...
...
@@ -590,8 +594,6 @@ public class TransportReactionsBuilder {
String
reactantIDs
=
reactionIDsSplit
[
0
];
String
productIDs
=
reactionIDsSplit
[
1
];
boolean
print
=
false
;
// if(tcNumber.equals("3.A.1.7.1")) {
//
// System.out.println(reaction);
...
...
@@ -615,9 +617,9 @@ public class TransportReactionsBuilder {
// System.out.println(formulasReaction);
//
System.out.println(reactant + " <<>> " + product);
//
System.out.println(reactantIDs + " <<>> " + productIDs);
//
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"
)))
{
...
...
@@ -668,6 +670,8 @@ public class TransportReactionsBuilder {
// System.out.println(reactionContainer.getDirectionRegex());
// System.out.println();
boolean
print
=
false
;
boolean
balanced
=
isEquationBalanced
(
formulasReaction
,
reactionContainer
.
getDirectionRegex
(),
print
);
// System.out.println("balanced: " + balanced);
...
...
@@ -677,12 +681,6 @@ public class TransportReactionsBuilder {
// System.out.println(reactionKEGG);
// 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
;
if
(
balanced
&&
reactionContainer
.
getTransportType
().
equals
(
TypeOfTransporter
.
PEPdependent
))
{
...
...
@@ -1021,6 +1019,7 @@ public class TransportReactionsBuilder {
if
(
print
)
{
System
.
out
.
println
(
reactantsCounts
);
System
.
out
.
println
(
productsCounts
);
System
.
out
.
println
();
}
if
(
reactantsCounts
.
equals
(
productsCounts
))
...
...
src/main/java/pt/uminho/ceb/biosystems/transyt/service/transyt/TransyTestMain.java
View file @
82d3fd82
...
...
@@ -63,7 +63,7 @@ public class TransyTestMain {
logger
.
info
(
"Scraper and database service option selected!"
);
Retriever
.
runRetriever
(
true
);
Retriever
.
runRetriever
(
true
,
true
,
null
);
// WriteByMetabolitesID.start(properties);
break
;
...
...
@@ -72,7 +72,7 @@ public class TransyTestMain {
logger
.
info
(
"Database service option selected!"
);
WriteByMetabolitesID
.
start
(
properties
);
WriteByMetabolitesID
.
start
(
properties
,
true
);
break
;
...
...
src/main/java/pt/uminho/ceb/biosystems/transyt/service/transyt/TransytMain.java
View file @
82d3fd82
...
...
@@ -23,7 +23,7 @@ public class TransytMain {
// 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
];
...
...
@@ -40,8 +40,8 @@ public class TransytMain {
logger
.
info
(
"Scraper and database service option selected!"
);
Retriever
.
runRetriever
(
useCache
);
WriteByMetabolitesID
.
start
(
new
Properties
());
Retriever
.
runRetriever
(
useCache
,
false
,
null
);
WriteByMetabolitesID
.
start
(
new
Properties
()
,
false
);
break
;
...
...
@@ -49,7 +49,7 @@ public class TransytMain {
logger
.
info
(
"Database service option selected!"
);
WriteByMetabolitesID
.
start
(
new
Properties
());
WriteByMetabolitesID
.
start
(
new
Properties
()
,
false
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment