Commit c3886952 authored by maxchaza's avatar maxchaza
Browse files

no message

parent 6178be54
......@@ -5,7 +5,7 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<artifactId>met4j-chemUtils</artifactId>
......@@ -33,7 +33,7 @@
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
</dependencies>
</project>
......@@ -5,7 +5,7 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<artifactId>met4j-core</artifactId>
......
......@@ -211,7 +211,8 @@ public class Merger {
for(String rId : reactionToRemove){
bn.removeBioChemicalReaction(rId);
}
System.out.println("no transp graph : "+ bn.getBiochemicalReactionList().size());
return reactionToRemove.size();
}
......@@ -231,7 +232,15 @@ public class Merger {
//add reaction to the to-be-removed list
reactionToRemove.add(r.getId());
//update compounds links to reactions
BioChemicalReaction choosenOne = uniqReaction.get(hash);
for (String key : r.getPathwayList().keySet()) {
if (!choosenOne.getPathwayList().containsKey(key)) {
choosenOne.addPathway(r.getPathwayList().get(key));
}
}
for(BioPhysicalEntity e : r.getListOfSubstrates().values()){
e.getReactionsAsSubstrate().remove(r.getId());
e.getReactionsAsSubstrate().put(choosenOne.getId(), choosenOne);
......@@ -246,7 +255,40 @@ public class Merger {
for(String rId :reactionToRemove){
bn.removeBioChemicalReaction(rId);
}
int nbReac = uniqReaction.size();
int indexReac = 0;
int nbOverlap= 0;
System.err.println("nbReac : " + nbReac);
System.err.println("{\"reactions\":[");
for(Integer key : uniqReaction.keySet()){
System.err.print("{");
System.err.print("\"id\" : \""+uniqReaction.get(key).getId()+"\",");
int nbPath = uniqReaction.get(key).getPathwayList().keySet().size();
int indexPath = 0;
System.err.print("\"pathways\" : [");
for(String pathName : uniqReaction.get(key).getPathwayList().keySet())
{
if(indexPath==2)nbOverlap++;
System.err.print("\""+pathName+"\"");
if(nbPath-1!=indexPath)
System.err.print(", ");
indexPath++;
}
System.err.print("]}");
if(nbReac-1!=indexReac)
System.err.println(",");
indexReac++;
}
System.err.println("]}");
System.err.println("nbOverlap : " + nbOverlap);
System.out.println("no compartment graph : "+ bn.getBiochemicalReactionList().size());
return reactionToRemove.size();
}
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<artifactId>met4j-cytoscape</artifactId>
<name>met4j-cytoscape</name>
......@@ -18,7 +18,7 @@
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<artifactId>met4j-graph</artifactId>
......@@ -35,7 +35,7 @@
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
......@@ -45,12 +45,12 @@
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-mathUtils</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-chemUtils</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
</dependencies>
</project>
......@@ -5,7 +5,7 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<artifactId>met4j-mathUtils</artifactId>
......
......@@ -5,12 +5,12 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-report</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
<packaging>jar</packaging>
<name>met4j-report</name>
......
......@@ -5,7 +5,7 @@
<parent>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</parent>
<artifactId>met4j-toolbox</artifactId>
......@@ -28,17 +28,17 @@
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-chemUtils</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
<dependency>
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j-graph</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.kohsuke.args4j/args4j-maven-plugin -->
<dependency>
......
......@@ -86,19 +86,22 @@ public class RemoveCompartmentalization {
sbml2BioNetworkLite.addDefaultRefHandlers();
this.model = sbml2BioNetworkLite.getBioNetwork();
this.model = Merger.mergeCompartmentFromId(this.model, "^(.+)_\\w$");
System.out.println("nb reac : "+ this.model.getBiochemicalReactionList().size());
Merger.mergeReactions(this.model);
int nbRemove = Merger.mergeReactions(this.model);
System.out.println(nbRemove);
Merger.removeTransport(this.model);
nbRemove = Merger.removeTransport(this.model);
System.out.println(nbRemove);
String flatFileName = fileIn.getPath().substring(0, fileIn.getPath().length() - 4)+"_Flat.xml";
BioNetworkToJSBML bioNetworkToJSBML = new BioNetworkToJSBML(this.model, flatFileName);
bioNetworkToJSBML.write();
System.out.println("Nb reac : "+ this.model.getBiochemicalReactionList().size());
Sbml2SbmlGeneAnnotation sbml2SbmlGeneAnnotation = new Sbml2SbmlGeneAnnotation(fileIn.getPath(), flatFileName);
sbml2SbmlGeneAnnotation.build();
System.err.println(fileIn.getPath().substring(0, fileIn.getPath().length() - 4)+"_Flat.xml");
}
......
......@@ -4,7 +4,7 @@
<groupId>fr.inra.toulouse.metexplore</groupId>
<artifactId>met4j</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1-SNAPSHOT-RemoveCompartments</version>
<packaging>pom</packaging>
<name>met4j</name>
......
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