def main(argv = None): if argv is None: argv = sys.argv parser = argparse.ArgumentParser(prog="genPreBotBot_gamma", description = 'Generates Graph based on Block Model with varying amounts of intra inhibition') parser.add_argument('n0', type = int, help='number of nodes in pop1') parser.add_argument('n1', type = int, help='number of nodes in pop2') parser.add_argument('gamma', type = float, help='the percentage of unifrom inhbiiton') parser.add_argument('output', help='output filename') parser.add_argument('-pI', type = float, help = 'probability of inhibitory neuron', default = .2) parser.add_argument('-gE', type=float, help='conductance of excitatory (E) synapses, nS', default = 2.5) parser.add_argument('-gI', type=float, help='conductance of inhibitory (I) synapses, nS', default = 2.5) args = parser.parse_args(argv[1:]) n0 = args.n0 n1 = args.n1 #Multiply by a factor of 3/2 to maintain an average degree of 6 for each neuron gamma = 3*float(args.gamma) / 2 output = args.output gE = args.gE gI = args.gI pI = args.pI #Each column of a matrix is responsible for the probability that index 1 connects to index 2 #Excitatory connection probability matrix pMatE = np.array([ (3.0/(n0-1), 0.05/n1), (0.05/n0, 3.0/(n1-1)) ]) #Inhibitory connection probaility matrix pMatI = np.array([ (gamma/(n0-1), (3.0-gamma)/n1), ((3.0-gamma)/n0, gamma/(n1-1)) ]) #Probability distribution for neuron types (?,Bursting,Tonic,Quiescent) pTypes = [0, 0.25, 0.45, 0.3] print pMatE print pMatI g = respirnet.er_prebot_bot(n0,n1,pMatI, pMatE, pTypes, pI, gE, gI) nx.write_gml(g, output + '.gml')
def main(argv = None): if argv is None: argv = sys.argv parser = argparse.ArgumentParser(prog="genPreBotBot_gamma", description = 'Generates Graph based on Block Model with varying amounts of intra inhibition') parser.add_argument('n0', type = int, help='number of nodes in pop1') parser.add_argument('n1', type = int, help='number of nodes in pop2') parser.add_argument('intraDegree', type = float, help='the average degree for a population to itself') parser.add_argument('interDegree',type = float, help='the average degree for a population to the other') parser.add_argument('output', help='output filename') parser.add_argument('-pI', type = float, help = 'probability of inhibitory neuron', default = .2) parser.add_argument('-gE', type=float, help='conductance of excitatory (E) synapses, nS', default = 2.5) parser.add_argument('-gI', type=float, help='conductance of inhibitory (I) synapses, nS', default = 2.5) args = parser.parse_args(argv[1:]) n0 = args.n0 n1 = args.n1 intraDegree = args.intraDegree interDegree = args.interDegree output = args.output gE = args.gE gI = args.gI pI = args.pI #Each column of a matrix is responsible for the probability that index 1 connects to index 2 #Excitatory connection probability matrix pMatE = np.array([ (3.0/(n0-1), 0.00/n1), (0.00/n0, 3.0/(n1-1)) ]) #Inhibitory connection probaility matrix pMatI = np.array([ (intraDegree/(n0-1), interDegree/n1), (interDegree/n0, intraDegree/(n1-1)) ]) #Probability distribution for neuron types (?,Bursting,Tonic,Quiescent) pTypes = [0, 0.25, 0.45, 0.3] g = respirnet.er_prebot_bot(n0,n1,pMatI, pMatE, pTypes, pI, gE, gI) nx.write_gml(g, output)
def main(argv=None): if argv is None: argv = sys.argv parser = argparse.ArgumentParser( prog="genPreBotBot", description='Generates Graph based on Block Model') parser.add_argument('n', type=int, help='number of nodes') parser.add_argument('idegree', type=float, help='probabilty of inhibtory connection degree') parser.add_argument('output', help='output filename') parser.add_argument('-pI', type=float, help='probability of inhibitory neuron', default=.2) parser.add_argument('-gE', type=float, help='conductance of excitatory (E) synapses, nS', default=2.5) parser.add_argument('-gI', type=float, help='conductance of inhibitory (I) synapses, nS', default=2.5) args = parser.parse_args(argv[1:]) n = args.n idegree = float(args.idegree) output = args.output gE = args.gE gI = args.gI pI = args.pI pMatE = np.array([(3.0 / (n - 1), 0.05 / (n - 1)), (0.05 / (n - 1), 3.0 / (n - 1))]) ###Idegree normally all the same, however changing to sweep block structure pMatI = np.array([(idegree / (n - 1), (3.0 - idegree) / (n - 1)), ((3.0 - idegree) / (n - 1), idegree / (n - 1))]) pTypes = [0, 0.25, 0.45, 0.3] g = respirnet.er_prebot_bot(n, pMatI, pMatE, pTypes, pI, gE, gI) nx.write_gml(g, output)
def main(argv = None): if argv is None: argv = sys.argv parser = argparse.ArgumentParser(prog="genPreBotBot", description = 'Generates Graph based on Block Model') parser.add_argument('n', type = int, help='number of nodes') parser.add_argument('idegree', type = float, help='probabilty of inhibtory connection degree') parser.add_argument('output', help='output filename') parser.add_argument('-pI', type = float, help = 'probability of inhibitory neuron', default = .2) parser.add_argument('-gE', type=float, help='conductance of excitatory (E) synapses, nS', default = 2.5) parser.add_argument('-gI', type=float, help='conductance of inhibitory (I) synapses, nS', default = 2.5) args = parser.parse_args(argv[1:]) n = args.n idegree = float(args.idegree) output = args.output gE = args.gE gI = args.gI pI = args.pI pMatE = np.array([ (3.0/(n-1), 0.05/(n-1)), (0.05/(n-1), 3.0/(n-1)) ]) ###Idegree normally all the same, however changing to sweep block structure pMatI = np.array([ (idegree/(n-1), (3.0-idegree)/(n-1)), ((3.0-idegree)/(n-1), idegree/(n-1)) ]) pTypes = [0, 0.25, 0.45, 0.3] g = respirnet.er_prebot_bot(n, pMatI, pMatE, pTypes, pI, gE, gI) nx.write_gml(g, output)
import networkx as nx pTypes = [0, 0.25, 0.45, 0.3] n0 = 100 n1 = 100 # pI = 0.2 # gE = 2.0 # gI = 5.0 # a = 2.5 # b = 0.5 # c = 0.5 # d = 2.5 # these work: # n0 = 200 # n1 = 100 pI = 0.2 gE = 2.5 gI = 5.0 a = 3.0 b = 0.5 c = 0.5 d = 3.0 pMatE = np.array([(a/(n0-1), b/(n1-1)), (b/(n0-1), a/(n1-1))]) pMatI = np.array([(c/(n0-1), d/(n1-1)), (d/(n0-1), c/(n1-1))]) g = respirnet.er_prebot_bot(n0, n1, pMatI, pMatE, pTypes, pI, gE, gI) nx.write_gml(g, 'test_prebot_bot.gml')