Entering edit mode
Paul Shannon
▴
750
@paul-shannon-5161
Last seen 10.3 years ago
Hi Mark,
Bioconductor graphs (graphNEL, graphAM, ?) have to be either directed
or undirected: no hybrid graphs are possible. If I understand your
question, this can be worked around quite easily, both in a graphNEL
object and in its display in RCytoscape. See the sample code below.
The current design of graphNELs includes a penalty for undirected
graphs: every edge is stored twice. Until we fix that, RCytoscape
does best with directed graphs only.
Let me know if this helps.
- Paul
library(RCytoscape)
g <- graphNEL(edgemode="directed")
g <- initNodeAttribute(g, "label", "char", "unspecified")
g <- initEdgeAttribute(g, "edgeType", "char", "unspecified")
g <- addNode(c("A","B"), g)
# comment this next line to see one-way regulation between B and A
# leave it live to see reciprocal regulation
# edge target rules, below, display differently in the two cases
g <- addEdge("A", "B", g)
edgeData(g, "A", "B", "edgeType") <- "regulation"
nodeData(g, nodes(g), "label") <- nodes(g)
# now add a regulatory relation between B and A
# check first to see if A already regulates B
if("B" %in% edges(g)$A) {
edgeData(g, "A", "B", "edgeType") <- "reciprocal regulation"
} else {
g <- addEdge("B", "A", g)
edgeData(g, "B", "A", "edgeType") <- "regulation"
}
cw <- new.CytoscapeWindow("demo", g, overwriteWindow=TRUE)
displayGraph(cw)
layoutNetwork(cw, "jgraph-spring")
setNodeLabelRule(cw, "label")
setEdgeTargetArrowRule(cw, "edgeType", c("regulation", "reciprocal
regulation"), c("Arrow", "Arrow"))
setEdgeSourceArrowRule(cw, "edgeType", c("regulation", "reciprocal
regulation"), c("No Arrow", "Arrow"))
redraw(cw)
On Dec 5, 2012, at 11:30 PM, Mark Christiansen wrote:
> Hi Paul,
>
> I have been using your examples in the RCytoscape package to build
up a gene network. I am using the commands:
>
> g=new ("graphNEL", edgemode="directed")
> ...
> g=addEdge(from,to,g)
>
> This works well to construct a network, but I can't tell that the
edges are directed. Is there a flag I am missing (maybe I should use
addCyEdge?)
>
> Also, I would like to be able to check to see if there is an edge
going in the other direction (via g=addEdge(to,from,g) and then change
the edge to be bidirectional.
>
> Is it possible to check if an edge exists and if so, to change its
directionality?
>
> Thank you for your help,
>
> Mark
>
>
> On Mon, Nov 19, 2012 at 10:42 AM, Paul Shannon <pshannon at="" fhcrc.org=""> wrote:
> Hi Mark,
>
> The remote communication protocol for Cytoscape3 has not yet been
documented, but we know that they will no longer support XMLRPC. This
means that RCytoscape support for Cytoscape 3 has to wait until the
protocol and the 'commands' API are both well-defined. Jan Bot, who
wrote CytoscapeRPC, suggests that this is a big job and won't happen
for a while.
>
> Until then, maybe you can get by with the venerable Cytoscape 2.8.3?
>
> - Paul
>
> On Nov 19, 2012, at 10:37 AM, Mark Christiansen wrote:
>
> > Hi Paul,
> >
> > It seems the same Plug-In Manager to install CytoscapeRPC is not
available on Cytoscape v3. Has this been replaced by the Apps
Manager? If I try to import the CytoscapeRPC.jar file as an App in
v3, I get the following error:
> >
> > org.cytoscape.app.internal.exception.AppParsingException:
Jar is missing value for entry Cytoscape-App in its manifest file
> >
> > Thank you for your suggestions,
> >
> > Mark Christiansen
> >
> >
> >
> > On Sun, Nov 18, 2012 at 9:06 PM, Mark Christiansen <mwchristiansen at="" gmail.com=""> wrote:
> > Hi Paul,
> >
> > Thank you for your response. I was trying to install XML-RPC
manually from source and ran into some difficulty. I just tried
installing CytoscapeRPC via the Cytoscape plug-in manager and it
worked like a charm.
> >
> > Thanks again!
> >
> > -Mark
> >
> >
> > On Sun, Nov 18, 2012 at 8:21 PM, Paul Shannon <pshannon at="" fhcrc.org=""> wrote:
> > Hi Mark,
> >
> > The RCytoscape package should install fine on Windows. XML-RPC
and its prerequisite XML work on Windows. Maven is not needed, not
unless you are building Cytoscape from scratch, and not necessariliy
even then. The installation instructions avaialable at
http://rcytoscape.systemsbiology.net should get you going.
> >
> > If not, could you give us the results of sessionInfo ()? Be
forewarned: our next repsonse will likely encourage you to upgrade R
and R packages to the latest version.
> >
> > - Paul
> >
> > On Nov 18, 2012, at 5:40 PM, Mark Christiansen wrote:
> >
> > > Greetings Paul,
> > >
> > > I was wondering if you have had success setting up RCytoscape on
Windows. I believe most of the software dependencies (XML-RPC, Maven,
etc.) were designed to run on Linux or Mac, but I could be wrong.
> > >
> > > Thank you for your help.
> > >
> > > Best regards,
> > >
> > > Mark Christiansen
> >
> >
> >
> >
> > --
> > -Mark
> >
> >
> >
> > --
> > -Mark
>
>
>
>
> --
> -Mark