Skip to content

Commit

Permalink
Change: Use pygraphviz to draw the pipeline workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dileep-kishore committed Feb 2, 2021
1 parent 18325d9 commit 0a15e07
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 180 deletions.
17 changes: 10 additions & 7 deletions env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ channels:
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=1_gnu
- ca-certificates=2020.12.5=ha878542_0
- cairo=1.14.12=h7636065_2
- certifi=2020.12.5=py38h578d9bd_1
Expand All @@ -26,7 +27,8 @@ dependencies:
- libedit=3.1.20191231=h14c3975_1
- libffi=3.3=he6710b0_2
- libgcc=7.2.0=h69d50b8_2
- libgcc-ng=9.1.0=hdf63c60_0
- libgcc-ng=9.3.0=h2828fa1_18
- libgomp=9.3.0=h2828fa1_18
- libpng=1.6.37=hbc83047_0
- libssh2=1.9.0=h1ba5d50_1
- libstdcxx-ng=9.1.0=hdf63c60_0
Expand All @@ -38,11 +40,12 @@ dependencies:
- ncurses=6.2=he6710b0_1
- nextflow=20.10.0=hecda079_0
- openjdk=8.0.152=h7b6447c_3
- openssl=1.1.1i=h27cfd23_0
- openssl=1.1.1i=h7f98852_0
- pango=1.42.0=h377f3fa_0
- pcre=8.44=he6710b0_0
- pip=20.3.3=py38h06a4308_0
- pixman=0.40.0=h7b6447c_0
- pygraphviz=1.7=py38h0d738da_0
- python=3.8.5=h7579374_1
- python_abi=3.8=1_cp38
- readline=8.0=h7b6447c_0
Expand Down Expand Up @@ -82,10 +85,10 @@ dependencies:
- idna==2.10
- imagesize==1.2.0
- iniconfig==1.1.1
- ipython==7.19.0
- ipython==7.20.0
- ipython-genutils==0.2.0
- isort==5.7.0
- jedi==0.17.2
- jedi==0.18.0
- jinja2==2.11.3
- jinja2schema==0.1.4
- kiwisolver==1.3.1
Expand All @@ -104,7 +107,7 @@ dependencies:
- numpydoc==1.1.0
- packaging==20.9
- pandas==1.2.1
- parso==0.7.1
- parso==0.8.1
- pathspec==0.8.1
- patsy==0.5.1
- pexpect==4.8.0
Expand Down Expand Up @@ -141,7 +144,7 @@ dependencies:
- sphinxcontrib-qthelp==1.0.3
- sphinxcontrib-serializinghtml==1.1.4
- spinners==0.0.24
- statsmodels==0.12.1
- statsmodels==0.12.2
- termcolor==1.1.0
- toml==0.10.2
- traitlets==5.0.5
Expand Down
9 changes: 4 additions & 5 deletions micone/pipelines/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

import collections
import math
import pathlib
import time
from itertools import chain
Expand All @@ -14,7 +13,6 @@
import toml

from ..config import Config
from ..utils.hierarchical_layout import hierarchy_pos
from .command import Command
from .process import Process, stringizer

Expand Down Expand Up @@ -319,9 +317,10 @@ def draw_process_tree(self, fpath: str) -> None:
gml = pathlib.Path(fpath) / "DAG.gml"
nodes = list(self.process_tree.nodes)
labels = {n: n.split(".", 2)[-1] for n in nodes}
pos = hierarchy_pos(tree, width=2 * math.pi)
# If you want a radial graph
# new_pos = {u:(r*math.cos(theta),r*math.sin(theta)) for u, (theta, r) in pos.items()}
if len(nodes) > 50:
pos = nx.drawing.nx_agraph.graphviz_layout(tree, prog="twopi")
else:
pos = nx.drawing.nx_agraph.graphviz_layout(tree, prog="dot")
nx.draw_networkx_nodes(tree, pos, node_size=500, alpha=0.8)
nx.draw_networkx_edges(tree, pos, width=1.0, arrows=True)
text = nx.draw_networkx_labels(tree, pos, labels=labels, font_size=8)
Expand Down
168 changes: 0 additions & 168 deletions micone/utils/hierarchical_layout.py

This file was deleted.

0 comments on commit 0a15e07

Please sign in to comment.