cytoscape / py4cytoscape

Python library for calling Cytoscape Automation via CyREST
https://Py4Cytoscape.readthedocs.io
Other
70 stars 14 forks source link

faster select_all_* functions #80

Closed AlexanderPico closed 2 years ago

AlexanderPico commented 2 years ago

Turns out this is really slow on large networks: https://github.com/cytoscape/py4cytoscape/blob/master/py4cytoscape/network_selection.py#L493

Rather than collecting all edge SUIDs and then passing them to select_edges, you can simply use the CyCommands keyword, "all"

Same for select_all_nodes

And you can also add a select_all function that passes "all" for both lists in a single commandPost(), e.g., in RCy3 https://github.com/cytoscape/RCy3/blob/master/R/NetworkSelection.R#L77

bdemchak commented 2 years ago

Now matches RCy3: sped up selectall*, added select_all

https://github.com/cytoscape/py4cytoscape/commit/36ad7c308a351f392dba0be6a90b6192b8ed214b