Examples of CyNode


Examples of cytoscape.CyNode

  }
 
  public void addNodesToGRN() {
    CyAttributes nAtts = Cytoscape.getNodeAttributes();
    for (Object obj: sbmlNetwork.nodesList()){
      CyNode node = (CyNode) obj;
      String type = (String) nAtts.getAttribute(node.getIdentifier(), CySBMLConstants.ATT_SBOTERM);
      if (GeneRegulatoryNetwork.speciesSBOforGRN.contains(type)){
        nodeIds.add(node.getRootGraphIndex());
      }
    } 
  }
View Full Code Here

Examples of cytoscape.CyNode

   
  }
 
  public void addEdgesToGRN() {
    for (Object obj: sbmlNetwork.nodesList()){
      CyNode node = (CyNode) obj;
      String type = (String) nAtts.getAttribute(node.getIdentifier(), CySBMLConstants.ATT_TYPE);
      if (type.equals(CySBMLConstants.NODETYPE_REACTION)){
        addEdgesToGRNForReaction(node);
      }
    }   
  }
View Full Code Here

Examples of cytoscape.CyNode

    int[] outEdgeInds = sbmlNetwork.getAdjacentEdgeIndicesArray(reaction.getRootGraphIndex(), false, false, true);
   
    for (int in: inEdgeInds){
      CyEdge inEdge  = (CyEdge) sbmlNetwork.getEdge(in);
      String inEdgeSBO = (String) eAtts.getAttribute(inEdge.getIdentifier(), CySBMLConstants.ATT_SBOTERM);
      CyNode n1 = (CyNode) inEdge.getSource();
      if (inEdgeSBO == null){
        continue;
      }
      for (int out: outEdgeInds){
        // Get the two edges and end nodes;  n1 --inEdge-> reaction --outEdge-> n2
        CyEdge outEdge = (CyEdge) sbmlNetwork.getEdge(out);
        String outEdgeSBO = (String) eAtts.getAttribute(outEdge.getIdentifier(), CySBMLConstants.ATT_SBOTERM);
        System.out.println("OUT edge: " + outEdge.getIdentifier());
       
        CyNode n2 = (CyNode) outEdge.getTarget();       
        if (outEdgeSBO == null){
          continue;
        }
        // Edges to add
        if (GeneRegulatoryNetwork.productSBOforGRN.contains(outEdgeSBO) &&
View Full Code Here

Examples of org.cytoscape.model.CyNode

        ArrayList alOriginalClusters = new ArrayList(inputNetwork.getNodeCount());
        /************************First, we sort each single node into a clique*************************/
        int i=0;
        Iterator nodes = inputNetwork.getNodeList().iterator();
        while(nodes.hasNext()){
          CyNode n=(CyNode) nodes.next();
         
         
          int degree = inputNetwork.getAdjacentEdgeList(n, CyEdge.Type.ANY).size();

          //int degree=super.getNodeDegree(inputNetwork,n.getSUID());
        //int degree=inputNetwork.getDegree(n);
        Cluster newCluster = new Cluster(i);
        ArrayList alNodes=new ArrayList();
        alNodes.add(n.getSUID());
       
        newCluster.setAlCluster(alNodes);
//        newCluster.setALNodes(alNodes);
        newCluster.setTotalDegree(degree);
        Long nodeIndex= n.getSUID();
        ((NodeInfo)curNodeInfos.get(nodeIndex)).setComplex(i);
        i++;
        alOriginalClusters.add(newCluster);
        }
        /**********************************************************************************************
 
View Full Code Here

Examples of org.cytoscape.model.CyNode

        Iterator nodes = ((CyNetwork)graphView.getModel()).getNodeList().iterator();
        //Iterator nodes = graphView.getNodeViewsIterator();
       
        for (int count = 0; nodes.hasNext(); count++)
    {
      CyNode n = (CyNode)nodes.next();
      nodeIndexToMatrixIndexMap.put(n.getSUID(), Integer.valueOf(count));
      matrixIndexToNodeIndexMap.put(Integer.valueOf(count), n.getSUID());
    }
       
/*        int count=0;
        while (nodes.hasNext()) {
            NodeView nodeView = (NodeView) nodes.next();
View Full Code Here

Examples of org.cytoscape.model.CyNode

  protected ClusterGraph createClusterGraph(final List<Long> alCluster, final CyNetwork inputNet) {
    final Set<CyNode> nodes = new HashSet<CyNode>();

    for (final Long id : alCluster) {
      CyNode n = inputNet.getNode(id);
      nodes.add(n);
    }

    final ClusterGraph clusterGraph = mcodeUtil.createGraph(inputNet, nodes);
View Full Code Here

Examples of org.cytoscape.model.CyNode

      logger.error("In " + callerID + ": gpInputGraph was null.");
      return null;
    }

    // Get neighborhood of this node (including the node)
    CyNode rootNode = inputNetwork.getNode(nodeId);
    List<CyNode> neighbors = inputNetwork.getNeighborList(rootNode, CyEdge.Type.ANY);
   
    if (neighbors.size() < 2) {
      // If there are no neighbors or just one neighbor, nodeInfo calculation is trivial
      NodeInfo nodeInfo = new NodeInfo();
View Full Code Here

Examples of org.cytoscape.model.CyNode

      if (numDeleted > 0 || firstLoop) {
        Set<CyNode> outputNodes = new HashSet<CyNode>();

        for (Long index : alCoreNodeIndices) {
          CyNode n = outputGraph.getNode(index);
          outputNodes.add(n);
        }
       
        outputGraph = mcodeUtil.createGraph(outputGraph.getRootNetwork(), outputNodes);
       
View Full Code Here

Examples of org.cytoscape.model.CyNode

  }
 
 
  static public int getNodeDegree(CyNetwork currentNetwork2, Long node) {
    // TODO Auto-generated method stub
    CyNode cynode=currentNetwork2.getNode(node);
   
    return currentNetwork2.getAdjacentEdgeList(cynode, CyEdge.Type.ANY).size();
   
    
  }
View Full Code Here

Examples of org.cytoscape.model.CyNode

    CyNode[] nodes = new CyNode[this.nodesList.size()];

    Integer[] integers = new Integer[nodes.length];

    for (int i = 0; i < nodes.length; i++) {
      CyNode from_node = (CyNode)this.nodesList.get(i);

      if (from_node != null)
      {
        int index = ((Integer)this.nodeIndexToMatrixIndexMap.get(from_node.getSUID())).intValue();

        if ((index < 0) || (index >= nodes.length)) {
          System.err.println("WARNING: GraphNode \"" + from_node +
            "\" has an index value that is out of range: " + index +
            ".  Graph indices should be maintained such " + "that no index is unused.");
          return null;
        }
        if (nodes[index] != null) {
          System.err.println("WARNING: GraphNode \"" + from_node + "\" has an index value ( " + index +
            " ) that is the same as " + "that of another GraphNode ( \"" + nodes[index] +
            "\" ).  Graph indices should be maintained such " + "that indices are unique.");
          return null;
        }
        nodes[index] = from_node;
        integers[index] = Integer.valueOf(index);
      }
    }
    LinkedList queue = new LinkedList();
    boolean[] completed_nodes = new boolean[nodes.length];

    for (int from_node_index = 0; from_node_index < nodes.length; from_node_index++) {
      if (this.canceled)
      {
        this.distances = null;
        return this.distances;
      }

      CyNode from_node = nodes[from_node_index];

      if (from_node == null)
      {
        if (this.distances[from_node_index] == null) {
          this.distances[from_node_index] = new int[nodes.length];
        }

        Arrays.fill(this.distances[from_node_index], 2147483647);
      }
      else
      {
        if (this.distances[from_node_index] == null) {
          this.distances[from_node_index] = new int[nodes.length];
        }
        Arrays.fill(this.distances[from_node_index], 2147483647);
        this.distances[from_node_index][from_node_index] = 0;

        Arrays.fill(completed_nodes, false);

        queue.add(integers[from_node_index]);

        while (!queue.isEmpty())
        {
          if (this.canceled)
          {
            this.distances = null;
            return this.distances;
          }

          int index = ((Integer)queue.removeFirst()).intValue();
          if (completed_nodes[index])
          {
            completed_nodes[index] = true;

            CyNode to_node = nodes[index];
            int to_node_distance = this.distances[from_node_index][index];
            int i;
            if (index < from_node_index)
            {
              for (i = 0; i < nodes.length; i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.