Author: kono
Date: 2011-03-30 19:07:00 -0700 (Wed, 30 Mar 2011)
New Revision: 24636

Modified:
   
core3/psi-mi-impl/trunk/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabParser.java
Log:
Fixed tab reader to remove prefix of name attribute.

Modified: 
core3/psi-mi-impl/trunk/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabParser.java
===================================================================
--- 
core3/psi-mi-impl/trunk/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabParser.java
      2011-03-31 02:03:42 UTC (rev 24635)
+++ 
core3/psi-mi-impl/trunk/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabParser.java
      2011-03-31 02:07:00 UTC (rev 24636)
@@ -126,21 +126,22 @@
 
                                sourceID = entry[0].split(SEPARATOR);
                                targetID = entry[1].split(SEPARATOR);
-
+                               final String sourceRawID = 
sourceID[0].split(":")[1];
+                               final String targetRawID = 
targetID[0].split(":")[1];
                                
-                               CyNode source = nodeMap.get(sourceID[0]);
+                               CyNode source = nodeMap.get(sourceRawID);
                                if(source == null) {
                                        source = network.addNode();
-                                       nodeMap.put(sourceID[0], source);
+                                       nodeMap.put(sourceRawID, source);
                                }
-                               CyNode target = nodeMap.get(targetID[0]);
+                               CyNode target = nodeMap.get(targetRawID);
                                if(target == null) {
                                        target = network.addNode();
-                                       nodeMap.put(targetID[0], target);
+                                       nodeMap.put(targetRawID, target);
                                }
                                
-                               source.getCyRow().set(CyTableEntry.NAME, 
sourceID[0]);
-                               target.getCyRow().set(CyTableEntry.NAME, 
targetID[0]);
+                               source.getCyRow().set(CyTableEntry.NAME, 
sourceRawID);
+                               target.getCyRow().set(CyTableEntry.NAME, 
targetRawID);
 
                                // Set type if not protein
                                if (sourceID[0].contains(CHEBI)) {
@@ -203,9 +204,11 @@
                if (buf != null && buf.length == 2) {
                        attrName = ATTR_PREFIX + buf[0];
                        
-                       if(row.getTable().getColumn(attrName) == null)
+                       if(row.getTable().getColumn(attrName) == null) {
                                row.getTable().createColumn(attrName, 
String.class, false);
-
+                               row.getTable().createColumn(attrName + ".name", 
String.class, false);
+                       }
+                               
                        matcher = miNamePttr.matcher(buf[1]);
                        if (matcher.find()) {
                                taxonName = matcher.group();
@@ -289,9 +292,9 @@
                                final Double score = 
Double.parseDouble(scoreString);
                                row.set(key + "." + scoreType, score);
                        } catch (Exception e) {
-                               if (scoreString != null
-                                               && 
scoreString.trim().equals("") == false)
-                                       row.set(key + "." + scoreType, 
scoreString);
+//                             if (scoreString != null
+//                                             && 
scoreString.trim().equals("") == false)
+//                                     row.set(key + "." + scoreType, 
scoreString);
 
                                continue;
                        }

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