Using the edge weight for force directed layout (CoSE) in cytoscape.js -


  1. i not sure how best utilize edge weight (e.g. strength of interaction between 2 interacting proteins) while generating force directed layout using cose plugin in cytoscape.js. provide pointers. should "idealedgelength" or "edgeelasticity"?

  2. (edit) following figure showing (a) , trying achieve (b). below parameters used generating layout.

thanks, datta.

ps: click view figure showing current (labelled "a") , expected (labelled "b") layouts. following layout options "a".

    var options = {         name: 'cose',         // called on `layoutready`         ready: function () { },         // called on `layoutstop`         stop: function () { },         // whether animate while running layout         animate: true,         // number of iterations between consecutive screen positions update (0 -> updated on end)         refresh: 20,         // whether fit network view after when done         fit: true,         // padding on fit         padding: 30,         // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }         boundingbox: undefined,         componentspacing: 100,         // whether randomize node positions on beginning         randomize: true,         // whether use js console print debug messages         debug: false,         // node repulsion (non overlapping) multiplier         noderepulsion: 400000,         // node repulsion (overlapping) multiplier         nodeoverlap: 10,         // ideal edge (non nested) length         idealedgelength: 10,         // divisor compute edge forces         edgeelasticity: 100,         // nesting factor (multiplier) compute ideal edge length nested edges         nestingfactor: 5,         // gravity force (constant)         gravity: 80,         // maximum number of iterations perform         numiter: 10000,         // initial temperature (maximum node displacement)         initialtemp: 100,         // cooling factor (how temperature reduced between consecutive iterations         coolingfactor: 0.95,         // lower temperature threshold (below point layout end)         mintemp: 1.0     }; 

you can specify functions instead of static numbers key cose layout settings. functions take edges (or nodes, in cases), can tailor layout based on edge properties.

so this:

      idealedgelength: function (edge) {         // default is: 10         // instead, base on "weight"         return edge.data().weight * .5       },        edgeelasticity: function (edge) {         // default is: 100         // instead, base on "weight"         return edge.data().weight * 4       }, 

you'll have experiment ranges work layout engine , range of weight expecting input, approach should work aok.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -