Author: mes
Date: 2012-07-19 15:59:01 -0700 (Thu, 19 Jul 2012)
New Revision: 29929
Modified:
csplugins/trunk/ucsd/mes/genomespace/ndb-reader/src/main/java/cytoscape/ndb/NDBGraphReader.java
Log:
added NDB Regulator attribute to edges
Modified:
csplugins/trunk/ucsd/mes/genomespace/ndb-reader/src/main/java/cytoscape/ndb/NDBGraphReader.java
===================================================================
---
csplugins/trunk/ucsd/mes/genomespace/ndb-reader/src/main/java/cytoscape/ndb/NDBGraphReader.java
2012-07-19 18:13:43 UTC (rev 29928)
+++
csplugins/trunk/ucsd/mes/genomespace/ndb-reader/src/main/java/cytoscape/ndb/NDBGraphReader.java
2012-07-19 22:59:01 UTC (rev 29929)
@@ -140,6 +140,7 @@
Element regulatorGene = (Element)o;
String regulatorId =
regulatorGene.getAttributeValue("Regulator_Id");
String geneId =
regulatorGene.getAttributeValue("Gene_Id");
+ boolean regulator =
parseBoolean(regulatorGene.getAttributeValue("Regulator"));
if ( regulatorId == null ||
geneId == null ||
!geneIdMap.containsKey(regulatorId) ||
@@ -149,6 +150,7 @@
CyNode na = geneIdMap.get(regulatorId);
CyNode nb = geneIdMap.get(geneId);
CyEdge e =
Cytoscape.getCyEdge(na,nb,Semantics.INTERACTION,"regulates",true,true);
+
Cytoscape.getEdgeAttributes().setAttribute(e.getIdentifier(),"NDB
Regulator",regulator);
edgeIds.add( e.getRootGraphIndex() );
}
}
@@ -208,4 +210,10 @@
return edges;
}
+
+ private boolean parseBoolean(String s) {
+ if ( s == null )
+ return false;
+ return s.toLowerCase().equals("true");
+ }
}
--
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.