Package org.patika.mada.graph

Examples of org.patika.mada.graph.Node


  {
    LinkedList<Node> tempNodeList = new LinkedList<Node>();

    for (Node node : nodes)
    {
      Node n = (Node) graph.getCorrespMember(node);
      assert n != null;
      tempNodeList.add(n);
    }
    nodes = tempNodeList;
View Full Code Here


      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();
      }
View Full Code Here

          ArrayList<Node> actors = new ArrayList<Node>(targets);
          targets.clear();

          for (Node actor : actors)
          {
            Node corresponding = (Node) actor.getLabel(BioPAXGraph.EXCISED_FROM);

            if (corresponding instanceof EntityAssociated)
            {
              physicalEntity entity = ((EntityAssociated) corresponding).getEntity();
              List<Node> nodeList = entityToNodeMap.get(entity);
View Full Code Here

  public void associateInferenceData()
  {
    Iterator<GraphObject> goIter = getObjects().iterator();

    Node start = (Node) goIter.next();

    assert start.hasSignificantExperimentalChange(ExperimentData.EXPRESSION_DATA);

    int sign = start.getExperimentData(ExperimentData.EXPRESSION_DATA).getSign();

    start.putLabel(INFERENCE_DATA_KEY, new InferenceData(true, sign > 0));


    while (goIter.hasNext())
    {
      GraphObject go = goIter.next();

      if (go instanceof Node)
      {
        Node node = (Node) go;

        boolean significant = node.hasSignificantExperimentalChange(
          ExperimentData.EXPRESSION_DATA);

        node.putLabel(INFERENCE_DATA_KEY, new InferenceData(significant, sign > 0));

        if (node instanceof Complex)
        {
          for (Node child : node.getChildren())
          {
            if (!this.contains(child))
            {
              child.putLabel(INFERENCE_DATA_KEY,
                new InferenceData(significant, sign > 0));
View Full Code Here

            //previously calculated shortest distance
            int previousShortestDist;
            //shortest distance from current BFS
            int currentShortestDist;
            //source node of currentBFS
            Node nodeA = (Node) obj;
            //element of resultant set of BFS
            Node nodeB = (Node) graphObject;
           
            //find label from result of BFS
            currentShortestDist = BFSResult.get(graphObject);

            //new distance between two nodes
View Full Code Here

  {
    for (Object o : pgraph.getNodes())
    {
      if (o instanceof Node)
      {
        Node node = (Node) o;

        for (XRef ref : refs)
        {
          if (node.getReferences().contains(ref))
          {
            node.setHighlight(true);
          }
        }
      }
    }
  }
View Full Code Here

  {
    LinkedList<Node> tempNodeList = new LinkedList<Node>();

    for (Node node : nodes)
    {
      Node n = (Node) graph.getCorresponding(node);
      assert n != null;
      tempNodeList.add(n);
    }
    nodes = tempNodeList;
View Full Code Here

      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();
      }
View Full Code Here

  public void removeLabels(Collection labels)
  {
    for (Object o : getNodes())
    {
      Node node = (Node) o;

      for (Object label : labels)
      {
        node.removeLabel(label);
      }
    }
  }
View Full Code Here

          ArrayList<Node> actors = new ArrayList<Node>(targets);
          targets.clear();

          for (Node actor : actors)
          {
            Node corresponding = (Node) actor.getLabel(BioPAXGraph.EXCISED_FROM);

            if (corresponding instanceof EntityAssociated)
            {
              EntityHolder entity = ((EntityAssociated) corresponding).getEntity();
              List<Node> nodeList = entityToNodeMap.get(entity);
View Full Code Here

TOP

Related Classes of org.patika.mada.graph.Node

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.