Compound nodes in desktop version

46 views
Skip to first unread message

dustin....@gmail.com

unread,
May 8, 2018, 2:59:37 PM5/8/18
to cytoscape-helpdesk
Hey,

cytoscape.js supports a feature called 'compound nodes', as shown in this demo: http://js.cytoscape.org/demos/compound-nodes/

Does the desktop version of cytoscape support this sort of thing? And more importantly, what's the best file format to use to import a compound graph? Thanks!

Dustin

Keiichiro Ono

unread,
May 8, 2018, 4:22:59 PM5/8/18
to cytoscape...@googlegroups.com
Hi Dustin.

Unfortunately, Cytoscape Desktop version does not support import/export
compound node from/to Cytoscape.js.

However, you can use Groups instead in desktop version to create nodes with
parent-child relationships.

I've added a new feature request to the issue tracker.

http://code.cytoscape.org/redmine/issues/4194

Thanks,
Kei

2018年5月8日(火) 11:59 <dustin....@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
"cytoscape-helpdesk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to cytoscape-helpd...@googlegroups.com.
> To post to this group, send email to cytoscape...@googlegroups.com.
> Visit this group at https://groups.google.com/group/cytoscape-helpdesk.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/cytoscape-helpdesk/5fe893c0-3296-4fbb-a441-90f507d29338%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.



--
===================================
Keiichiro Ono
http://keiono.github.io/
===================================

dustin....@gmail.com

unread,
May 8, 2018, 5:39:14 PM5/8/18
to cytoscape-helpdesk
That's unfortunate, but hopefully it'll make it into a future release!

Does cytoscape support importing groups from a file? I'd rather not have to create all of the relationships manually. I've been experimenting with graphml, but it doesn't seem to work as I would expect.

Dustin


On Tuesday, May 8, 2018 at 4:22:59 PM UTC-4, Kei wrote:
Hi Dustin.

Unfortunately, Cytoscape Desktop version does not support import/export
compound node from/to Cytoscape.js.

However, you can use Groups instead in desktop version to create nodes with
parent-child relationships.

I've added a new feature request to the issue tracker.

http://code.cytoscape.org/redmine/issues/4194

Thanks,
Kei

2018年5月8日(火) 11:59 <dustin....@gmail.com>:

> Hey,

> cytoscape.js supports a feature called 'compound nodes', as shown in this
demo: http://js.cytoscape.org/demos/compound-nodes/

> Does the desktop version of cytoscape support this sort of thing? And
more importantly, what's the best file format to use to import a compound
graph? Thanks!

> Dustin

> --
> You received this message because you are subscribed to the Google Groups
"cytoscape-helpdesk" group.
> To unsubscribe from this group and stop receiving emails from it, send an

dustin....@gmail.com

unread,
May 8, 2018, 7:25:04 PM5/8/18
to cytoscape-helpdesk
It seems that the XGMML file format allows importing/exporting groups. However, the documentation seems to have disappeared from the internet. Digging through the examples and the source code is slightly helpful... I guess we'll see how it goes.

Dustin

Scooter Morris

unread,
May 8, 2018, 7:32:29 PM5/8/18
to cytoscape...@googlegroups.com
On 5/8/18 4:25 PM, dustin....@gmail.com wrote:
It seems that the XGMML file format allows importing/exporting groups. However, the documentation seems to have disappeared from the internet. Digging through the examples and the source code is slightly helpful... I guess we'll see how it goes.

Dustin
Hi Dustin,
    I would suggest creating a toy network with groups and exporting it from Cytoscape to see what the format is.  It's actually fairly straightforward, a group is a <graph> within a <node> and you can use a Compound Node visualization that behaves very similar to what you get in cytoscape.js.  I will note, however, that the interaction isn't nearly as smooth, which is something that we're working on.

-- scooter
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

dustin....@gmail.com

unread,
May 8, 2018, 7:45:01 PM5/8/18
to cytoscape-helpdesk
Yep, that's what I've been doing. I've been trying to figure out the minimum amount of information needed to get it to display a group... in particular, I don't really want to emit the <graphics> informationor any of those odd internal bits if I can avoid it. It seems though my efforts keep resulting in null pointer exceptions because of something that isn't being initialized properly...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<graph id="1000" label="Foo2" xmlns="http://www.cs.rpi.edu/XGMML" xmlns:cy="http://www.cytoscape.org" xmlns:xlink="http://www.w3.org/1999/xlink" directed="1">
  <att name="documentVersion" value="1.1"/>
  <node label="n1" id="1"/>
  <node label="n2" id="2"/>
  <node label="n3" id="3"/>
  
  <node label="inner1" id="4" />
  <node label="inner2" id="5" />
  <node label="inner3" id="6" />
  
  <node label="Group" id="7">
    <att name="__isGroup" value="1" type="boolean" cy:type="Boolean" cy:hidden="1"/>
  
    <att>
      <graph>
        <node xlink:href="#4" />
        <node xlink:href="#5" />
        <node xlink:href="#6" />
      </graph>
    </att>
  </node>

  <edge label="e1" source="1" target="2" />
  <edge label="e2" source="2" target="3" />
  
  <edge label="e3" source="4" target="5" />
  <edge label="e4" source="5" target="6" />
  
  <edge label="e6" source="2" target="5" />
  
