Skip to content

Commit

Permalink
GO args may be BP, MF, or CC instead of needing to remember GO:000815…
Browse files Browse the repository at this point in the history
…0, GO:0003674, or GO:0005575
  • Loading branch information
dvklopfenstein committed Jul 18, 2018
1 parent 24023dc commit a900dea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions goatools/cli/gos_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
import re
from goatools.gosubdag.go_tasks import get_go2obj_unique
from goatools.godag.consts import Consts


class GetGOs(object):
Expand All @@ -16,6 +17,7 @@ class GetGOs(object):
def __init__(self, go2obj=None, max_gos=None):
self.go2obj = go2obj
self.max_gos = max_gos
self.godagconsts = Consts()

def get_goids(self, go_args, fin_goids, prt):
"""Return source GO IDs ."""
Expand Down Expand Up @@ -65,8 +67,7 @@ def rdtxt_gos(go_file, prt):
prt.write(" {N} GO IDs READ: {TXT}\n".format(N=len(goids), TXT=go_file))
return goids

@staticmethod
def get_goargs(go_args, prt):
def get_goargs(self, go_args, prt):
"""Get GO IDs and colors for GO IDs from the GO ID runtime arguments."""
goids = set()
go2color = {}
Expand All @@ -79,8 +80,10 @@ def get_goargs(go_args, prt):
goids.add(goid)
if color:
go2color[goid] = color
elif go_arg in self.godagconsts.NS2GO:
goids.add(self.godagconsts.NS2GO[go_arg])
elif prt:
prt.write("WARNING: UNRECOGNIZED ARG({})".format(go_arg))
prt.write("WARNING: UNRECOGNIZED ARG({})\n".format(go_arg))
return goids

# Copyright (C) 2016-2018, DV Klopfenstein, H Tang. All rights reserved.

0 comments on commit a900dea

Please sign in to comment.