-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add cytoscape export #75
Conversation
dgidb.py: Added get_drug_list(), which pulls all drug names present in DGIdb graph_app.py: Reformatted and renamed many variables/functions for consistency Added search mode selection menu, allowing users to choose between gene and drug mode. Selecting a mode will update the terms dropdown menu with genes or drugs respectively, and allow genes or drugs to be graphed. Node selection, the neighbors dropdown menu, and edge selection, all function as expected in drug mode. network_graph.py: Updated code to support drug-search interaction data
Now changes node_color and sizes based on search_mode Whereas before there only existed single/multi degree drugs, genes now are displayed to be single/multi degree In summary: Genes and Drugs are larger when in their respective search mode Blue and Red nodes represent single-degree genes and drugs respectively Cyan and Orange nodes represent multi-degree genes and drugs respectively
Removed trailing whitespace on 2 lines.
- Previously implementation of using plotly to visualize the the networkx graph has now been replaced with cytoscape - All previously used plotly functions have been removed - Functionality of __add_node_attributes has been moved to the stylesheet of cytoscape_figure in __set_app_layout() in graph_app.py - generate_cytoscape() handles creation of a cytoscape graph from a networkx graph - Basic implementation of cytoscape - Nodes are categorized by whether or not they are genes and their degree - Further stylistic distinction TBD - Many elements on right sidebar may not currently work as intended TBD
All info-boxes and user-interaction features (found on the right side of graph app) are now functional with the cytoscape: Selecting nodes AND edges works as intended Neighbor Dropdown properly updates with selected nodes Edge info properly updates when an edge is selected OR when a node is selected and a neighbor from the dropdown menu is selected Various variables and functions have been renamed for better consistency
Part 1: Merge branch 'master' into "cash-cytoscape-integration"
Due to interaction data no longer being a pandas, code alterations were to made to fix iteration. Naming differences were also ammended for sources and pmid.
Merging main main to this branch resulted in the updated test being overriden by the old one. The updated test has now been restored.
README and a query did not get correctly merged. This commit ammends that
Imported JSON to allow a cytoscape-figure to exported as a JSON. Added card header to 'Selection Info' for consistency. Added New Card with two buttons allowing the user to download the current cytoscape figure as a .png or a .json. Removed '_get_node_data_from_id' as it is unused. Added '_generate_png' and 'generate_json' to handle png and json generation.
Added the 'class_name="m-1"' attribute to the 'export graph' buttons to visually space them apart.
In Cytoscape's documentation, there is also options to download the graph as a .svg or a .jpg. However, In my testing:
|
@rbasu101 SVG would be nice, but if it doesn't work, it doesn't work. Agree that there's no need for multiple basic image formats. |
Added functionality to export .svg images from the cytoscape graph. A new button exists to export the graph as an .svg.
I found out that .svg exporting does work, but it requires this line of code to be at the top. |
Two buttons were added to graph_app that allows a user to download the generated graph either as a .png, or as a .json (based on the selected button).
Resolves #72