parsing_utils.py
def loadExpressionData(filename, graph, patient): #add option to do it by patient?
    """ Load expression data onto the graph """
    file = open(filename, 'r')
    next(file) #first line has no data
    count = 0
    for line in file:
        gene_data = line.split('\t')
        if gene_data[1] == patient or patient == 'ALL':
            if gene_data[0] in graph.nodes:
                node = graph.nodes[gene_data[0]]
                node.expression_level = gene_data[2]
                count += 1
            else:
                gene_true_name = checkAliases(gene_data[0], graph.nodes)
                if gene_true_name:
                    node = graph.nodes[gene_true_name]
                    node.expression_level = gene_data[2]
                    count += 1
                else:
                    print('Could not find suitable alias for', gene_data[0])
    print('Loaded ' + str(count) + ' differentially expressed genes.')
    file.close()
    return count
 Load expression data onto the graph 
Load expression data onto the graph
Load expression data onto the graph
def loadExpressionData(filename, graph, patient): 
    file = open(filename, 'r')
    next(file) 
    count = 0
    for line in file:
        gene_data = line.split('\t')
        if gene_data[1] == patient or patient == 'ALL':
            if gene_data[0] in graph.nodes:
                node = graph.nodes[gene_data[0]]
                node.expression_level = gene_data[2]
                count += 1
            else:
                gene_true_name = checkAliases(gene_data[0], graph.nodes)
                if gene_true_name:
                    node = graph.nodes[gene_true_name]
                    node.expression_level = gene_data[2]
                    count += 1
                else:
                    print('Could not find suitable alias for', gene_data[0])
    print('Loaded ' + str(count) + ' differentially expressed genes.')
    file.close()
    return count
def loadExpressionData ( filename , graph , patient ) : file = open ( filename , 'r' ) next ( file ) count = 0 for line in file : gene_data = line . split ( '\t' ) if gene_data [ 1 ] == patient or patient == 'ALL' : if gene_data [ 0 ] in graph . nodes : node = graph . nodes [ gene_data [ 0 ] ] node . expression_level = gene_data [ 2 ] count += 1 else : gene_true_name = checkAliases ( gene_data [ 0 ] , graph . nodes ) if gene_true_name : node = graph . nodes [ gene_true_name ] node . expression_level = gene_data [ 2 ] count += 1 else : print ( 'Could not find suitable alias for' , gene_data [ 0 ] ) print ( 'Loaded ' + str ( count ) + ' differentially expressed genes.' ) file . close ( ) return count
Load expression data onto the graph
Load expression data onto the graph
#add option to do it by patient? """ Load expression data onto the graph """ #first line has no data
filename
graph
patient