[BioC] Rgraphviz and Windows

Vincent Carey 525-2265 stvjc at channing.harvard.edu
Tue Sep 30 12:32:00 MEST 2003


> file, then use dotty or dot to visualize.  You may need
> to tweak the GXL to get gxl2dot to succeed with the
> toGXL dump.
>
> example:
>
> library(graph)
> example(graphNEL)
> cat(saveXML(toGXL(gR)),file="goo.gxl")

Let me be a bit more explicit about this.

if you issue the commands mentioned here, goo.gxl
will have the following contents, if you are using an XML
built with libxml 1.*: (see also XML2 below if you are a libxml2 user,
which you can determine by running libxmlVersion() and noting
the major element)

<?xml version="1.0"?>
<gxl>
  <graph id="graphNEL">
    <node id="A"/>
    <node id="B"/>
    <node id="C"/>
    <node id="D"/>
    <edge id="e1" from="A" to="D"/>
    <edge id="e2" from="B" to="C"/>
    <edge id="e3" from="C" to="B"/>
    <edge id="e4" from="D" to="A"/>
  </graph>
</gxl>


this will not be processed by gxl2dot because it
lacks an edgemode attribute in the graph node.
in fact, on my machines it causes a segmentation fault
to lack the edgemode attribute.

so change the third record  to

  <graph id="graphNEL" edgemode="directed">

and now gxl2dot will emit

digraph graphNEL {
        A -> D   [_gxl_id=e1];
        B -> C   [_gxl_id=e2];
        C -> B   [_gxl_id=e3];
        D -> A   [_gxl_id=e4];
}

save that to a file and run dotty on the file,
and you can reorient and modify the graph
interactively.

this functionality is at an early stage -- if people
are finding that features of their graph objects
are not properly propagated, let us know and we
will try to cover the needs.

---
XML2: if you have an XML package installation based
on libxml2, the result will also contain a second
record

<!DOCTYPE  SYSTEM "http: ...>

sadly, R::XML has emitted a defective DTD reference (it should
be <!DOCTYPE gxl SYSTEM "http: ...>), and this
is flagged as a "syntax error" by gxl2dot.  just remove
the DOCTYPE node, you don't need it.



More information about the Bioconductor mailing list