Beispiel #1
0
    network_dir, "RA_RA_active_connections_" + str(trial_number) + ".bin")
fileAxonalDelaysRA2RA = os.path.join(
    network_dir, "axonal_delays_RA2RA_" + str(trial_number) + ".bin")
fileSpikeTimes = "/home/eugene/Output/networks/chainGrowth/matureTest/test_spike_times_soma_2.bin"

#MARGIN_LATE = 0.5 # margin for the burst coming late
MARGIN_LATE = 0.0  # margin for the burst coming late

(N_RA, _, mature_indicators) = reading.read_mature_indicators(fileMature)
(_, _, active_synapses) = reading.read_synapses(fileActiveSynapses)
(_, _, axonal_delays_RA2RA) = reading.read_axonal_delays(fileAxonalDelaysRA2RA)

print "Number of HVC(RA) neurons = ", N_RA

(_, _, spike_times_soma,
 neuron_fired_soma) = reading.read_time_info(fileSpikeTimes)

#print "Dedritic spikes: ", neuron_fired_dend
#print "Dendritic spike times: ", spike_times_dend

#print "Somatic spikes: ", neuron_fired_soma
#print "Somatic spike times: ", spike_times_soma

#print ordered_soma_spikes_raw
#print ordered_soma_raw

first_spike_times = np.empty(N_RA, np.float32)
first_spike_times.fill(-1.0)

for n, time in zip(neuron_fired_soma, spike_times_soma):
    first_spike_times[n] = time[0]
Beispiel #2
0
def write_pajek_network_subset(dirname, trial_number, N, fileSpikes):
    """
    Create .net file with locations and connections between mature HVC-RA neurons in array
        first N mature neurons that spiked are plotted
    """
    file_RA_xy = os.path.join(dirname, "RA_xy_" + str(trial_number) + ".bin")

    file_training = os.path.join(dirname, "training_neurons.bin")
    file_pajek = os.path.join(dirname,
                              "network_subset_" + str(trial_number) + ".net")
    fileMature = os.path.join(dirname, "mature_" + str(trial_number) + ".bin")
    fileSuperSynapses = os.path.join(
        dirname, "RA_RA_super_connections_" + str(trial_number) + ".bin")
    fileWeights = os.path.join(dirname,
                               "weights_" + str(trial_number) + ".bin")

    coord_RA = reading.read_coordinates(file_RA_xy)
    training_neurons = reading.read_training_neurons(file_training)
    (N_RA, _, weights) = reading.read_weights(fileWeights)
    (_, _, mature_indicators) = reading.read_mature_indicators(fileMature)
    (_, _, super_synapses) = reading.read_synapses(fileSuperSynapses)

    #print list(mature_neurons)
    #mature_neurons = range(N_RA)

    # sort array with neurons and training neurons #
    training_neurons.sort()

    #fileDend = "/home/eugene/Output/networks/chainGrowth/passiveDendrite/test/noImmatureOut4/test_spike_times_dend_5.bin"
    #fileSoma = "/home/eugene/Output/networks/chainGrowth/passiveDendrite/test/noImmatureOut4/test_spike_times_soma_5.bin"

    (_, _, spike_times_soma,
     neuron_fired_soma) = reading.read_time_info(fileSpikes)

    ordered_soma_spikes_raw, ordered_soma_raw = zip(
        *sorted(zip(spike_times_soma, neuron_fired_soma)))

    first_mature_spiked = []

    for spikes, neuron_ids in zip(ordered_soma_spikes_raw, ordered_soma_raw):
        if len(first_mature_spiked) >= N:
            break

        if mature_indicators[neuron_ids[0]] == 1:
            first_mature_spiked.append(neuron_ids[0])

    first_mature_spiked.sort()

    num_neurons = len(first_mature_spiked)

    with open(file_pajek, 'w') as f:
        f.write("*Vertices {0}\n".format(num_neurons))

        for i, neuron_id in enumerate(first_mature_spiked):
            if neuron_id in training_neurons:
                f.write('{0} "{1}" {2} {3} {4} ic Green\n'.format(
                    i + 1, neuron_id, coord_RA[neuron_id][0],
                    coord_RA[neuron_id][1], coord_RA[neuron_id][2]))
            else:
                f.write('{0} "{1}" {2} {3} {4} ic Yellow\n'.format(
                    i + 1, neuron_id, coord_RA[neuron_id][0],
                    coord_RA[neuron_id][1], coord_RA[neuron_id][2]))

        f.write("*Arcs\n".format(num_neurons))

        # write targets of HVC(RA) neurons
        for i, source_id in enumerate(first_mature_spiked):
            for target_id in super_synapses[source_id]:
                try:
                    ind = utils.index(first_mature_spiked, target_id)
                    f.write('{0} {1} {2} c Green\n'.format(
                        i + 1, ind + 1, weights[source_id][target_id]))
                except ValueError:
                    continue
Beispiel #3
0
#fileSpikeTimes = os.path.join(dirname, "spike_times_soma_" + str(trial_number) + ".bin")
fileDelaysRA2RA = os.path.join(
    dirname, "axonal_delays_RA2RA_" + str(trial_number) + ".bin")
fileMature = os.path.join(dirname, "mature_" + str(trial_number) + ".bin")
fileWeights = os.path.join(dirname, "weights_" + str(trial_number) + ".bin")
fileTraining = os.path.join(dirname, "training_neurons.bin")

#fileSpikeTimes = "/home/eugene/Output/networks/chainGrowth/passiveDendrite/test/maturationTransition4/test_spike_times_soma_7.bin"
#fileSpikeTimes = "/home/eugene/results/immature/clusters/test/matTrans44/test_spike_times_soma_10.bin"

