Running Kamada-Kawai layout as a Cytoscape app

31 views
Skip to first unread message

Duncan Forster

unread,
Mar 29, 2023, 5:24:31 PM3/29/23
to cytoscape-app-dev
Hello,

I am trying to create a modified version of the Kamada-Kawai network layout algorithm (BioLayoutKKAlgorithmTask) in Cytoscape. Ultimately, I want to modify the potential energy function and the resulting partial derivatives to include a regularization term that will attract certain nodes to predefined x, y coordinates (note that this is different from setting these nodes positions and not laying them out because I want these nodes to be able to deviate from their predefined coordinates).

Recently I was advised that the best way to modify Kamada-Kawai was to create a Cytoscape app, following the sample-custom-layout template and copying in the `BioLayoutKKAlgorithmTask` code. I've tried this in various ways but haven't had any success given the complexity of the Cytoscape API and my inexperience with Java.

A good start would be to simply replicate the original `BioLayoutKKAlgorithmTask` as a Cytoscape app, then I could work from there. I've tried this by adding the `layout-cytoscape-impl` dependency to the `pom.xml` and importing `BioLayoutKKAlgorithmTask` and `BioLayoutKKContext`. When I try replacing the `CustomLayoutContext` with `BioLayoutKKContext`the app fails to start with the following obtuse `output.log`:

karaf.base: K:\Cytoscape\Cytoscape_v3.9.1\framework
JAVA_HOME: null
org.cytoscape.app.internal.exception.AppStartupException: Bundle start error
at org.cytoscape.app.internal.manager.BundleApp.start(BundleApp.java:84) ~[!/:?]
at org.cytoscape.app.internal.manager.AppManager.startApps(AppManager.java:404) [!/:?]
at org.cytoscape.app.internal.manager.AppManager.initializeApps(AppManager.java:374) [!/:?]
at org.cytoscape.app.internal.manager.AppManager.lambda$attemptInitialization$0(AppManager.java:235) [!/:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: org.osgi.framework.BundleException: Unable to resolve org.cytoscape.sample-custom-layout [128](R 128.0): missing requirement [org.cytoscape.sample-custom-layout [128](R 128.0)] osgi.wiring.package; (osgi.wiring.package=csapps.layout.algorithms.bioLayout) Unresolved requirements: [[org.cytoscape.sample-custom-layout [128](R 128.0)] osgi.wiring.package; (osgi.wiring.package=csapps.layout.algorithms.bioLayout)]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4149) ~[?:?]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2119) ~[?:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) ~[?:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984) ~[?:?]
at org.cytoscape.app.internal.manager.BundleApp.start(BundleApp.java:82) ~[!/:?]
... 8 more

This is just one of many problems I run into when playing around with the custom layout template. Would it be possible for someone to sketch a rough outline of how `BioLayoutKKAlgorithmTask`could be implemented as a Cytoscape app?

Thanks in advance,
Duncan

Mike Kucera

unread,
Mar 30, 2023, 8:41:50 AM3/30/23
to cytoscap...@googlegroups.com
Hi Duncan,

I'll send you a working app later today.


--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-app-dev/5b10fd2f-9ab2-4e8e-8875-90268e60593bn%40googlegroups.com.

Scooter Morris

unread,
Apr 5, 2023, 10:13:06 PM4/5/23
to cytoscape-app-dev
Hi Duncan,

You may also want to take a look at boundaryLayout, which constrains nodes to a particular region -- not the same as what you want to do, but you may find it a useful template.

-- scooter
Reply all
Reply to author
Forward
0 new messages