def main():
    '''
    print "time_evol module is the main code."
    ## to import a network of 3-node example
    EDGE_FILE = '../data/example/example-net-edges.dat'
    NODE_FILE = '../data/example/example-net-nodes.dat'

    net = inet.read_network_from_file(EDGE_FILE, NODE_FILE)
    nodes_list = inet.build_nodes_list(NODE_FILE)


    ## to obtain time series data for all possible initial conditions for 3-node example network
    timeSeriesData = ensemble_time_series(net, nodes_list, 2, 10)#, Nbr_States=2, MAX_TimeStep=20)
    initState = 1
    biStates = decimal_to_binary(nodes_list, initState)
    print 'initial state', biStates

    ## to print time series data for each node: a, b, c starting particualr decimal inital condition 1
    print 'a', timeSeriesData['a'][1]
    print 'b', timeSeriesData['b'][1]
    print 'c', timeSeriesData['c'][1]


    ## to obtain and visulaize transition map in the network state space
    decStateTransMap = net_state_transition(net, nodes_list)
    nx.draw(decStateTransMap)
    plt.show()

    ## to find fixed point attractors and limited cycle attractors with given transition map.
    attractors = find_attractor(decStateTransMap)
    print attractors
    '''

    ## to obtain biological sequence for the Fission Yeast Cell-Cycle Net starting from biological inital state
    EDGE_FILE = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-net-edges-new-names.dat'
    NODE_FILE = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-net-nodes-new-names.dat'
    BIO_INIT_FILE = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-bioSeq-initial.txt'

    net = inet.read_network_from_file(EDGE_FILE, NODE_FILE)
    nodes_list = inet.build_nodes_list(NODE_FILE)
    bio_initStates = inet.read_init_from_file(BIO_INIT_FILE)

    outputFile = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-results-bioSeq.txt'
    bioSeq = biological_sequence(net, nodes_list, bio_initStates, outputFile)


## to obtain and visulaize transition map in the network state space
    decStateTransMap = net_state_transition(net, nodes_list)
    nx.draw(decStateTransMap)
    plt.show()

## to find fixed point attractors and limited cycle attractors with given transition map.
    attractors = find_attractor(decStateTransMap)
    print attractors

## to save network graph as graph.ml file
    nx.write_graphml(decStateTransMap, '/Users/Kelle Dhein/C.-elegans/ControlKernalElegansGraph.graphml')
def main(args):


    ## to obtain biological sequence for the C. Elegans Early Embryonic Cell Cycle Net starting from biological inital state
    EDGE_FILE = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-net-edges-new-names.dat'
    NODE_FILE = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-net-nodes-new-names.dat'
    BIO_INIT_FILE = 'C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\elegans-bioSeq-initial.txt'

    net = inet.read_network_from_file(EDGE_FILE, NODE_FILE)
    nodes_list = inet.build_nodes_list(NODE_FILE)


    #input_file_name1 = 'time-series/%s-step%d-trans0.dat'%(network_index, maxStep)
    #input_file1 = open( input_file_name1, 'r')

    Nbr_Initial_States = np.power(2,len(nodes_list))
    maxStep = 20
    Nbr_States = 2
    historyLength = 2

    #Specify data path where to write results
    result_ai = open('C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\AI-step%d-trans0-h%d.dat'%(maxStep, historyLength),'w')
    result_te = open('C:\Users\Kelle Dhein\C.-elegans\example\SES591_SampleCode\data\elegans\TE-step%d-trans0-h%d.dat'%(maxStep, historyLength),'w')

    timeSeries = tev.time_series(net, nodes_list, Nbr_Initial_States, Nbr_States, MAX_TimeStep=20)


    print 'AI'
    AI = {}
    for n in nodes_list:
        AI[n] = info.compute_AI(timeSeries[n], historyLength, Nbr_Initial_States, Nbr_States)
        result_ai.write('%s\t%f\n'%(n, AI[n]))
        print n, AI[n]
    print 'done AI'


    print 'TE'
    TE =  defaultdict(float)
    for v in nodes_list:
        for n in nodes_list:
            TE[(v, n)] = info.compute_TE(timeSeries[v], timeSeries[n], historyLength, Nbr_Initial_States, Nbr_States)
            result_te.write('%s\t%s\t%f\n'%(v, n,TE[(v, n)] ))
            print v, n, TE[(v, n)]
    print 'done TE'