</graph>

You wouldn't happen to have any pointers to simplified XGMML with groups that actually works, would you? I don't mind things having to be laid out after loading -- just as long as all the groups are expanded by default and don't cause errors.

It's late though, so I'll have to try some more tomorrow I suspect.

Dustin

Scooter Morris

unread,
May 8, 2018, 8:09:40 PM5/8/18
to cytoscape...@googlegroups.com
Yes, I'm seeing the NPE also.  Don't think the problem is with the XGMML -- something else is going on that's not clear to me.  What version of Cytoscape are you using?

-- scooter
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

Scooter Morris

unread,
May 8, 2018, 11:26:37 PM5/8/18
to cytoscape...@googlegroups.com
Well, part of the problem is that you have two edges: e3 and e4 that should be inside the subnetwork:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<graph id="1000" label="Foo2" xmlns="http://www.cs.rpi.edu/XGMML" xmlns:cy="http://www.cytoscape.org" xmlns:xlink="http://www.w3.org/1999/xlink" directed="1">
  <att name="documentVersion" value="1.1"/>
  <node label="n1" id="1"/>
  <node label="n2" id="2"/>
  <node label="n3" id="3"/>
 
  <node label="inner1" id="4" />
  <node label="inner2" id="5" />
  <node label="inner3" id="6" />
 
  <node label="Group" id="7">
    <att name="__isGroup" value="1" type="boolean" cy:type="Boolean" cy:hidden="1"/>
    <att>
      <graph>
        <node xlink:href="#4" />
        <node xlink:href="#5" />
        <node xlink:href="#6" />
        <edge label="e3" source="4" target="5" />
        <edge label="e4" source="5" target="6" />
      </graph>
    </att>
  </node>

  <edge label="e1" source="1" target="2" />
  <edge label="e2" source="2" target="3" />
   
   
  <edge label="e6" source="2" target="5" />
   
</graph>

Something is still missing since after you collapse the e6 edge gets lost.


-- scooter


On 05/08/2018 04:45 PM, dustin....@gmail.com wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

dustin....@gmail.com

unread,
May 9, 2018, 2:05:05 AM5/9/18
to cytoscape-helpdesk
Hey Scooter,

Thanks for digging into this! I'm using 3.6.1 on OSX.

For some reason, I had thought that XGMML didn't care which graph the edges are located in... but I'm not 100% sure where I had found that, maybe that's a graphml thing. Good to know though. According to Google, it seems like the 'old' wiki had information about XGMML, but that seems to be lost to time... which is sad, since it seems to be the best import format to use if one cares about grouping.

Dustin

Scooter Morris

unread,
May 9, 2018, 12:07:05 PM5/9/18
to cytoscape...@googlegroups.com, Pratt, Dexter
On 05/08/2018 11:05 PM, dustin....@gmail.com wrote:
Hey Scooter,

Thanks for digging into this! I'm using 3.6.1 on OSX.

For some reason, I had thought that XGMML didn't care which graph the edges are located in... but I'm not 100% sure where I had found that, maybe that's a graphml thing.
It may also be a Cytoscape-specific thing related to how we're reading things in.

Good to know though. According to Google, it seems like the 'old' wiki had information about XGMML, but that seems to be lost to time... which is sad, since it seems to be the best import format to use if one cares about grouping.
It certainly is right now, although I'm pretty sure JSON formats such as CX will become increasingly important.  In fact, I would be surprised if CX didn't support groups, now that I think of it.  Dexter -- can you comment on this?  Does CX support Cytoscape groups?  I tried a round-trip to NDEx and lost my group information, but I'm not sure if that's CX or NDEx...

Dustin

-- scooter
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

Scooter Morris

unread,
May 9, 2018, 1:47:26 PM5/9/18
to Pratt, Dexter, cytoscape...@googlegroups.com, Demchak, Barry - forward, Chen, Jing
On 05/09/2018 10:32 AM, Pratt, Dexter wrote:
Hi Scooter, Dustin,

(I’ve cc’d Jing and Barry. Jing is leading the development efforts for Cytoscape - NDEx integration)

