diff --git a/.github/workflows/sphinx_autodoc.yaml b/.github/workflows/sphinx_autodoc.yaml index 0fa3dba..94e2069 100644 --- a/.github/workflows/sphinx_autodoc.yaml +++ b/.github/workflows/sphinx_autodoc.yaml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 diff --git a/neko/_visual/visualize_network.py b/neko/_visual/visualize_network.py index dcce18e..28d7380 100644 --- a/neko/_visual/visualize_network.py +++ b/neko/_visual/visualize_network.py @@ -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) @@ -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: diff --git a/neko/core/network.py b/neko/core/network.py index e25ffe4..a8b3b50 100644 --- a/neko/core/network.py +++ b/neko/core/network.py @@ -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) diff --git a/poetry.lock b/poetry.lock index 71318e9..208180b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3730,4 +3730,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.10,<4.0" -content-hash = "1ff1b90d3e466f7c7c04487d9adc17e8fa875c2fe68a5ff9f4bbddfd70f0d48a" +content-hash = "cea7f3ec82de9303777b7c541273e8a6e36a99688ade17401fed605c6e602a66" diff --git a/pyproject.toml b/pyproject.toml index d50c23b..7ac9e07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -40,7 +40,7 @@ unipressed = "*" jupyterlab = "*" pycurl = "*" graphviz = "*" -pandas = "*" +pandas = "2.2.2" [tool.poetry.dev-dependencies] pandoc = "*"