Commit d326310a authored by cfrainay's avatar cfrainay
Browse files

[Toolbox] empty file handling in NetworkAnalysis

parent 90a25607
......@@ -144,10 +144,12 @@ public class MetaboRank extends AbstractMet4jApplication {
System.err.println("transition probabilities computed (reverse graph)");
importSeeds(seedsFilePath);
compute();
printCompoundTable(output);
if(seeds.isEmpty()){
System.err.println("no seed available, computation aborted");
}else{
compute();
printCompoundTable(output);
}
System.err.println("done.");
}
......
......@@ -71,10 +71,14 @@ public class PrecursorNetwork extends AbstractMet4jApplication {
.map(BioReaction.class::cast)
.collect(BioCollection::new, BioCollection::add, BioCollection::addAll);
fr.inrae.toulouse.metexplore.met4j_graph.computation.analyze.PrecursorNetwork precursorComp =
new fr.inrae.toulouse.metexplore.met4j_graph.computation.analyze.PrecursorNetwork(graph, bootstraps, targets, forbidden);
BipartiteGraph precursorNet = precursorComp.getPrecursorNetwork();
ExportGraph.toGml(precursorNet, output);
if(targets.isEmpty()){
System.err.println("no target available, computation aborted");
}else {
fr.inrae.toulouse.metexplore.met4j_graph.computation.analyze.PrecursorNetwork precursorComp =
new fr.inrae.toulouse.metexplore.met4j_graph.computation.analyze.PrecursorNetwork(graph, bootstraps, targets, forbidden);
BipartiteGraph precursorNet = precursorComp.getPrecursorNetwork();
ExportGraph.toGml(precursorNet, output);
}
}
@Override
......
......@@ -79,14 +79,18 @@ public class ScopeNetwork extends AbstractMet4jApplication {
.map(BioReaction.class::cast)
.collect(BioCollection::new, BioCollection::add, BioCollection::addAll);
ScopeCompounds scopeComp = new ScopeCompounds(graph, seeds, bootstraps, forbidden);
if (includeSides) scopeComp.includeBootstrapsInScope();
if (trace) scopeComp.trace();
BipartiteGraph scope = scopeComp.getScopeNetwork();
if (trace) {
ExportGraph.toGmlWithAttributes(scope, output, scopeComp.getExpansionSteps(), "step");
} else {
ExportGraph.toGml(scope, output);
if(seeds.isEmpty()){
System.err.println("no seed available, computation aborted");
}else {
ScopeCompounds scopeComp = new ScopeCompounds(graph, seeds, bootstraps, forbidden);
if (includeSides) scopeComp.includeBootstrapsInScope();
if (trace) scopeComp.trace();
BipartiteGraph scope = scopeComp.getScopeNetwork();
if (trace) {
ExportGraph.toGmlWithAttributes(scope, output, scopeComp.getExpansionSteps(), "step");
} else {
ExportGraph.toGml(scope, output);
}
}
}
......
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