src/scBONITA/keggParser.py
def parseKEGGdict():
    """makes a dictionary to convert ko numbers from KEGG into real gene names
    #this is all file formatting. it reads a line, parses the string into the gene name and ko # then adds to a dict that identifies the two."""
    converterDict = {}
    pathwayFile = requests.get("http://rest.kegg.jp/get/br:ko00001", stream=True)
    for line in pathwayFile.iter_lines():
        line = line.decode("utf-8")
        if (
            len(line) > 1 and line[0] == "D"
        ):  # lines which begin with D translate kegg codes to gene names
            # to split into kegg code, gene names
            converter = re.split(r"\s+", re.split(r";", line)[0])
            converterDict[converter[1].upper()] = converter[2].upper()
    return converterDict
makes a dictionary to convert ko numbers from KEGG into real gene names
    #this is all file formatting. it reads a line, parses the string into the gene name and ko # then adds to a dict that identifies the two.
makes a dictionary to convert ko numbers from KEGG into real gene names
this is all file formatting. it reads a line, parses the string into the gene name and ko # then adds to a dict that identifies the two.
makes a dictionary to convert ko numbers from KEGG into real gene names this is all file formatting . it reads a line parses the string into the gene name and ko # then adds to a dict that identifies the two .
def parseKEGGdict():
    converterDict = {}
    pathwayFile = requests.get("http://rest.kegg.jp/get/br:ko00001", stream=True)
    for line in pathwayFile.iter_lines():
        line = line.decode("utf-8")
        if (
            len(line) > 1 and line[0] == "D"
        ):  
            converter = re.split(r"\s+", re.split(r";", line)[0])
            converterDict[converter[1].upper()] = converter[2].upper()
    return converterDict
def parseKEGGdict ( ) : converterDict = { } pathwayFile = requests . get ( "http://rest.kegg.jp/get/br:ko00001" , stream = True ) for line in pathwayFile . iter_lines ( ) : line = line . decode ( "utf-8" ) if ( len ( line ) > 1 and line [ 0 ] == "D" ) : converter = re . split ( r"\s+" , re . split ( r";" , line ) [ 0 ] ) converterDict [ converter [ 1 ] . upper ( ) ] = converter [ 2 ] . upper ( ) return converterDict
makes a dictionary to convert ko numbers from KEGG into real gene names
this is all file formatting.
makes a dictionary to convert ko numbers from KEGG into real gene names this is all file formatting .
"""makes a dictionary to convert ko numbers from KEGG into real gene names
    #this is all file formatting. it reads a line, parses the string into the gene name and ko # then adds to a dict that identifies the two.""" # lines which begin with D translate kegg codes to gene names
 # to split into kegg code, gene names
