Author: pwang
Date: 2012-04-06 15:58:53 -0700 (Fri, 06 Apr 2012)
New Revision: 28764
Modified:
csplugins/trunk/ucsd/pwang/NestedNetworkToolkit/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
Log:
Updated
Modified:
csplugins/trunk/ucsd/pwang/NestedNetworkToolkit/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
===================================================================
---
csplugins/trunk/ucsd/pwang/NestedNetworkToolkit/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
2012-04-06 22:01:05 UTC (rev 28763)
+++
csplugins/trunk/ucsd/pwang/NestedNetworkToolkit/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
2012-04-06 22:58:53 UTC (rev 28764)
@@ -27,7 +27,23 @@
CyAttributes nodeAttr = Cytoscape.getNodeAttributes();
Set overview_nodes = new HashSet();
for (int i=0; i< subnetworks.length; i++){
- CyNode newNode
=Cytoscape.getCyNode(subnetworks[i].getTitle(), true);
+ CyNode newNode
=Cytoscape.getCyNode(subnetworks[i].getTitle(), true);
+
+ // MODIFIED
+ // for each subnetwork: get the mean confidence score
(sum up all confidence scores in the subnetwork and divide by the number of
nodes)
+ // set the mean confidence score to the new metanode,
so the vizmapper can color the node appropriately
+ int[] indices = subnetworks[i].getNodeIndicesArray();
+ double conf = 0;
+ for (int j = 0; j != indices.length; j++)
+ {
+ CyNode n = (CyNode)
Cytoscape.getRootGraph().getNode(indices[j]);
+ conf +=
Cytoscape.getNodeAttributes().getDoubleAttribute(n.getIdentifier(),
"confidence");
+ }
+ conf /= indices.length;
+
Cytoscape.getNodeAttributes().setAttribute(subnetworks[i].getTitle(),
"confidence", conf);
+
+ // MODIFIED
+
newNode.setNestedNetwork(subnetworks[i]);
overview_nodes.add(newNode);
}
@@ -85,8 +101,13 @@
}
//2.Build outgoing edge set for each subnetwork
- HashSet[] outgoing_edgeSet = new HashSet[overview_nodeCount];
+ HashSet[] outgoing_edgeSet = new HashSet[overview_nodeCount];
+ // initialize the hashSet
+ for (int k=0; k<outgoing_edgeSet.length; k++ ){
+ outgoing_edgeSet[k] = new HashSet();
+ }
+
// build edge set for parent network
//HashSet parentEdgeSet = new HashSet();
Iterator parentEdgeIt = parentNetwork.edgesList().iterator();
@@ -98,9 +119,6 @@
for (int k=0; k< overview_nodeCount; k++){
if (nodeSet[k].contains(edge.getSource()) &&
!nodeSet[k].contains(edge.getTarget()) ||
(!nodeSet[k].contains(edge.getSource())
&& nodeSet[k].contains(edge.getTarget()))){
- if (outgoing_edgeSet[k] == null){
- outgoing_edgeSet[k] = new
HashSet();
- }
outgoing_edgeSet[k].add(edge);
}
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.