network file formats (graphml, xgml, xgmml)

967 views
Skip to first unread message

Pomax

unread,
May 14, 2008, 2:32:10 AM5/14/08
to cytoscape-helpdesk
Hi,

I got to cytoscape after doing quite a bit of searching for graph
visualisers (this category of programs is not easy to find without the
aid of research websites mentioning which package they used...) but I
keep running into problems.

After a few programs that were either unable to cope with the size of
my network (~4000 nodes, ~7700 directed edges, with a small (<200)
subset of nodes being highly connective) I ended up with yEd, which
was somewhat decent, but had no way to cancel layout changing once you
picked one. So, after more searching, I found Cytoscape...

I understand it's been designed from a perspective of biological data,
but at this point is a pretty decent all-round graph visualiser, but
the network file formats boggle me a little. I have data in DOT and
GraphML format, neither of which cytoscape can read (the second of
which would be really useful if it could). It can read in GML, but as
GML is defined in ascii it cannot represent the data I am working with
- graphical decomposition of Japanese ideographs ('kanji'), requiring
unicode characters.

XGMML would effectively solve this as it's an XML defined syntax,
making it character set independent by virtue of allowing allowing the
UTF-8 character set. It is relatively simple to convert a GraphML file
to a XGMML file, but when I try to load in the following perfectly
valid XGMML file, cytoscape informs me it cannot load it:

<?xml version="1.0"?>
<!DOCTYPE graph PUBLIC "-//John Punin//DTD graph description//EN"
"http://www.cs.rpi.edu/~puninj/XGMML/xgmml.dtd">
<graph directed="1" id="5">
<node id="1" label="位"/>
<node id="2" label="置"/>
<edge source="位" target="置" label=""/>
</graph>

Note that this is both well-formed and valid XGMML as per the DTD, so
there is no reason cytoscape should fail being able to load this data.
What's more, it will reject my file without even so much as hinting at
why, merely saying "unable to open file <filename>". So I guess this
is as much a cry for help as a request for features:

- How do I get my data loaded in Cytoscape if the only viable file
format suited to it gets rejected? (using GML turns all the unicode
characters into &#x....; values, which makes it impossible to
understand the visualisation)?

- Can a feature to cytoscape be added to actually inform users *why*
their import cannot be loaded (if the document is considered invalid,
indicating where and why, if it was valid but an unknown error was
encountered, indicating where in the load process this occurred...)?

Thanks,

- Mike Kamermans
www.nihongoresources.com

Keiichiro Ono

unread,
May 14, 2008, 1:44:01 PM5/14/08
to cytoscape...@googlegroups.com
Hi.
The following sample works with 2.6:

<?xml version="1.0"?>
<graph directed="1" id="5" label="日本語のサンプルネットワーク"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns1="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.cs.rpi.edu/XGMML">

<node id="1" label="位" />
<node id="2" label="置" />

<edge label="位 (辺のラベル) 置" source="1" target="2">
<att label="interaction" name="interaction" value="辺のラベル" type="string"/>
</edge>
</graph>

However, I think Cytoscape should accept your XML file, too. I read
the reader code and there are some issues when loading xml files
created by other applications. I'll try to figure out how to solve
this.

By the way, to import networks with eastern asian characters including
kanji, the easiest way is making a simple tab-delimited network file
and import it from File-->Import-->Network from Table. The following
image was created by the function:

http://www.cytoscape.org/images/intro_13.png

Thanks.
Kei

2008/05/13 23:32 Pomax <nih...@gmail.com>:

--
Keiichiro Ono ko...@ucsd.edu

Cytoscape Core Developer Team: http://www.cytoscape.org/
UCSD Bioengineering Ideker Lab: http://chianti.ucsd.edu/idekerlab/

network_w_kanji.png

Scooter Morris

unread,
May 14, 2008, 2:01:24 PM5/14/08
to cytoscape...@googlegroups.com
Actually, the problem with your initial code is that the new reader uses namespaces rather than DTD's.  If you just remove the DOCTYPE and add the appropriate namespaces (as Kei has done) everything should work as expected.

-- scooter

Keiichiro Ono wrote:



scooter.vcf
Reply all
Reply to author
Forward
0 new messages