Package org.gvt.model

Examples of org.gvt.model.BioPAXGraph


  private void openPathwayInTab(PathwayHolder p)
  {
    assert p != null;

    BioPAXGraph graph = main.getRootGraph().excise(p);
    boolean layedout = graph.fetchLayout();
    CTabItem tab = main.createNewTab(graph);

    if (refsToHighlight != null && !refsToHighlight.isEmpty())
    {
      ScrollingGraphicalViewer viewer = main.getTabToViewerMap().get(tab);
View Full Code Here


      }
     
      merger.merge(target, sources.toArray(new Model[sources.size()]));

      BioPAXReader reader = new BioPAXReader(target);
      BioPAXGraph graph = (BioPAXGraph) reader.readXMLFile(null);

      if (createNewPathway)
      {
        List<String> intids = getInteractionIDs(model);
        newPathwayName = graph.createPathway(
          newPathwayName == null ? "Neighborhood" : newPathwayName, intids);
        main.getAllPathwayNames().add(newPathwayName);
      }

      main.setRootGraph(graph);
View Full Code Here

                 "No path can be found with specified parameters");
         }
    // Result of PoI will be displayed in new niew
    else
    {
      BioPAXGraph pathwayGraph = main.getRootGraph().excise(resultSet);
      pathwayGraph.setName("Path Iteration");
      main.createNewTab(pathwayGraph);
      new CoSELayoutAction(main).run();

      resultSet = pathwayGraph.getCorrespMember(resultSet);

      for (GraphObject go : resultSet)
      {
        go.setHighlight(true);
      }
View Full Code Here

  }

  // Replace graph
  private void updateViewerContent(ScrollingGraphicalViewer viewer)
  {
    BioPAXGraph graph = (BioPAXGraph) viewer.getContents().getModel();

    // Updating is supported only for mechanistic views
    if (!graph.isMechanistic()) return;

    // Remember highlighted object's original nodes (members of chisio root graph)

    Map<String, Color> highlightMap = new HashMap<String, Color>();

    for (Object o : graph.getNodes())
    {
      IBioPAXNode node = (IBioPAXNode) o;
      if (node.isHighlighted())
      {
        highlightMap.put(node.getIDHash(), node.getHighlightColor());
      }
    }

    for (Object o : graph.getEdges())
    {
      IBioPAXEdge edge = (IBioPAXEdge) o;
      if (edge.isHighlighted())
      {
        highlightMap.put(edge.getIDHash(), edge.getHighlightColor());
      }
    }

    // Reset highlight

    HighlightLayer hLayer = (HighlightLayer)
      ((ChsScalableRootEditPart) viewer.getRootEditPart()).getLayer(
        HighlightLayer.HIGHLIGHT_LAYER);

    hLayer.removeAll();
    hLayer.highlighted.clear();

    viewer.deselectAll();

    // Record layout
    graph.recordLayout();

    // Create updated graph
    PathwayHolder p = graph.getPathway();

    // Update pathway components if update needed

    if (withContent != null)
    {
      p.updateContentWith(withContent);
    }

    // Excise pathway

    BioPAXGraph newGraph = main.getRootGraph().excise(p);
    newGraph.setAsRoot();

    // Replace the graph
    viewer.setContents(newGraph);

    // Use same layout
    boolean layedout = newGraph.fetchLayout();

    if (!layedout)
    {
      new CoSELayoutAction(main).run();
    }

    viewer.deselectAll();
    GraphAnimation.run(viewer);

    // Recover highlights

    for (Object o : newGraph.getNodes())
    {
      IBioPAXNode node = (IBioPAXNode) o;
      if (highlightMap.containsKey(node.getIDHash()))
      {
        node.setHighlightColor(highlightMap.get(node.getIDHash()));
        node.setHighlight(true);
      }
    }

    for (Object o : newGraph.getEdges())
    {
      IBioPAXEdge edge = (IBioPAXEdge) o;
      if (highlightMap.containsKey(edge.getIDHash()))
      {
        edge.setHighlightColor(highlightMap.get(edge.getIDHash()));
View Full Code Here

    }
  }

  private void updateRoot()
  {
    BioPAXGraph root = (BioPAXGraph) new BioPAXReader(main.getOwlModel()).readXMLFile(null);
    main.setRootGraph(root);
  }
View Full Code Here

    String name;

    if (root instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) root;

      if (graph.isMechanistic() && graph.getPathway() == null)
      {
        PathwayHolder p = new PathwayHolder(getOwlModel());

        p.setName(adviceTabName(graph.getName()));

        graph.setName(p.getName());

        graph.setPathway(p);
        graph.registerContentsToPathway();
        allPathwayNames.add(p.getName());
      }
      else
      {
        graph.setName(graph.getPathway() != null ? graph.getPathway().getName() :
          adviceTabName(graph.getName()));
      }

      name = graph.getName();
    }
    else
    {
      name = adviceTabName(null);
    }
View Full Code Here

    ScrollingGraphicalViewer viewer = tabToViewerMap.get(tab);
    CompoundModel root = (CompoundModel) viewer.getContents().getModel();

    if (root instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) root;

      assert graph.getName().equals(tab.getText()) :
        "graph name: " + graph.getName() + " tab name: " + tab.getText();

      if (rememberLayout && graph.isMechanistic())
      {
        graph.recordLayout();
      }
    }

    boolean removed = openTabNames.remove(tab.getText());
View Full Code Here


    Object compmod = tabToViewerMap.get(tab).getContents().getModel();
    if (compmod instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) compmod;
      graph.setName(newName);
    }
    tab.setText(newName);

    assert nameToTabMap.size() == openTabNames.size();
  }
View Full Code Here

      man.clearExperimentData(rootGraph);
      man.associateExperimentData(rootGraph);

      for (ScrollingGraphicalViewer viewer : tabToViewerMap.values())
      {
        BioPAXGraph graph = (BioPAXGraph) viewer.getContents().getModel();
        man.clearExperimentData(graph);
        man.associateExperimentData(graph);
      }
    }
  }
View Full Code Here

    int limit = 10;
    int k = 0;
    int t = 0;

    BioPAXGraph graph = globalSearch ? main.getRootGraph() : main.getPathwayGraph();

    if (targets.isEmpty()) targets = null;

    Map<Node, Map<Integer, List<CausativePath>>> allMap =
      AlgoRunner.searchCausativePaths(graph, targets, limit, t, k);

    // Search the paths map for each target and
    // prepare the result paths to visualize

    List<String> pathIDs = new ArrayList<String>();
    idMap = new HashMap<String, CausativePath>();

    // Collect all paths in a list to be used in excising the original graph and displaying the
    // merge graph

    List<Path> paths = new ArrayList<Path>();

    for (Map<Integer, List<CausativePath>> integerListMap : allMap.values())
    {
      for (List<CausativePath> list : integerListMap.values())
      {
        paths.addAll(list);
      }
    }

    // Open merge graph of result pathways in a new view

    if (!paths.isEmpty() && globalSearch)
    {
      pathwayGraph = graph.excise(paths, false, true);
      pathwayGraph.setName("Causative Paths");
      main.createNewTab(pathwayGraph);
      new CoSELayoutAction(main).run();
     
      new ColorWithExperimentAction(main, pathwayGraph, ExperimentData.EXPRESSION_DATA).run();
View Full Code Here

TOP

Related Classes of org.gvt.model.BioPAXGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.