fileSpikeTimes = "/mnt/hodgkin/eugene/results/immature/clusters/matTrans54/spike_times_soma_13400.bin"

MARGIN_LATE = 0.0  # margin for the burst coming late

(N_RA, _, active_synapses) = reading.read_synapses(fileConnections)
(_, _, spike_times_raw, neuron_spiked) = reading.read_time_info(fileSpikeTimes)
(_, _, axonal_delays_RA2RA) = reading.read_axonal_delays(fileDelaysRA2RA)
(_, _, weights) = reading.read_weights(fileWeights)
(_, _, mature_indicators) = reading.read_mature_indicators(fileMature)
training_neurons = reading.read_training_neurons(fileTraining)

print "Number of HVC(RA) neurons = ", N_RA

first_spike_times = np.empty(N_RA, np.float32)
first_spike_times.fill(-1.0)

for n, time in zip(neuron_spiked, spike_times_raw):
    first_spike_times[n[0]] = time[0]

delivered_times_and_id = []
arrivals = []
Beispiel #4
0
#dirname = "/home/eugene/Output/networks/chainGrowth/passiveDendrite/maturationTransition4/"
dirname = "/mnt/hodgkin/eugene/results/immature/clusters/matTrans62/"

trial_number = 32400

fileCoordRA = os.path.join(dirname, "RA_xy_" + str(trial_number) + ".bin")
fileTraining = os.path.join(dirname, "training_neurons.bin")
#fileSoma = os.path.join(dirname, "spike_times_soma_" + str(trial_number) + ".bin")
#fileSoma = "/home/eugene/Output/networks/chainGrowth/passiveDendrite/test/noImmatureOut8/test_spike_times_soma_5.bin"
fileSoma = "/mnt/hodgkin/eugene/results/immature/clusters/test/matTrans62/trial32400/test_spike_times_soma_5.bin"

coord = reading.read_coordinates(fileCoordRA)
training_neurons = reading.read_training_neurons(fileTraining)
(_, _, mature_indicators) = reading.read_mature_indicators(os.path.join(dirname, "mature_"+str(trial_number)+".bin"))

(_, _, spike_times_soma, neuron_fired_soma) = reading.read_time_info(fileSoma)

print "Number of spiked neurons: ",len(spike_times_soma)

for spikes, neuron_id in zip(spike_times_soma, neuron_fired_soma):
    if len(spikes) > 6:
        print "Neuron {0} produced {1} spikes".format(neuron_id[0], len(spikes))

#print "Dedritic spikes: ", neuron_fired_dend
#print "Dendritic spike times: ", spike_times_dend

#print "Somatic spikes: ", neuron_fired_soma
#print "Somatic spike times: ", spike_times_soma

#print ordered_soma_spikes_raw
#print ordered_soma_raw
Beispiel #5
0
# 
# i = 0
# while i < len(neurons_in_chain):
#     if len(super_synapses[neurons_in_chain[i]]) > 0:
#         for j in super_synapses[neurons_in_chain[i]]:
#             if j not in neurons_in_chain:
#                 neurons_in_chain.append(j)
#         
#     i += 1
#     
#==============================================================================
print "Neurons in chain: ",neurons_in_chain



(trial_number, simulation_time, spike_times_soma, neuron_fired_soma) = reading.read_time_info(fileSoma)

set_neurons_in_chain = set(neurons_in_chain)

#print "Dedritic spikes: ", neuron_fired_dend
#print "Dendritic spike times: ", spike_times_dend

#print "Somatic spikes: ", neuron_fired_soma
#print "Somatic spike times: ", spike_times_soma

####################################
### Order neurons by their first spike time
####################################
ordered_soma_spikes_raw, ordered_soma_raw = zip(*sorted(zip(spike_times_soma, neuron_fired_soma)))

#print ordered_soma_spikes_raw
Beispiel #6
0
import numpy as np

fileDend_noDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthNoDelays/spike_times_dend.bin"
fileSoma_noDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthNoDelays/spike_times_soma.bin"
fileInterneuron_noDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthNoDelays/spike_times_interneuron.bin"
fileWeights_noDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthNoDelays/weights_10.bin"
fileActiveSynapses_noDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthNoDelays/RA_RA_active_connections.bin"

fileDend_zeroDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthDelays/spike_times_dend.bin"
fileSoma_zeroDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthDelays/spike_times_soma.bin"
fileInterneuron_zeroDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthDelays/spike_times_interneuron.bin"
fileWeights_zeroDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthDelays/weights_10.bin"
fileActiveSynapses_zeroDelays = "/home/eugene/Output/networks/chainGrowth/testGrowthDelays/RA_RA_active_connections.bin"

(_, _, spike_times_dend_noDelays,
 neuron_fired_dend_noDelays) = reading.read_time_info(fileDend_noDelays)
(_, _, spike_times_soma_noDelays,
 neuron_fired_soma_noDelays) = reading.read_time_info(fileSoma_noDelays)
(_, _, spike_times_interneuron_noDelays,
 interneuron_fired_noDelays) = reading.read_time_info(fileInterneuron_noDelays)

(_, _, spike_times_dend_zeroDelays,
 neuron_fired_dend_zeroDelays) = reading.read_time_info(fileDend_zeroDelays)
(_, _, spike_times_soma_zeroDelays,
 neuron_fired_soma_zeroDelays) = reading.read_time_info(fileSoma_zeroDelays)
(_, _, spike_times_interneuron_zeroDelays, interneuron_fired_zeroDelays
 ) = reading.read_time_info(fileInterneuron_zeroDelays)

(_, _, weights_noDelays) = reading.read_weights(fileWeights_noDelays)
(_, _, weights_zeroDelays) = reading.read_weights(fileWeights_zeroDelays)