parsing_utils.py
def loadMutationData(filename, graph, patient): 
    """ Load mutation 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:
                #filter by status?
                graph.nodes[gene_data[0]].mutation_type = gene_data[4]
                count += 1
            else:
                gene_true_name = checkAliases(gene_data[0], graph.nodes)
                if gene_true_name:
                    graph.nodes[gene_true_name].mutation_type = gene_data[4]
                    count += 1
                else:
                    print('Could not find suitable alias for', gene_data[0])
                    
    print('Loaded ' + str(count) + ' mutated genes.')
    file.close()
    return count
 Load mutation data onto the graph 
Load mutation data onto the graph
Load mutation data onto the graph
def loadMutationData(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:
                graph.nodes[gene_data[0]].mutation_type = gene_data[4]
                count += 1
            else:
                gene_true_name = checkAliases(gene_data[0], graph.nodes)
                if gene_true_name:
                    graph.nodes[gene_true_name].mutation_type = gene_data[4]
                    count += 1
                else:
                    print('Could not find suitable alias for', gene_data[0])
    print('Loaded ' + str(count) + ' mutated genes.')
    file.close()
    return count
def loadMutationData ( 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 : graph . nodes [ gene_data [ 0 ] ] . mutation_type = gene_data [ 4 ] count += 1 else : gene_true_name = checkAliases ( gene_data [ 0 ] , graph . nodes ) if gene_true_name : graph . nodes [ gene_true_name ] . mutation_type = gene_data [ 4 ] count += 1 else : print ( 'Could not find suitable alias for' , gene_data [ 0 ] ) print ( 'Loaded ' + str ( count ) + ' mutated genes.' ) file . close ( ) return count
Load mutation data onto the graph
Load mutation data onto the graph
""" Load mutation data onto the graph """ #first line has no data #filter by status?
filename
graph
patient