Skip to content
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: Improve cytoscape graphing #87

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

rbasu101
Copy link
Contributor

With the shift to cytoscape, many improvements have been made:

  • Compound Nodes: Each cluster of node (Defined by nodes that share the same neighboring drug(s) or gene(s)) is grouped by a parent compound node. This makes it very easy to distinguish one group from another, and to move groups around in the graph app.
  • Barebone tests have been made for network_graph.py
  • network_graph.py has been refactored to condense and improve the readability of the code

Clusters Drugs (for gene searchs) and Genes (for drug searchs) will be put into a unique parent node based on the connected gene/drug all the nodes in the cluster share. Doing this makes it much easier to visually distinguish one cluster from another, and also allows a user to move clusters around without having to move each node individually.
Added barebone tests for network_graph, to be expanded/formalized in the future.
Fixed bug in which selecting a compound node caused an error. The error was due to the fact compound nodes lack a node_degree attribute (which node selection checks for). Problem was fixed by checking whether the node has a node_degree attribute
Made numerous changes to improve the readability of network_graph.py, and to remove redundant code (left over from the shift to cytoscape):
- Removed pandas dependency (Redundant, as functions were using dict)
- Modified dict iteration in initalize_network() to improve readability
- Privated initalize_network() (initalize_network serves as only one part of the overall create_network() function (which is public). initalize_network() should not be directly run itself)
- Removed node color/size assignment from add_node_attributes() (With the shift to cytoscape, Node color/size assignment is now done in graph_app.py)
- Moved node_degree attribute assignment to add_node_attributes()
Code was refactored so as to remove redundant iteration and variable instantiation
Previously, any nodes without a group would create an additoinal 'None' group, which would result in the addition of a single unlabeled node in the graph. This has been fixed by removing the 'None' group.
@rbasu101 rbasu101 added the priority:low Low priority label Nov 29, 2024
@rbasu101 rbasu101 self-assigned this Nov 29, 2024
@rbasu101 rbasu101 linked an issue Nov 29, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low Low priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Cytoscape Graph Visualization
1 participant