Skip to content

Commit

Permalink
mv to fnc
Browse files Browse the repository at this point in the history
  • Loading branch information
dvklopfenstein committed Jun 16, 2018
1 parent 3d9366f commit ca146fa
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions goatools/cli/gosubdag_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ def get_go_color(self, **kws):
if not ret['GOs']:
# If the GO-DAG is sufficiently small, print all GO IDs
if len(self.go2obj) < self.max_gos:
main_gos = set(o.id for go, o in self.go2obj.items() if go != o.id)
go_leafs = set(go for go, o in self.go2obj.items() if not o.children)
ret['GOs'] = go_leafs.difference(main_gos)
self._add_all_leafs(ret)
else:
raise RuntimeError("GO IDs NEEDED")
go2obj = {go:self.go2obj[go] for go in ret['GOs']}
Expand Down Expand Up @@ -168,6 +166,12 @@ def _add_gochildleaf(self, ret):
if goid not in go2color:
go2color[goid] = leaf_go_color

def _add_all_leafs(self, ret):
"""Print all GO IDs."""
main_gos = set(o.id for go, o in self.go2obj.items() if go != o.id)
go_leafs = set(go for go, o in self.go2obj.items() if not o.children)
ret['GOs'] = go_leafs.difference(main_gos)

@staticmethod
def _update_ret(ret, goids, go2color):
"""Update 'GOs' and 'go2color' in dict with goids and go2color."""
Expand Down
Binary file modified tests/data/images/heartjogging_r0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/images/heartjogging_r1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/images/secretory_r0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/images/secretory_r1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/images/smell_r0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/data/images/smell_r1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca146fa

Please sign in to comment.