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