cytoscape / py2cytoscape

Python utilities for Cytoscape and Cytoscape.js
https://py2cytoscape.readthedocs.io
MIT License
178 stars 45 forks source link

problem edge bending py2cytoscape 0.7 python 3.7 #101

Open Benito-chem opened 4 years ago

Benito-chem commented 4 years ago

I have some difficulties to bend some edges as I want. the order : edge.get_properties(network=network, edgeList='interaction:0052',propertyList='Bend, Curved') gives : [{'SUID': 7048, 'visualProperties': [{'visualProperty': 'EDGE_CURVED', 'value': True}, {'visualProperty': 'EDGE_BEND', 'value': '0.3903621449287956,-0.9206613904181005,0.7721361466470388'}]}] The bending has three parameters.

I set the properties edge.set_properties(network=network, edgeList='interaction:0052', propertyList='Curved', valueList='True') and edge.set_properties(network=network, edgeList='interaction:0052', propertyList='Bend', valueList='+10.')

If I put three parameters in valueList that do not work. I have got in the Cytoscape task history windows: Property list and value list are not the same length  Task (org.cytoscape.command.internal.CommandExecutorTask@7562529f) status: Property list and value list are not the same length That is the reason why I set only one parameter (try and see strategy). Nevertheless that do not work. The edge is straigh

Benito-chem commented 4 years ago

My program

`# PYTHON 3.7 from py2cytoscape import cyrest import os,sys model=cyrest.cyclient() model.status() file = os.path.abspath('sample.cys') model.session.open(file)

network='Free_CH4_AIR_phi=0.8' Edge_get_Prop=model.edge.get_properties(network=network, edgeList='interaction:0052',propertyList='Bend, Curved') print ('edge.get_properties : ',Edge_get_Prop) print ('------------------------------------------------------------------') model.edge.set_properties(network=network, edgeList='interaction:0052', propertyList='Curved', valueList='True') model.edge.set_properties(network=network, edgeList='interaction:0052', propertyList='Bend', valueList='+1.') ` Loading :

Before

After set_properties:

After