Set<Node> seed = new HashSet<Node>();
for (Object o : graph.getNodes())
{
Node node = (Node) o;
for (XRef ref : node.getReferences())
{
if (refs.contains(ref))
{
seed.add(node);
break;
}
}
}
if (seed.isEmpty())
{
MessageDialog.openInformation(main.getShell(), "No genes-of-interest!",
"Loaded references do not match any genes in the loaded SIF file.");
return;
}
else
{
System.out.println("Nmber of genes of interest = " + seed.size());
}
Collection<GraphObject> graphObjects =
AlgoRunner.searchGraphOfInterest(graph, seed, limit, directed);
Set<String> rdfseed = new HashSet<String>();
for (Node node : seed)
{
rdfseed.add(((BasicSIFNode)node).getRdfid());
}
BasicSIFGraph goi = (BasicSIFGraph) graph.excise(graphObjects, true);
goi.setName("GOI");
System.out.println("GOI has " + goi.getNodes().size() + " nodes and " +
goi.getEdges().size() + " edges.");
boolean cont = MessageDialog.openConfirm(main.getShell(), "Confirm",
"GOI has " + goi.getNodes().size() + " nodes and " +
goi.getEdges().size() + " edges. Layout?");
if (cont)
{
main.createNewTab(goi);
for (Object o : goi.getNodes())
{
BasicSIFNode node = (BasicSIFNode) o;
if (rdfseed.contains(node.getRdfid()))
{
node.setHighlightColor(ChisioMain.higlightColor);
node.setHighlight(true);
}
}
new CoSELayoutAction(main).run();
}