<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">'''
Sumeetha Swaminathan
Summer 2014
GenerateDirectedBetweenness.py
This will compute the betweenness centrality for a directed graph and 
send the information to a text file. It will also compute the disease
specific centralities and write it to a text file.

'''

import GeneDirectedPathFinder2 as gd
import GDCFDirected as g
import CreateListToTest as cList

def run():
	graph = gd.Read_PPI_diGraph()
	'''betDict = gd.generate_betweeness(graph)
	print betDict
	with open("../data/betweennessd.csv", 'w') as file:
		for node in sorted(betDict.items(), key = lambda x:x[1], reverse = True):
			file.write(node[0] + "," + str(node[1]) + "\n")'''
			
	listOfGenes=cList.Create_Test_List(graph)
	geneCounts = g.Create_Pairs_And_Find_Paths_With_Repeats(listOfGenes, graph)
	betDisDict = g.Normal_Betweenness_Calc(geneCounts, listOfGenes, graph)
	with open("../data/autism-g-u-genedatalist.csv", 'w') as file:
		for node in betDisDict:
			file.write(node + "," + str((betDisDict[node][1])*1000) + "," + str(geneCounts[node]) + "\n")</pre></body></html>