Added main.py that now contains the One & Only Singleton instance of these classes:
- Navigator - Aplication - Workflow - Project - Options Corresponding changes have been added in lots of other files to account for this, but the access to these objects should now be a lot easier.
This commit is contained in:
@@ -164,17 +164,12 @@ def read_gene_ontology(fd):
|
||||
section = s
|
||||
if s == 'Term':
|
||||
term = GOTerm()
|
||||
# print "[Term]"
|
||||
else:
|
||||
term = None
|
||||
#print "ignoring: %s" %s
|
||||
print "ignoring: %s" %s
|
||||
else:
|
||||
if term:
|
||||
_add_term_attribute(term, k, v, c)
|
||||
# print " %s: %s" % (k, v)
|
||||
# else:
|
||||
# print "no term: ignoring: %s" %line
|
||||
# print '.',
|
||||
line = fd.readline()
|
||||
|
||||
if term:
|
||||
@@ -182,6 +177,18 @@ def read_gene_ontology(fd):
|
||||
|
||||
return go
|
||||
|
||||
|
||||
def pickle_gene_ontology(go, fn):
|
||||
fd = open(fn, 'wb')
|
||||
pickle.dump(go, fd)
|
||||
fd.close()
|
||||
|
||||
def load_pickled_ontology(fn):
|
||||
fd = open(fn, 'rb')
|
||||
go = pickle.load(fd)
|
||||
fd.close()
|
||||
return go
|
||||
|
||||
def read_default_go():
|
||||
f = open("/usr/share/gene-ontology/gene_ontology.obo")
|
||||
go = read_gene_ontology(f)
|
||||
|
Reference in New Issue
Block a user