CX does support cytoscape groups. (Note that the NDEx cytoscape.js-based visualizer only partially handles their display)

I also tried a round trip and got a good result. I’m not sure why you would see different behavior if you have the latest versions of everything. (Jing, any ideas?)  But I did notice one problem: the names of the groups were lost. The rows for the groups are present in the node table but the names are blank.

I’ve attached the session file that has two collections:
- the manually created network with two groups.
- the network after round-trip through NDEx


You can download the CX from that network page.

Dexter


Interesting.  I did get the group node back (looks just like the network you are showing), but for some reason it was no longer a group when it got back to Cytoscape.  What's more, looking at the CX file, I don't see any content that shows the group relationships...

-- scooter

Chen, Jing

unread,
May 9, 2018, 5:16:40 PM5/9/18
to Scooter Morris, Pratt, Dexter, cytoscape...@googlegroups.com, Demchak, Barry - forward

Looks like there are couple of problems in cyNDEx2.

  1. The cyGroups aspect was not exported when exporting a single network. Only the visual properties are exported and imported correctly, so the round-tripped networks have the same look, but the group info is lost.
  2. When exporting the network as a collection. The CyGroups aspect was exported, but the importer doesn’t seem to recreate the groups correctly.

 

Thanks,

Jing

email to cytoscape-helpd...@googlegroups.com.
> To post to this group, send email to cytoscape...@googlegroups.com.
> Visit this group at

> To view this discussion on the web visit

https://groups.google.com/d/msgid/cytoscape-helpdesk/5fe893c0-3296-4fbb-a441-90f507d29338%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout.



--
===================================
Keiichiro Ono
http://keiono.github.io/
===================================

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at


To view this discussion on the web visit

--
You received this message because you are subscribed to the Google Groups "cytoscape-helpdesk" group.

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.
To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at


To view this discussion on the web visit

Pratt, Dexter

unread,
May 9, 2018, 5:16:40 PM5/9/18
to Scooter Morris, cytoscape...@googlegroups.com, Demchak, Barry - forward, Chen, Jing
Hi Scooter, Dustin,

(I’ve cc’d Jing and Barry. Jing is leading the development efforts for Cytoscape - NDEx integration)

CX does support cytoscape groups. (Note that the NDEx cytoscape.js-based visualizer only partially handles their display)

I also tried a round trip and got a good result. I’m not sure why you would see different behavior if you have the latest versions of everything. (Jing, any ideas?)  But I did notice one problem: the names of the groups were lost. The rows for the groups are present in the node table but the names are blank.

I’ve attached the session file that has two collections:
- the manually created network with two groups.
- the network after round-trip through NDEx


You can download the CX from that network page.

Dexter

On May 9, 2018, at 12:07 PM, Scooter Morris <sco...@cgl.ucsf.edu> wrote:

Session Testing Groups in CX.cys

dustin....@gmail.com

unread,
May 10, 2018, 9:09:56 PM5/10/18
to cytoscape...@googlegroups.com
Hi,

I ended up spending way too much time looking into this, and though I got something working, unfortunately I didn't quite end up with the results I was hoping.

