Closed mwang87 closed 5 years ago
You have to pass the contents of the XML, not the file path.
with open('styles.xml') as f:
cytoscape.vizmap.load_file(f.read(), verbose=True)
(Needless to say the pull request needs to be merged first before this actually works.)
Thanks! I still have the same issue when passing in the xml string.
I know. There is a problem with the code and your usage. #89 needs to be merged before this will actually work.
If you want to try it right now. You can uninstall the original version and do pip3 install git+https://github.com/zachary822/py2cytoscape.git@5712ea6fc131ad0e11f565c0377c428961cd1d40
LOL, maybe I should actually read the full context of the message next time. Thanks for the help. I'll wait for it to get merged into master and try again.
I attempt to execute this code:
from py2cytoscape import cyrest
cytoscape=cyrest.cyclient() cytoscape.version() cytoscape.network.list() cytoscape.vizmap.load_file(afile="./styles.xml", verbose=True)
where styles.xml is exported as an xml style from Cytoscape UI
Cytoscape: 3.7.1
CyRest: 1
Java:
Code:
error:
apiVersion v1 cytoscapeVersion 3.7.1
UnboundLocalError Traceback (most recent call last)