Package org.cytoscape.ClusterViz.internal

Examples of org.cytoscape.ClusterViz.internal.ClusterGraph


          if(cluster.getALCluster().size()>=params.getComplexSizeThreshold()){
            //
            //ArrayList<Long> alNodes=cluster.getALNodes();
            List<Long> alNodes=cluster.getALCluster();
            ClusterGraph gpCluster = this.createClusterGraph(alNodes, inputNetwork);
            //cluster.setComplexID(counter++);
            cluster.setGraph(gpCluster);
            cluster.setScore(0.0);
            cluster.setSeedNode(alNodes.get(0));
           
View Full Code Here


            if (!alCluster.contains(currentNode)) {
              alCluster.add(currentNode);
            }

            // Create an input graph for the filter and haircut methods
            ClusterGraph clusterGraph = createClusterGraph(alCluster, inputNetwork);

            if (!filterCluster(clusterGraph)) {
              if (params.isHaircut())
                haircutCluster(clusterGraph, alCluster);
View Full Code Here

    // Make sure seed node is part of cluster, if not already in there
    if (!alCluster.contains(seedNode))
      alCluster.add(seedNode);

    // Create an input graph for the filter and haircut methods
    ClusterGraph clusterGraph = createClusterGraph(alCluster, inputNet);

    if (params.isHaircut())
      haircutCluster(clusterGraph, alCluster);

    if (params.isFluff())
View Full Code Here

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

    final ClusterGraph clusterGraph = mcodeUtil.createGraph(inputNet, nodes);

    return clusterGraph;
  }
View Full Code Here

    } else {
      neighborhood = neighborIndexes;
    }
   
    // extract neighborhood subgraph
    final ClusterGraph neighborhoodGraph = mcodeUtil.createGraph(inputNetwork, neighbors);
   
    if (neighborhoodGraph == null) {
      // this shouldn't happen
      logger.error("In " + callerID + ": neighborhoodGraph was null.");
      return null;
    }

    // Calculate the node information for each node
    final NodeInfo nodeInfo = new NodeInfo();

    // Density
    if (neighborhoodGraph != null)
      nodeInfo.density = calcDensity(neighborhoodGraph, params.isIncludeLoops());
   
    nodeInfo.numNodeNeighbors = neighborhood.length;

    // Calculate the highest k-core
    Integer k = null;
    Object[] returnArray = getHighestKCore(neighborhoodGraph);
    k = (Integer) returnArray[0];
    ClusterGraph kCore = (ClusterGraph) returnArray[1];
    nodeInfo.coreLevel = k.intValue();
   
    // Calculate the core density - amplifies the density of heavily interconnected regions and attenuates
    // that of less connected regions
    if (kCore != null)
View Full Code Here

  private boolean filterCluster(final ClusterGraph clusterGraph) {
    if (clusterGraph == null)
      return true;

    // filter if the cluster does not satisfy the user specified k-core
    ClusterGraph kCore = getKCore(clusterGraph, params.getKCore());

    return kCore == null;
  }
View Full Code Here

   * @param cluster      The cluster node ID list (in the original graph)
   * @return true
   */
  private boolean haircutCluster(final ClusterGraph clusterGraph, final List<Long> cluster) {
    // get 2-core
    final ClusterGraph kCore = getKCore(clusterGraph, 2);

    if (kCore != null) {
      // clear the cluster and add all 2-core nodes back into it
      cluster.clear();
     
      // must add back the nodes in a way that preserves node indices
      for (final CyNode n : kCore.getNodeList())
        cluster.add(n.getSUID());
    }
   
    return true;
  }
View Full Code Here

      return null;
    }

    // filter all nodes with degree less than k until convergence
    boolean firstLoop = true;
    ClusterGraph outputGraph = inputGraph;

    while (true && !cancelled) {
      int numDeleted = 0;
      final List<Long> alCoreNodeIndices = new ArrayList<Long>(outputGraph.getNodeCount());
      final List<CyNode> nodes = outputGraph.getNodeList();

      for (CyNode n : nodes) {
        int degree = outputGraph.getAdjacentEdgeList(n, CyEdge.Type.ANY).size();

        if (degree >= k)
          alCoreNodeIndices.add(n.getSUID()); //contains all nodes with degree >= k
        else
          numDeleted++;
      }

      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);
       
        if (outputGraph.getNodeCount() == 0)
          return null;

        // Iterate again, but with a new k-core input graph...
       
        if (firstLoop)
View Full Code Here

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

    int i = 1;
    ClusterGraph curGraph = graph, prevGraph = null;

    while ((curGraph = getKCore(curGraph, i)) != null) {
      prevGraph = curGraph;
      i++;
    }
View Full Code Here

        Iterator it=curOptimalDivision.iterator();
        while(it.hasNext()){
          Cluster cluster=(Cluster)it.next();
          if(cluster.getALCluster().size()>=params.getComplexSizeThreshold1()){
            List<Long> alNodes=cluster.getALCluster();
            ClusterGraph gpCluster =createClusterGraph(alNodes, inputNetwork);
            cluster.setGraph(gpCluster);
            cluster.setScore(0.0);
            cluster.setSeedNode((Long)alNodes.get(0));
            cluster.setResultTitle(resultTitle);
            cluster.calModularity(inputNetwork,this);
View Full Code Here

TOP

Related Classes of org.cytoscape.ClusterViz.internal.ClusterGraph

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.