I spent the better part of yesterday playing with XGMML, and I think the conclusion that I reached is that using XGMML and groups depends way too much on internal details of cytoscape, and because of various bugs that seem to exist with the group support and rendering them (can't render compound nodes without including a graphics element), it didn't seem worth going that route unless I wanted to do my own graphics rendering and output that to xgmml.

Instead of pursing that, I spent today modifying the graphml file input plugin to add subgraphs to groups. It took awhile to figure out how all the pieces went together and how avoid triggering various exceptions, but I finally got something to work. One of the problems is that I'm only able to add groups to the root network. I created a variation that added groups at all subgraphs, but it fails in various ways when trying to trigger the compound node display code (if someone is interested in that, I can push it to a separate branch).

I created a branch on github based on the 3.6.1 release that fixes a bug in the graphml ingest, and also takes graphml subgraphs and adds them to groups, and causes them to be rendered as compound nodes: https://github.com/virtuald/cytoscape-impl/commits/graphml-groups

I'm sure I need to RTFM, but looking through the github repos it's not really clear if/how one actually submits patches and/or bug reports to cytoscape. Redmine doesn't seem to allow creating an account (recaptcha is broken), and there aren't any pull requests on github so I suspect that isn't the right way either.

Finally, one really annoying bug that I keep running into is this one:

Caused by: java.lang.NullPointerException

at org.cytoscape.group.internal.view.ViewUtils.moveNode(ViewUtils.java:296)

at org.cytoscape.group.internal.view.ViewUtils.moveNodes(ViewUtils.java:238)


There's something somewhere that is supposed to add the node to the (current?) view, and it seems like there's a magical sequence of things that have to happen otherwise it doesn't get added and this NPE occurs. I suspect if someone addressed whatever that is, some of these group ingest problems might go away.

Another bug that I ran into is that if you have a set of nested groups, the innermost group doesn't seem to follow its node if you drag the outermost group around. That's fairly easy to duplicate, and I imagine it's also probably pretty easy to fix.

Dustin
To post to this group, send email to cytoscap...@googlegroups.com.

Scooter Morris

unread,
May 11, 2018, 12:04:07 AM5/11/18
to cytoscape...@googlegroups.com
Hi Dustin,


On 05/10/2018 06:09 PM, dustin....@gmail.com wrote:
Hi,

I ended up spending way too much time looking into this, and though I got something working, unfortunately I didn't quite end up with the results I was hoping.

I spent the better part of yesterday playing with XGMML, and I think the conclusion that I reached is that using XGMML depends way too much on internal details of cytoscape, and because of various bugs that seem to exist with the group support and rendering them (can't render compound nodes without including a graphics element), it didn't seem worth going that route unless I wanted to do my own graphics rendering and output that to xgmml.
Not quite the case, but I certainly understand how you came to that conclusion -- our groups support originally did not support the compound node visualization.  Initially we only supported an expand/contract visualization approach.


Instead of pursing that, I spent today modifying the graphml file input plugin to add subgraphs to groups. It took awhile to figure out how all the pieces went together and how avoid triggering various exceptions, but I finally got something to work. One of the problems is that I'm only able to add groups to the root network. I created a variation that added groups at all subgraphs, but it fails in various ways when trying to trigger the compound node display code (if someone is interested in that, I can push it to a separate branch).

I created a branch on github based on the 3.6.1 release that fixes a bug in the graphml ingest, and also takes graphml subgraphs and adds them to groups, and causes them to be rendered as compound nodes: https://github.com/virtuald/cytoscape-impl/commits/graphml-groups
Wow!  Excellent!!


I'm sure I need to RTFM, but looking through the github repos it's not really clear if/how one actually submits patches and/or bug reports to cytoscape. Redmine doesn't seem to allow creating an account (recaptcha is broken), and there aren't any pull requests on github so I suspect that isn't the right way either.
You can certainly provide us with a pull request and I'll be happy to take a look at it.


Finally, one really annoying bug that I keep running into is this one:

Caused by: java.lang.NullPointerException

at org.cytoscape.group.internal.view.ViewUtils.moveNode(ViewUtils.java:296)

at org.cytoscape.group.internal.view.ViewUtils.moveNodes(ViewUtils.java:238)


There's something somewhere that is supposed to add the node to the (current?) view, and it seems like there's a magical sequence of things that have to happen otherwise it doesn't get added and this NPE occurs. I suspect if someone addressed whatever that is, some of these group ingest problems might go away.
Yes and ... it's tricky.  The issue is here:

      if (memberEdges.size() == 0 && !nodeShownSet.contains(net.getSUID())) {

somehow, the group is getting added to the "nodeShownSet", or at least that's where I ran into problems looking at your initial XGMML file.   There is a comment in data/CyGroupSettingsImpl.java#setGroupViewType:

        // During session loading, we may have mis-identified the group view type because
        // we using the default.  If we did that, we might have incorrectly set the
        // group node shown flag.  Fix that now...

In the case of a compound node, the group node *should be* shown in both the input file and the resulting network.  The strange part here is that for some reason it *isn't* shown (or has been removed) but we still have it marked as being shown, so we don't add it back.  As a result, when we try to get the view for the group node, it doesn't exist and we get an NPE.


Another bug that I ran into is that if you have a set of nested groups, the innermost group doesn't seem to follow its node if you drag the outermost group around. That's fairly easy to duplicate, and I imagine it's also probably pretty easy to fix.
OK, I'll try to take a look at that.  Can you report it as a bug? (in Cytoscape Help->Report a bug).


Dustin


Thanks!! Excited to get your graphml improvement!

-- scooter
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-helpd...@googlegroups.com.

To post to this group, send email to cytoscape...@googlegroups.com.
Visit this group at https://groups.google.com/group/cytoscape-helpdesk.

dustin....@gmail.com

unread,
May 11, 2018, 12:28:42 AM5/11/18
to cytoscape-helpdesk
Hi Scooter,

I won't have time to mess with this until maybe next week, but I pushed two PRs:

* Simple fix: https://github.com/cytoscape/cytoscape-impl/pull/33
* Compound node thing: https://github.com/cytoscape/cytoscape-impl/pull/34

I'll try to create a testfile for the nested thing at some point and file a bug for it.

Thanks!
Reply all
Reply to author
Forward
0 new messages