Author: mkirby
Date: 2012-05-30 13:04:26 -0700 (Wed, 30 May 2012)
New Revision: 29398

Added:
   csplugins/trunk/soc/mkirby/R/.project
   csplugins/trunk/soc/mkirby/R/cytobridge.R
Log:
mkirby: R files.

Added: csplugins/trunk/soc/mkirby/R/.project
===================================================================
--- csplugins/trunk/soc/mkirby/R/.project                               (rev 0)
+++ csplugins/trunk/soc/mkirby/R/.project       2012-05-30 20:04:26 UTC (rev 
29398)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>R</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+       </buildSpec>
+       <natures>
+       </natures>
+</projectDescription>

Added: csplugins/trunk/soc/mkirby/R/cytobridge.R
===================================================================
--- csplugins/trunk/soc/mkirby/R/cytobridge.R                           (rev 0)
+++ csplugins/trunk/soc/mkirby/R/cytobridge.R   2012-05-30 20:04:26 UTC (rev 
29398)
@@ -0,0 +1,30 @@
+#make your igraph
+g1 <- graph( c( 0,1, 1,2, 2,2, 2,3 ) )
+
+#The Cytobridge class
+setClass(Class="cytobridge", 
+          representation=representation(a="ANY"),
+          prototype=prototype(a=graph(c(0,1))),
+          validity=function(object) {
+              if(class(object@a)!="igraph") {
+                    return(paste("Expected iGraph but got ", class(object@a)))
+                } else {
+                    return(TRUE)
+                }
+          })
+
+#Returns the graph of this CytoBridge
+setGeneric(name="getGraph", def=function(x) standardGeneric("getGraph"))
+        setMethod(f="getGraph", signature="cytobridge", definition=function(x) 
{
+                return(x@a)
+        }) 
+
+#Send the graph data to the communication Layer
+setGeneric(name="update", def=function(x) standardGeneric("update"))
+        setMethod(f="update", signature="cytobridge",
+            definition=function(x) {
+                print(V(getGraph(x)))
+        })
+
+
+test <- new("cytobridge",a=g1)
\ No newline at end of file

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