Exemple #1
0
    def __init__(self, file_name, save_synonyms = False):
	import OboParser
	self.g = OboParser.getOboGraph(file_name, save_synonyms)
	self.precalculated_descendants = {}
	self.child_to_parent = None
	return
Exemple #2
0
 def __init__(self, file_name, save_synonyms=False):
     import OboParser
     self.g = OboParser.getOboGraph(file_name, save_synonyms)
     self.precalculated_descendants = {}
     self.child_to_parent = None
     return
Exemple #3
0
#This script makes the distribution of GO terms anotated using second level Terms
global Dict2, obos
import sys, os
sys.path.append(os.path.split(sys.argv[0])[0])
sys.path.append(os.path.split(sys.argv[0])[0]+"/Utilities")
sys.path.append("Utilities")
import GoRelationalFunctions
import Config
import StringIO
import OboParser
#Function that gives GOID information (OBO imported from DB)
OBOs=OboParser.parseObo(open("Data/go.obo","r"))
Dict2={}

##@param Gowanted
#Name of file containing the GO terms to serach
#Initializes the  wanted terms dictionary
def loadTerms(GOwanted):
	Data_in=open(GOwanted,"r")
	global Dict2
	counter=0
	for line in Data_in:
		data_main=line.replace(" ","").replace("\n","")
		Dict2[data_main]=[]
	
#Asocciates GO Identifiers with a second level parent and stores results y main Dictionary
def asocciate(in_file):
	in_file=open(in_file,"r")
	for line in in_file:
		contig_id=line.split(",")[0]
		if line.split(",")[1]=="NotFound" or line.split(",")[1]=="":