Author: pwang
Date: 2012-02-10 15:59:39 -0800 (Fri, 10 Feb 2012)
New Revision: 28238

Modified:
   
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
Log:
Support category attribute type String and Integer

Modified: 
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
===================================================================
--- 
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
    2012-02-10 22:59:21 UTC (rev 28237)
+++ 
csplugins/trunk/ucsd/pwang/subnetworkByCategory/src/main/java/org/cytoscape/subnetwork/SubnetworkByCategory.java
    2012-02-10 23:59:39 UTC (rev 28238)
@@ -174,7 +174,7 @@
        }
 
        
-       //////
+       ////// attribute type could be String or Integer
        private HashMap getNodeCategoryMap(CyNetwork net, String attributeName){
                HashMap categoryMap = new HashMap();
                
@@ -185,12 +185,12 @@
                        CyNode node = (CyNode) 
Cytoscape.getRootGraph().getNode(nodeIndices[i]);
                        String nodeId = node.getIdentifier();
                        
-                       if (attributes.getAttribute(nodeId, 
attributeName.toLowerCase()) == null){
-                               continue;
+                       String attValue = "unknown"; // default, if attrValue 
is null
+                       
+                       if (attributes.getAttribute(nodeId, attributeName) != 
null){
+                               attValue = attributes.getAttribute(nodeId, 
attributeName).toString();   
                        }
-                       
-                       String attValue = attributes.getAttribute(nodeId, 
attributeName.toLowerCase()).toString();
-                       
+                                               
                        if (categoryMap.containsKey(attValue.toLowerCase())){
                                Vector nodeVect = 
(Vector)categoryMap.get(attValue.toLowerCase());
                                nodeVect.add(node);

-- 
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.

Reply via email to