Skip to content

Commit

Permalink
fixed small bug when importing the sif file, fixed tissue mapping, up…
Browse files Browse the repository at this point in the history
…dated pyproject.toml
  • Loading branch information
marcorusc committed Sep 27, 2024
1 parent fac08fe commit 848a16f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sphinx_autodoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2

Expand Down
10 changes: 8 additions & 2 deletions neko/_visual/visualize_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def __init__(self, network, predefined_node=None, color_by="Effect", noi=False):
self.__add_edges_to_graph()
self.__add_nodes_to_graph()

def __set_custom_edge_colors(self, custom_edge_colors):
def set_custom_edge_colors(self, custom_edge_colors):
# Update the edge_colors dictionary with custom mappings
self.__edge_colors.update(custom_edge_colors)

def __set_node_colors(self, node_colors):
def set_node_colors(self, node_colors):
# Update the node_colors dictionary with custom node colorsdataframe_nodes
self.__node_colors.update(node_colors)

Expand Down Expand Up @@ -161,6 +161,12 @@ def render(self, output_file='network', view=False, highlight_nodes=None, highli
highlight_nodes (list): List of nodes to highlight.
highlight_color (str): Color to use for highlighting nodes.
"""
# Apply colors from __node_colors if available
if self.__node_colors:
for node, color in self.__node_colors.items():
if node in self.__dataframe_nodes['Genesymbol'].values:
self.graph.node(node, style='filled', fillcolor=color)

# If highlight_nodes is provided, set the color for each node in the list
if highlight_nodes is not None:
for node in highlight_nodes:
Expand Down
2 changes: 1 addition & 1 deletion neko/core/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def _populate(self):
self.__drop_missing_nodes()
self.nodes.reset_index(inplace=True, drop=True)

elif sif_files := self._init_args['sif_file']:
elif sif_file := self._init_args['sif_file']:
self.initial_nodes = []
self.__load_network_from_sif(sif_file)

Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "nekomata"
version = "0.9.5"
version = "0.9.6"
description = "Package to extract, visualize, convert and study interactions from database into executable activity flow based model"
license = "GNU General Public License Version 3"
authors = [
Expand Down Expand Up @@ -40,7 +40,7 @@ unipressed = "*"
jupyterlab = "*"
pycurl = "*"
graphviz = "*"
pandas = "*"
pandas = "2.2.2"

[tool.poetry.dev-dependencies]
pandoc = "*"
Expand Down

0 comments on commit 848a16f

Please sign in to comment.